  :root {
    --size: 15px;
    --mono: Consolas, "Cascadia Mono", "Courier New", monospace;
    --bg: #1e1e1e;
    --bar: #2d2d30;
    --border: #454545;
    --text: #d4d4d4;
    --muted: #9a9a9a;
    --current: #4d4a12;
    --mark: #ffd33d;
    --primary: #0e639c;
    --bad: #f48771;
  }
  * { box-sizing: border-box; }
  html, body { height: 100%; margin: 0; }
  body {
    display: flex; flex-direction: column;
    background: var(--bg); color: var(--text);
    font: 14px "Segoe UI", system-ui, sans-serif;
  }

  header {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
    padding: 8px 16px; background: var(--bar); border-bottom: 1px solid var(--border);
  }
  h1 { flex: 1 1 240px; min-width: 0; margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
  .controls { display: flex; flex-wrap: wrap; gap: 6px; }
  button {
    display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px;
    font: inherit; color: var(--text); background: #3c3c3c;
    border: 1px solid var(--border); border-radius: 4px; cursor: pointer;
  }
  button:hover:not(:disabled) { background: #4a4a4a; }
  button:focus-visible { outline: 2px solid var(--mark); outline-offset: 1px; }
  button:disabled { opacity: .4; cursor: default; }
  button.primary { background: var(--primary); border-color: #1a85c9; color: #fff; }
  button.primary:hover:not(:disabled) { background: #1177bb; }
  kbd { padding: 0 5px; font: 12px var(--mono); background: rgba(0, 0, 0, .35); border-radius: 3px; }

  main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  section { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
  #left { border-right: 1px solid var(--border); }

  #tabs { display: flex; flex-wrap: wrap; background: var(--bar); }
  #tabs button {
    border: 0; border-right: 1px solid var(--border); border-radius: 0;
    background: transparent; color: var(--muted); font: 13px var(--mono);
  }
  #tabs button.shown { background: var(--bg); color: #fff; box-shadow: inset 0 2px 0 var(--mark); }
  #tabs button.running::after { content: "\25CF"; color: var(--mark); font-size: 10px; }

  #code { flex: 1; min-height: 0; overflow: auto; }
  .file { display: none; width: max-content; min-width: 100%; padding: 8px 0 45vh; font: var(--size)/1.5 var(--mono); }
  .file.shown { display: block; }
  /* The interface of a class whose code is not shown (see interface_doc.py): text to read, not lines of code. */
  .file.interface { width: auto; max-width: 78ch; padding: 4px 18px 45vh; font: var(--size)/1.55 "Segoe UI", system-ui, sans-serif; }
  .file.interface code { font: .95em var(--mono); }
  .file.interface h2 { font-size: 1.15em; margin: 10px 0 6px; } .file.interface h3 { font-size: 1.02em; margin: 14px 0 4px; }
  .file.interface ul { margin: 4px 0; padding-left: 22px; }
  .ln { display: flex; min-height: 1.5em; white-space: pre; }
  .num {
    position: sticky; left: 0; flex: none; width: 7ch; padding-right: 2ch;
    text-align: right; color: #6e7681; background: var(--bg); user-select: none;
  }
  .he { display: inline-block; unicode-bidi: plaintext; text-align: left; }
  .ln.current { background: var(--current); box-shadow: inset 0 1px 0 var(--mark), inset 0 -1px 0 var(--mark); }
  .ln.current .num { background: var(--mark); color: #000; font-weight: 700; }
  .ln.problem { background: #4b2a24; box-shadow: inset 0 1px 0 var(--bad), inset 0 -1px 0 var(--bad); }
  .ln.problem .num { background: var(--bad); color: #000; font-weight: 700; }
  .k { color: #569cd6; } .t { color: #4ec9b0; } .f { color: #dcdcaa; }
  .s { color: #ce9178; } .n { color: #b5cea8; } .c { color: #6a9955; }

  #status {
    padding: 8px 16px; min-height: 58px; background: var(--bar); border-top: 1px solid var(--border);
    font-size: 15px;
  }
  #returned { margin-top: 2px; font: 14px var(--mono); color: var(--mark); overflow-wrap: anywhere; }

  .pane-title {
    padding: 5px 12px; font-size: 12px; letter-spacing: .04em; color: var(--muted);
    background: var(--bar); border-bottom: 1px solid var(--border);
  }

  /* The pane takes the height of its text, up to a limit, and the panes below take the rest. */
  #topics-pane { flex: 0 1 auto; max-height: 45%; min-height: 0; display: flex; flex-direction: column; }
  #topics-pane[hidden] { display: none; }
  #topics-pane.collapsed { flex: none; }
  #topics-title { display: flex; align-items: center; padding: 0; }
  #topics-toggle {
    flex: 1; padding: 5px 12px; border: 0; border-radius: 0; background: transparent;
    color: inherit; font: inherit; letter-spacing: inherit;
  }
  #topics-toggle:hover { color: var(--text); }
  #topics-toggle::before { content: "\25BE"; font-size: 16px; line-height: 1; color: var(--text); }
  #topics-toggle[aria-expanded="false"]::before { content: "\25B8"; }
  #topics-pane.collapsed #topics { display: none; }
  #topics {
    flex: 0 1 auto; min-height: 0; overflow: auto; padding: 2px 16px 10px;
    border-bottom: 1px solid var(--border);
    font: var(--size)/1.5 "Segoe UI", system-ui, sans-serif;
  }
  .topics-view { display: none; }
  .topics-view.shown { display: block; }
  .topics-view h2, .topics-view h3, .topics-view h4 { margin: 10px 0 4px; font-size: 1em; font-weight: 600; color: #fff; }
  .topics-view p { margin: 0 0 6px; }
  .topics-view ul, .topics-view ol { margin: 0; padding-inline-start: 24px; }
  .topics-view li > ul, .topics-view li > ol { margin-top: 3px; }
  .topics-view li > p { margin: 4px 0; }
  .topics-view pre {
    margin: 4px 0; padding: 4px 10px; overflow: auto; background: rgba(0, 0, 0, .3); border-radius: 3px;
    font: .92em var(--mono); direction: ltr; text-align: left; unicode-bidi: isolate;
  }
  .topics-view li { margin-bottom: 3px; }
  .topics-view strong { color: #fff; }
  .topics-view a { color: #75beff; text-decoration: none; }
  .topics-view a:hover { text-decoration: underline; }
  .topics-view a:focus-visible { outline: 2px solid var(--mark); outline-offset: 1px; }
  .topics-view code {
    padding: 0 4px; border-radius: 3px; background: rgba(255, 255, 255, .09);
    font: .92em var(--mono);
    /* Keeps code like && in its own direction inside a Hebrew sentence. */
    direction: ltr; unicode-bidi: isolate;
  }
  /* The code of a block is not a `code` of a sentence: its padding would push only its first line to the right. */
  .topics-view pre code { padding: 0; background: none; }

  /* While the program starts again (the live tool starts the JRE, the recorded site loads the recording), the whole window is dimmed and cannot be used: an hourglass turns over on it. */
  #restarting { position: fixed; inset: 0; z-index: 200000; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .6); cursor: progress; }
  #restarting svg { width: 64px; height: 64px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; animation: hourglass-turn 1.6s ease-in-out infinite; }
  #restarting svg .sand { fill: #fff; stroke: none; }
  @keyframes hourglass-turn { 0%, 45% { transform: rotate(0deg); } 85%, 100% { transform: rotate(180deg); } }
  @media (prefers-reduced-motion: reduce) { #restarting svg { animation: none; } }
  #console-pane { flex: 3; min-height: 0; display: flex; flex-direction: column; }
  #console-title { display: flex; align-items: center; gap: 6px; padding: 3px 12px; }
  #console-name { flex: 1; }
  /* The terminal window and the variables fold to their title, as the topics do: the other one then has the room. */
  .pane-toggle { flex: 1; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; justify-content: flex-start; text-align: left; }
  .pane-toggle:hover:not(:disabled) { background: transparent; color: var(--text); }
  .pane-toggle::before { content: "\25BE"; font-size: 16px; line-height: 1; color: var(--text); }
  .pane-toggle[aria-expanded="false"]::before { content: "\25B8"; }
  #console-pane.collapsed, #variables-pane.collapsed { flex: none !important; }
  #console-pane.collapsed #console, #variables-pane.collapsed #variables { display: none; }
  :is(#right, #middle).console-folded #variables-pane:not(.collapsed), :is(#right, #middle).variables-folded #console-pane:not(.collapsed) { flex: 1 1 0px !important; }
  :is(#right, #middle).console-folded #splitter, :is(#right, #middle).variables-folded #splitter { display: none; }
  #console-pane.collapsed #type { display: none; }
  /* A folded pane goes down to the bottom of its column, and the panes that are open take the room that it left (the topics have no limit then). */
  #topics-pane.collapsed, #console-pane.collapsed, #variables-pane.collapsed { order: 10; }
  #right.console-folded.variables-folded #topics-pane.collapsed, #middle.console-folded.variables-folded #console-pane { margin-top: auto; }
  #right.console-folded.variables-folded #topics-pane:not(.collapsed) { flex: 1 1 0px; max-height: none; }
  #console-title button { padding: 1px 9px; font-size: 12px; letter-spacing: normal; }
  #console-title button[hidden] { display: none; }
  #console-pane.writing #console { outline: 2px solid var(--mark); outline-offset: -2px; }
  #typing {
    max-width: 100%; margin: 0; padding: 0; border: 0; outline: 0;
    background: transparent; color: #5fe08f; caret-color: #fff; font: inherit;
  }
  #console {
    flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 10px 12px;
    background: #0c0c0c; color: #cccccc; font: var(--size)/1.4 var(--mono);
    white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; text-align: left;
  }
  #console.drawing { white-space: pre; overflow-wrap: normal; line-height: 1.15; }
  #console .command { color: #8a8a8a; }
  #console .typed { color: #5fe08f; }
  #console .fresh { color: #fff; background: #27324a; }
  #console .ended { color: #8a8a8a; }
  #console .warning { color: var(--mark); }
  #console .compile-error { color: var(--bad); }
  #console .cursor { animation: blink 1.1s steps(2) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { #console .cursor { animation: none; } }

  #variables-pane { flex: 2; min-height: 0; display: flex; flex-direction: column; }
  #variables { flex: 1; min-height: 0; overflow: auto; padding: 4px 12px 12px; font: calc(var(--size) - 1px)/1.5 var(--mono); }
  .frame-title { margin-top: 8px; color: var(--muted); font-family: "Segoe UI", system-ui, sans-serif; font-size: 13px; }
  .frame-title.running { color: var(--mark); font-weight: 600; }
  .frame:not(.is-running) .row { opacity: .72; }
  .row { white-space: pre; }
  .row .type { color: #4ec9b0; }
  .row .value { padding: 0 3px; }
  .row.changed .value { background: var(--mark); color: #000; border-radius: 3px; }
  .fold, .fold-space { display: inline-block; flex: none; width: 2ch; }
  button.fold {
    padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--muted);
    font: inherit; line-height: inherit; text-align: left; cursor: pointer;
  }
  button.fold:hover { color: var(--text); }
  .array-box { padding-bottom: 4px; }
  .frame:not(.is-running) .array-box { opacity: .72; }
  .array-table { border-collapse: collapse; }
  .array-table th, .array-table td { padding: 1px 9px; border: 1px solid var(--border); text-align: left; white-space: pre; }
  .array-table th { font-weight: 400; color: var(--text); background: #262628; }
  .array-table th .type { font-size: .85em; }
  .array-table th.index { text-align: right; color: var(--muted); }
  .array-table .muted { color: var(--muted); }
  .array-table td.changed { background: var(--mark); color: #000; }

  #splitter {
    flex: none; height: 7px; background: var(--bar); cursor: row-resize; touch-action: none;
    border-top: 1px solid var(--border);
  }
  #splitter:hover, #splitter.dragging { background: #3e3e42; }
  #splitter:focus-visible { outline: 2px solid var(--mark); outline-offset: -2px; }
  #no-variables { margin-top: 8px; color: var(--muted); font-family: "Segoe UI", system-ui, sans-serif; }

  @media (max-width: 800px) {
    html, body { height: auto; }
    main { grid-template-columns: minmax(0, 1fr); }
    #left { border-right: 0; }
    #topics-pane { max-height: none; }
    #topics { max-height: 40vh; }
    #code { height: 50vh; flex: none; }
    #console { height: 34vh; flex: none; }
    #variables { max-height: 40vh; }
    #splitter { display: none; }
  }

  /* The references of the word that is selected in the code (see word_highlight.py). */
  ::highlight(reference) { background-color: rgba(255, 190, 0, .42); }


  #disclaimer { flex: none; padding: 4px 16px; background: #2d2d30; border-top: 1px solid #454545; color: #9a9a9a; font: 12px/1.5 "Segoe UI", system-ui, sans-serif; }
  #disclaimer summary { cursor: pointer; overflow-wrap: anywhere; }
  #disclaimer .notice { max-height: 40vh; overflow: auto; }
  #disclaimer h2 { display: none; }
  #disclaimer p { margin: 6px 0; max-width: 120ch; }


  #report-issue[hidden] { display: none; }
  #report-dialog {
    width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 16px 20px;
    color: var(--text); background: var(--bar); border: 1px solid var(--border); border-radius: 6px;
    font: 14px "Segoe UI", system-ui, sans-serif;
  }
  #report-dialog::backdrop { background: rgba(0, 0, 0, .55); }
  #report-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
  #report-head h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
  #report-languages { display: flex; }
  #report-languages button { padding: 1px 9px; border-radius: 0; background: transparent; color: var(--muted); font-size: 12px; }
  #report-languages button + button { margin-inline-start: -1px; }
  #report-languages button:hover { color: var(--text); }
  #report-languages button[aria-pressed="true"] { background: var(--primary); border-color: #1a85c9; color: #fff; }
  #report-chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
  #report-chosen[hidden] { display: none; }
  #report-chosen .chosen { padding: 1px 8px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); }
  .report-step[hidden] { display: none; }
  .report-question, #report-details-title { display: block; margin: 0 0 6px; padding: 0; font-size: 14px; font-weight: 600; }
  .report-choices { display: flex; flex-direction: column; gap: 4px; }
  .report-choices button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 8px; text-align: start;
    color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 4px; font: inherit;
  }
  .report-choices button:hover { border-color: var(--primary); }
  .report-choices button:focus-visible { outline: 2px solid var(--mark); outline-offset: 1px; }
  .report-choices button[aria-current="true"] { border-color: var(--primary); }
  .report-choices kbd { min-width: 1.4em; text-align: center; }
  .report-choices .button-name { margin-inline-start: auto; font: 12px var(--mono); color: var(--muted); }
  #report-details {
    display: block; width: 100%; padding: 6px 8px; resize: vertical;
    color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 4px; font: inherit;
  }
  #report-details:focus-visible { outline: 2px solid var(--mark); outline-offset: 1px; }
  #report-about { margin: 12px 0 0; overflow-wrap: anywhere; }
  #report-path { font: 12px var(--mono); color: var(--muted); unicode-bidi: isolate; }
  #report-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
  #report-buttons { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; }
  #report-buttons [hidden] { display: none; }
  #report-back { margin-inline-end: auto; }
  h1 { font-size: 18px; }
  /* A page in Hebrew: the title is on the right and the buttons are on the left (the order of the buttons does not change). */
  html[data-language="he"] header { flex-direction: row-reverse; justify-content: flex-end; }
  #exercise[hidden] { display: none; }
  #middle { border-right: 1px solid var(--border); }
  #topics-pane { flex: 1 1 auto; max-height: none; }
  #topics { flex: 1 1 auto; border-bottom: 0; }
  @media (min-width: 801px) {
    main { grid-template-columns: minmax(0, 4fr) minmax(0, 3fr) minmax(0, 3fr); }
    /* With the topics closed, their column is only the bar with the button that opens them. */
    main:has(#topics-pane.collapsed) { grid-template-columns: minmax(0, 4fr) minmax(0, 3fr) auto; }
  }
  @media (max-width: 800px) { #middle { border-right: 0; } }

  #recording-end-dialog { width: min(max(420px, 50vw), 560px, calc(100vw - 24px)); box-sizing: border-box; padding: 4px 22px 18px; border: 1px solid var(--border);
    border-radius: 6px; background: var(--bar); color: var(--text); font: 14px/1.5 "Segoe UI", system-ui, sans-serif; }
  #recording-end-dialog::backdrop { background: rgba(0, 0, 0, .55); }
  #recording-end-dialog h2 { margin: 10px 0 6px; font-size: 17px; }
  #recording-end-dialog p { margin: 8px 0; }
  #recording-end-dialog div[lang="he"] { margin-top: 10px; padding-top: 4px; border-top: 1px solid var(--border); }
  #recording-end-dialog button { margin-top: 8px; padding: 7px 26px; font: inherit; color: #fff; background: #0e639c; border: 1px solid #1a85c9; border-radius: 4px; cursor: pointer; }
  #recording-end-dialog button:hover { background: #1177bb; }
  #recording-end-dialog button:focus-visible { outline: 2px solid #ffd33d; outline-offset: 2px; }
  #choices { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 14px 18px; background: var(--bar); border-top: 1px solid var(--border); }
  #choices .hint { flex: 1 0 100%; color: var(--muted); font-size: 15px; }
  #choices button { padding: 9px 18px; font: 17px var(--mono); }
  #choices .row { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
  #choices .wait { font-size: 46px; line-height: 1; margin-right: 6px; color: var(--mark); animation: wait-blink 1s ease-in-out infinite; }
  @keyframes wait-blink { 50% { opacity: .12; } }
  @media (prefers-reduced-motion: reduce) { #choices .wait { animation: none; } }

/* --- The light look: the colors only --- */
:root[data-theme="light"] { color-scheme: light; --bg: #ffffff; --bar: #eef0f3; --border: #c8ccd1; --text: #1f2328; --muted: #57606a; --current: #fff1a8; --mark: #e0a800; --primary: #0b66c3; --bad: #cf222e; }
:root[data-theme="light"] :is(button, a.button):not(.primary):not(.fold) { background: #f3f4f6; }
:root[data-theme="light"] :is(button, a.button):not(.primary):not(.fold):hover:not(:disabled) { background: #e3e6ea; }
:root[data-theme="light"] :focus-visible { outline-color: #0969da; }
:root[data-theme="light"] kbd { background: rgba(0, 0, 0, .09); }
:root[data-theme="light"] a:not(.button) { color: #0550ae; }
:root[data-theme="light"] button.primary, :root[data-theme="light"] a.button.primary { color: #fff; }
:root[data-theme="light"] a.button.primary { background: var(--primary); border-color: #1a85c9; }
:root[data-theme="light"] a.button.primary:hover { background: #1177bb; }
:root[data-theme="light"] h1 span { color: #8a5a00; }
:root[data-theme="light"] #tabs button.shown { color: #000; }
:root[data-theme="light"] .ln.problem { background: #ffe0dc; }
:root[data-theme="light"] .ln.problem .num { color: #fff; }
:root[data-theme="light"] .k { color: #0033b3; } :root[data-theme="light"] .t { color: #1a7f8e; } :root[data-theme="light"] .f { color: #795e26; }
:root[data-theme="light"] .s { color: #a31515; } :root[data-theme="light"] .n { color: #0b6e4f; } :root[data-theme="light"] .c { color: #1f7a1f; }
:root[data-theme="light"] #returned, :root[data-theme="light"] .frame-title.running { color: #8a5a00; }
:root[data-theme="light"] .topics-view h2, :root[data-theme="light"] .topics-view h3, :root[data-theme="light"] .topics-view h4, :root[data-theme="light"] .topics-view strong, :root[data-theme="light"] .view h2, :root[data-theme="light"] .view h3, :root[data-theme="light"] .view h4 { color: #000; }
:root[data-theme="light"] .topics-view a, :root[data-theme="light"] .view a { color: #0550ae; }
:root[data-theme="light"] .topics-view pre, :root[data-theme="light"] .view pre { background: rgba(0, 0, 0, .06); }
:root[data-theme="light"] .topics-view code, :root[data-theme="light"] .view code { background: rgba(0, 0, 0, .07); }
:root[data-theme="light"] .topics-view pre code, :root[data-theme="light"] .view pre code { background: none; }
:root[data-theme="light"] #console { background: #f6f8fa; color: #24292f; }
:root[data-theme="light"] #console .command, :root[data-theme="light"] #console .ended { color: #57606a; }
:root[data-theme="light"] #console .typed, :root[data-theme="light"] #typing { color: #116329; }
:root[data-theme="light"] #typing { caret-color: #000; }
:root[data-theme="light"] #console .fresh { color: #000; background: #dbe9ff; }
:root[data-theme="light"] #console .warning { color: #8a5a00; }
:root[data-theme="light"] #console .compile-error { color: #cf222e; }
:root[data-theme="light"] .row .type { color: #1a7f8e; }
:root[data-theme="light"] .array-table th { background: #f1f3f5; }
:root[data-theme="light"] #splitter:hover, :root[data-theme="light"] #splitter.dragging { background: #d0d7de; }
:root[data-theme="light"] #choices .wait { color: #9a4a00; }
:root[data-theme="light"] #disclaimer { background: #eef0f3; border-top-color: #c8ccd1; color: #57606a; }
:root[data-theme="light"] #disclaimer-dialog, :root[data-theme="light"] #welcome-dialog { background: #ffffff; color: #1f2328; border-color: #c8ccd1; }
:root[data-theme="light"] #welcome-dialog p { color: #57606a; }
:root[data-theme="light"] .dialog-languages button { background: #f3f4f6 !important; color: #1f2328 !important; border-color: #c8ccd1 !important; }
:root[data-theme="light"] .dialog-languages button[aria-pressed="true"] { background: #0b66c3 !important; color: #ffffff !important; border-color: #0b66c3 !important; }
:root[data-theme="light"] #disclaimer-dialog div[lang="he"], :root[data-theme="light"] #welcome-dialog div[lang="he"] { border-top-color: #c8ccd1; }
:root[data-theme="light"] summary:hover { background: #eaeef2; }
:root[data-theme="light"] tr:hover { background: #f6f8fa; }
:root[data-theme="light"] #search { background: #ffffff; }
:root[data-theme="light"] tr.last-opened > * { background: rgba(224, 168, 0, .30); }
:root[data-theme="light"] tr.last-opened:hover > * { background: rgba(224, 168, 0, .38); }
:root[data-theme="light"] tr.found > *, :root[data-theme="light"] tr.found:hover > * { background: rgba(9, 105, 218, .14); }
:root[data-theme="light"] tr.found > :first-child { box-shadow: inset 3px 0 0 #0969da; }
html[dir="rtl"][data-theme="light"] tr.found > :first-child { box-shadow: inset -3px 0 0 #0969da; }

  /* The button bar: along the top, in the header (as it was), or vertical at the left or the right edge of the window, wide (icon, label and key) or narrow (only the icon). */
  #button-bar [hidden] { display: none !important; }
  .bar-sep { flex: none; align-self: center; width: 1px; height: 22px; margin: 0 4px; background: var(--border); }
  .icon { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .icon .fill { fill: currentColor; stroke: none; }
  .icon .lit { fill: var(--mark); stroke: var(--mark); }
  #dock-button { padding: 4px 7px; }
  #dock-button svg { display: block; }
  /* The language button: only its icon is seen (the letters of the language that a click goes to); its name is in the tip. */
  #button-bar > button.language .label { display: none; }
  #dock-button .label { display: none; }
  /* The groups (Settings, Edit): the button of the group, and the buttons after it that are put away while the group is closed. */
  #button-bar > .in-closed-group { display: none !important; }
  .bar-group .group-icon { position: relative; display: inline-flex; flex: none; }
  /* The small triangle next to the icon, out of it: closed, it points to where the list opens (under the icon in the top bar, to the side in a side bar);
     open, it points along the buttons of the group (to the side in the top bar, down in a side bar). */
  .bar-group .group-arrow { position: absolute; width: 0; height: 0; border: 0 solid transparent; color: #fff; }
  :root[data-theme="light"] .bar-group .group-arrow { color: var(--text); }
  .bar-group[aria-expanded="false"] .group-arrow { top: calc(100% + 1px); left: 50%; margin-left: -4px; border-width: 3.5px 4px 0; border-top-color: currentColor; }
  .bar-group[aria-expanded="true"] .group-arrow { left: calc(100% + 2px); top: 50%; margin-top: -4px; border-width: 4px 0 4px 3.5px; border-left-color: currentColor; }
  /* Room for the triangle: the icon goes a little up when the triangle is under it, and the name moves away when it is beside it. */
  .bar-group[aria-expanded="false"] .group-icon { top: -2px; }
  .bar-group[aria-expanded="true"] .group-icon { margin-right: 6px; }
  /* The list of a closed group, when the pointer is on its button: all its buttons, with their icons and their names. */
  .bar-group-menu { position: fixed; z-index: 100004; display: flex; flex-direction: column; gap: 2px; width: max-content; max-width: min(420px, calc(100vw - 8px)); padding: 4px;
    background: var(--bar); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
  .bar-group-menu .bar-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; border: 1px solid transparent; border-radius: 4px;
    background: transparent; color: var(--text); text-align: start; font: inherit; white-space: nowrap; }
  .bar-group-menu .bar-menu-item:hover:not(:disabled), .bar-group-menu .bar-menu-item:focus-visible { background: rgba(128, 128, 128, .22); }
  .bar-group-menu .bar-menu-item[aria-checked="true"] { border-color: var(--mark); }
  .bar-group-menu .bar-menu-item .label { flex: 1; }
  .bar-group-menu .bar-menu-item kbd { margin-inline-start: 12px; }
  .bar-group-menu .bar-menu-sep { height: 1px; margin: 3px 4px; background: var(--border); }
  @media (min-width: 701px) {
    html[data-dock^="left"] #button-bar, html[data-dock^="right"] #button-bar {
      position: fixed; top: var(--bar-top, 48px); bottom: var(--bar-bottom, 0px); z-index: 20; width: var(--bar-width, 152px);
      display: flex; flex-direction: column; flex-wrap: nowrap; gap: 6px; padding: 10px 8px; overflow-y: auto; background: var(--bar);
    }
    html[data-dock^="left"] #button-bar { left: 0; border-right: 1px solid var(--border); }
    html[data-dock^="right"] #button-bar { right: 0; border-left: 1px solid var(--border); }
    html[data-dock^="left"] body > main { margin-left: var(--bar-width, 152px); }
    html[data-dock^="right"] body > main { margin-right: var(--bar-width, 152px); }
    html[data-dock] #button-bar > button, html[data-dock] #button-bar > a.button { flex: none; width: 100%; justify-content: space-between; }
    html[data-dock] #button-bar > button .label, html[data-dock] #button-bar > a.button .label { flex: 1; text-align: left; }
    html[data-dock] #button-bar > .bar-sep { width: 100%; height: 1px; margin: 4px 0; }
    html[data-dock] .bar-group[aria-expanded="false"] .group-arrow { top: 50%; margin: -4px 0 0; border-width: 4px 0 4px 3.5px; border-color: transparent; border-left-color: currentColor; }
    html[data-dock^="left"] .bar-group[aria-expanded="false"] .group-arrow { left: calc(100% + 2px); }
    html[data-dock^="right"] .bar-group[aria-expanded="false"] .group-arrow { left: auto; right: calc(100% + 2px); border-width: 4px 3.5px 4px 0; border-left-color: transparent; border-right-color: currentColor; }
    html[data-dock] .bar-group[aria-expanded="true"] .group-arrow { top: calc(100% + 1px); left: 50%; margin: 0 0 0 -4px; border-width: 3.5px 4px 0; border-color: transparent; border-top-color: currentColor; }
    html[data-dock^="left"] .bar-group[aria-expanded="false"] .group-icon { top: 0; margin-right: 6px; }
    html[data-dock^="right"] .bar-group[aria-expanded="false"] .group-icon { top: 0; margin-left: 6px; }
    html[data-dock] .bar-group[aria-expanded="true"] .group-icon { top: -2px; margin: 0; }
    /* The narrow bar: only the icons (the tip of a button has its name and its key). */
    html[data-dock$="-narrow"] { --bar-width: 46px; }
    html[data-dock$="-narrow"] #button-bar { padding: 10px 5px; }
    html[data-dock$="-narrow"] #button-bar > button, html[data-dock$="-narrow"] #button-bar > a.button { justify-content: center; padding: 7px 0; }
    html[data-dock$="-narrow"] #button-bar .label, html[data-dock$="-narrow"] #button-bar kbd { display: none; }
  }
  /* The dialog at the edge of a unit: Prev on the first page of a unit, or Next on its last (showUnitEdge). */
  #unit-edge-dialog { min-width: min(320px, calc(100vw - 24px)); padding: 6px 22px 16px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--bar); color: var(--text); font: 15px/1.5 "Segoe UI", system-ui, sans-serif; text-align: center; }
  #unit-edge-dialog::backdrop { background: rgba(0, 0, 0, .55); }
  #unit-edge-dialog p { margin: 14px 0; font-size: 17px; }
  #unit-edge-dialog button { padding: 6px 26px; font: inherit; color: #fff; background: #0e639c; border: 1px solid #1a85c9; border-radius: 4px; cursor: pointer; }
  #unit-edge-dialog button:hover { background: #1177bb; }
  #unit-edge-dialog button:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }
