.book-workbench { display: grid; gap: 28px; }
.book-workbench[hidden] { display: none; }
.book-page select:enabled { cursor: pointer; }
.book-page select:not([multiple]):not([size]) { text-overflow: ellipsis; }
.maia-page .doppelmaia-title .personality-title-prefix { flex: 0 0 0.565em; min-width: 0; align-self: center; transform: translateY(-3px); font-family: "PBookSmith Whisper", cursive; font-size: 60px; line-height: 0.5; font-weight: 700; -webkit-text-stroke: 0.5px currentcolor; }
.book-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(440px, calc(100% - 24px)); margin: 0 auto 20px; padding: 0; }
.book-mode.book-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(440px, calc(100% - 24px)); padding: 0; }
.book-tabs a { display: flex; min-width: 0; min-height: 44px; align-items: center; justify-content: center; padding: 0 12px; color: #213a43; font-family: "Mona Sans"; font-size: 15px; font-weight: 600; text-align: center; text-decoration: none; white-space: nowrap; box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%), inset 0 -3px 5px rgb(33 58 67 / 12%); transition: background-color 0.1s, color 0.1s; }
.book-tabs a + a { border-left: 1px solid rgb(33 58 67 / 25%); }
.book-tabs a:hover:not([aria-current="page"]) { background: rgb(33 58 67 / 6%); }
.book-tabs a[aria-current="page"] { color: white; background: #213a43; box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), inset 0 -3px 5px rgb(0 0 0 / 18%); }
.book-tabs a:focus-visible { outline: 2px solid #527783; outline-offset: -3px; }
.book-tabs a[aria-current="page"]:focus-visible { outline-color: #a6c1c6; }
.personality-toolbar, .personality-wide { grid-column: 1 / -1; }
.personality-toolbar, .personality-batch-fields, .personality-results-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.personality-toolbar .tool-field { flex: 1; min-width: 120px; }
.personality-toolbar input, .personality-toolbar select { width: 100%; }
.personality-editor { min-width: 0; }
.personality-editor details { border-bottom: 1px solid #ebebeb; padding: 10px 0; }
.personality-editor summary, .personality-position summary { cursor: pointer; font-weight: 600; }
.personality-control { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 4px; align-items: center; padding: 7px 0; font-size: 14px; font-weight: 600; }
.personality-control .maia-field-label { display: block; grid-column: 1; grid-row: 1; min-width: 0; }
.personality-label-ending { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; vertical-align: baseline; }
.personality-label-ending label { min-width: 0; overflow-wrap: anywhere; }
.personality-label-ending .maia-field-help { flex: none; }
.book-page #personality-panel .personality-label-ending .maia-field-help > button { width: 18px; }
.personality-control label { cursor: help; }
.personality-control output { grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; text-align: right; color: #4f6881; }
.personality-control .book-move-weight { opacity: 1; background: linear-gradient(90deg, var(--book-track-empty) var(--range-start), var(--range-tone) var(--range-start), var(--range-tone) var(--range-end), var(--book-track-empty) var(--range-end)); }
.personality-bench-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.personality-batch-fields input { width: 90px; }
.personality-batch-fields select { min-width: 70px; }
.personality-fen-form { position: relative; z-index: 2; grid-column: 1; grid-row: 3; width: calc(100% + 16px); margin: -28px -8px 0; }
#personality-moves:not(:empty) { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-content: start; }
.personality-candidate { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; gap: 10px; padding: 6px 0 !important; border-bottom: 1px solid #ebebeb !important; box-shadow: inset 0 1px 1px rgb(255 255 255 / 70%), inset 0 -2px 3px rgb(33 58 67 / 5%); font-size: 14px; }
.personality-candidate .book-move-san { justify-self: start; margin-left: 10px; }
.personality-candidate small { color: #4f6881; font-variant-numeric: tabular-nums; text-align: center; }
.personality-candidate small:last-child { text-align: right; }
.personality-candidate[aria-current="true"] { background: #f0f5f6; border-radius: 4px; }
.personality-candidate[aria-current="true"] .book-move-san:hover { background: #d7e6e8; }
.personality-report-grid { display: flex; flex-wrap: wrap; gap: 24px; margin: 18px 0; }
.personality-report-grid > span { display: grid; gap: 4px; font-size: 13px; color: #4f6881; }
.personality-report-grid strong { font-size: 22px; color: #213a43; }
.personality-report-table { width: 100%; font-size: 14px; }
.personality-report-table td, .personality-report-table th { text-align: left; padding: 6px 8px; }
.personality-guide-visuals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; margin: 16px 0; }
.book-page #personality-guide > section { margin: 0; padding: 0; }
.book-page #personality-guide :is(.bi-arrow-right, .bi-bookmark) { display: inline-flex; width: 1em; height: 1em; vertical-align: -0.1em; }
.personality-guide-icon-label { white-space: nowrap; }
.book-page .personality-guide-card .maia-field-help { margin-left: 4px; vertical-align: middle; }
.book-page .personality-guide-card .maia-field-help > button { display: inline-flex; align-items: center; justify-content: center; min-height: 0; height: auto; line-height: 1; opacity: 0.35; }
.book-page .personality-guide-card .maia-field-help:is(:hover, :focus-within) > button { opacity: 1; }
.book-page .personality-guide-card .maia-field-tip { font: 600 13px/1.5 "Mona Sans", sans-serif; text-align: left; }
.personality-studio .book-games-note { color: #4f6881; }
.personality-results-actions[hidden] { display: none; }
.personality-studio #personality-progress { min-height: 1.5em; margin-top: 14px; }
@media (max-width: 700px) {
    .personality-toolbar .tool-field { flex-basis: 40%; }
    .personality-studio .book-nav button { font-size: 14px; }
}
.book-page .book-workbench :is(ol, ul) { margin: 0; padding: 0; list-style: none; }
.book-page .book-workbench li { margin: 0; padding: 0; border: 0; }
.book-page .book-workbench h2 { margin: 0 !important; padding: 0 !important; border: 0; font-size: 18px; line-height: 1.3; }
.book-page input,
.book-page select,
.book-page button,
.book-page .tool-button { font-size: 16px; }
.book-page #add-lines,
.book-page #new-book,
.book-page #preset-add,
.book-page .book-preset-control,
.book-page .book-preset-control select,
.book-page .tool-file-control,
.book-page .tool-file-control input,
.book-page .tool-file-control .tool-button,
.book-page .book-mode { font-size: 15px; }
.book-page #restore-workspace,
.book-page #restore-workspace + .tool-button { font-size: 16px; }
.book-page .tool-button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; background-color: white; }
.book-page :is(.tool-button, .book-small-button).install-button { border-color: transparent; }
.book-page :is(.tool-button, .book-small-button).install-button:active { border-color: transparent; }
.book-page .book-small-button.install-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 12px; border-bottom-width: 5px; }
.book-page .book-small-button.install-button:active { border-bottom-width: 2px; }
.book-page #personality-panel [hidden] { display: none !important; }
.book-page #personality-panel { grid-template-columns: minmax(0, 1fr); font-weight: 600; }
.book-page #personality-panel :is(input, select, button, .tool-button) { font: 600 15px/1.4 "Mona Sans", sans-serif; font-stretch: normal; font-variation-settings: normal; box-sizing: border-box; }
.book-page #personality-panel .tool-button:not(.install-button) { border-color: #8da7ad; }
.book-page #personality-panel :is(input, select, button):focus { outline: none; }
.book-page #personality-panel :is(input, select, button):focus-visible { outline: 2px solid #527783; outline-offset: -3px; }
.book-page #personality-panel .personality-control input[type="range"]:focus-visible { outline: none; }
.book-page #personality-panel .personality-control input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgb(82 119 131 / 40%), 0 1px 2px rgb(33 58 67 / 25%); }
.book-page #personality-panel .personality-control input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px rgb(82 119 131 / 40%), 0 1px 2px rgb(33 58 67 / 25%); }
.book-page #personality-panel :is(input:not([type="range"], [type="file"], [type="checkbox"]), select) { width: 100%; min-width: 0; height: 44px; padding: 8px 10px; }
.book-page #personality-panel :is(input:not([type="range"], [type="file"], [type="checkbox"]), select):disabled { opacity: 0.45; cursor: not-allowed; -webkit-text-fill-color: currentColor; }
.book-page #personality-panel .tool-file-control input:disabled + .tool-button { opacity: 0.45; }
.book-page #personality-panel select { padding-right: 36px; }
.book-page #personality-panel :is(.book-small-button, .book-icon-button, .tool-file-control .tool-button) { min-height: 44px; height: 44px; }
.book-page #personality-panel :is(.book-small-button, .book-icon-button):active:not(:disabled) { min-height: 41px; height: 41px; }
.book-page #personality-panel .tool-file-control { height: 44px; }
.book-page #personality-panel .tool-file-control input:not(:disabled):active + .tool-button { height: 41px; min-height: 41px; }
.book-page #personality-panel .tool-field { min-width: 0; font-size: 14px; font-weight: 600; }
.book-page #personality-panel .maia-field-label { align-items: center; min-height: 20px; }
.book-page #personality-panel .maia-field-tip { font-size: 13px; font-weight: 600; text-align: left; white-space: normal; }
.book-page #personality-panel :is(.personality-container, #personality-rule-controls) .maia-field-tip { font-size: 14px; }
.book-page #personality-panel .personality-rule-group h3 .maia-field-tip { font-family: "Rubik", "IBM Plex Sans", "Mona Sans", sans-serif; font-stretch: normal; }
.book-page #personality-panel .maia-field-tip-with-link::before { content: ''; position: absolute; top: -32px; right: 0; left: 0; height: 32px; }
.book-page #personality-panel .maia-field-tip-with-link.maia-field-tip-above::before { top: auto; bottom: -32px; }
.book-page #personality-panel .maia-field-tip-with-link a { color: #bce5ef; text-decoration: underline; }
.book-page #personality-panel .maia-field-tip-with-link a:focus-visible { outline: 2px solid #bce5ef; outline-offset: 2px; }
.book-page #personality-panel .maia-field-help { vertical-align: middle; }
.book-page #personality-panel .maia-field-help > button { display: inline-flex; align-items: center; justify-content: center; min-height: 0; height: auto; line-height: 1; opacity: 0.35; }
.book-page #personality-panel .maia-field-help:is(:hover, :focus-within) > button { opacity: 1; }
.book-page #personality-panel #personality-rule-controls .maia-field-help:not(:hover, :focus-within) > button { opacity: 0.2; }
.book-page #personality-panel .maia-field-help > button::before { transform: translateY(-1px); }
.personality-introduction { display: grid; gap: 7px; text-align: center; }
.book-page #personality-panel .personality-intro-title { color: #213a43; font: 700 clamp(26px, 12vw, 48px)/0.85 "PBookSmith Whisper", cursive; transform: translateY(0.1em); white-space: nowrap; -webkit-text-stroke: 0.5px currentcolor; }
.personality-intro { margin: 0 !important; color: #4f6881; text-align: center; font-size: 15px; font-weight: 500; }
.personality-intro a { color: #213a43; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.personality-intro a:hover { color: #527783; }
.personality-intro a:focus-visible { outline: 2px solid #527783; outline-offset: 2px; }
.personality-engine-reminder { width: min(100%, 800px); min-height: 100px; margin: 0 auto; box-sizing: border-box; padding: 10px 14px; scroll-margin-top: 130px; color: #4f6881; font-size: 15px; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
.personality-engine-reminder p { margin: 0; font-weight: 500; }
.elo-page .personality-engine-reminder details { margin: 2px 0 0; padding: 0; outline: none; font-size: inherit; }
.elo-page .personality-engine-reminder details > summary { margin: 0 auto; color: #213a43; font-size: inherit; font-weight: 600; }
.personality-engine-reminder details p { margin-top: 12px; padding: 10px 12px; border: 1px solid #d5dfe2; border-radius: 4px; font-size: 14px; }
.personality-engine-reminder a { color: #213a43; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.personality-engine-reminder a:focus-visible { outline: 2px solid #527783; outline-offset: 2px; }
.personality-workspace { width: 100%; max-width: 800px; justify-self: center; }
.personality-rule-ghost { display: none; }
.personality-rule-ghost-mobile { position: relative; display: none; overflow: hidden; container-type: inline-size; }
#personality-panel[inert] .personality-rule-ghost-mobile { display: block; }
.personality-rule-ghost-mobile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 45%), transparent); transform: translateX(-100%); animation: book-board-loading 1.5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .personality-rule-ghost-mobile::after { animation: none; } }
.personality-rule-ghost-mobile > div { height: calc(61px + var(--rows) * 61px); background:
    linear-gradient(#dce5e6, #dce5e6) 0 14px / 36% 12px no-repeat,
    repeating-linear-gradient(to bottom, #e1eaeb 0 10px, transparent 10px 61px) 0 57px / 48% calc(100% - 57px) no-repeat,
    repeating-linear-gradient(to bottom, #dce5e6 0 6px, transparent 6px 61px) 0 83px / 100% calc(100% - 83px) no-repeat; }
@container (min-width: 544px) {
    .personality-rule-ghost-mobile > div { height: calc(61px + var(--wide-rows) * 61px); background:
        linear-gradient(#dce5e6, #dce5e6) 0 14px / 36% 12px no-repeat,
        repeating-linear-gradient(to bottom, #e1eaeb 0 10px, transparent 10px 61px) 0 57px / 24% calc(100% - 57px) no-repeat,
        repeating-linear-gradient(to bottom, #e1eaeb 0 10px, transparent 10px 61px) 52% 57px / 24% calc(100% - 57px) no-repeat,
        repeating-linear-gradient(to bottom, #dce5e6 0 6px, transparent 6px 61px) 0 83px / 48% calc(100% - 83px) no-repeat,
        repeating-linear-gradient(to bottom, #dce5e6 0 6px, transparent 6px 61px) 100% 83px / 48% calc(100% - 83px) no-repeat; }
}
.book-studio.personality-container { display: block; padding: 12px 8px 24px; border: 2px solid #8da7ad; border-bottom-width: 5px; }
.personality-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0; min-width: 0; margin: -12px -8px 8px; }
.book-page #personality-panel :is(.personality-toolbar, .personality-export-toolbar) :is(input, select, button) { font-family: "Mona Sans", sans-serif; font-stretch: expanded; }
.book-page #personality-panel .personality-toolbar #personality-preset { border-color: #8da7ad; border-width: 0 0 2px; border-radius: 5px 0 0 0; font-size: 14px; font-weight: 800; }
.book-page #personality-panel #personality-preset:focus-visible { outline: none; }
.book-page #personality-panel :is(#personality-preset, #personality-title):hover:not(:disabled),
.book-page #personality-panel :is(#personality-add, #personality-export):hover:not(:disabled) { background-color: #f0f5f6; }
.book-page #personality-panel #personality-preset:open { background-color: white; }
.book-page #personality-panel #personality-preset option { background-color: white; }
.book-page #personality-panel .personality-toolbar #personality-add { border-width: 0 0 2px 2px; border-radius: 0 5px 0 0; font-size: 14px; font-weight: 800; }
.book-page #personality-panel .personality-toolbar #personality-add:active:not(:disabled) { min-height: 44px; height: 44px; margin-bottom: 0; border-color: #8da7ad; border-bottom-width: 2px; background: #e4edef; transform: none; }
.personality-summary { margin: 12px 0 0 !important; min-height: 1.5em; color: #4f6881; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
#personality-summary { margin-top: 0 !important; }
.personality-container > :is(#personality-error, #personality-restore-warning) { margin: 0 0 20px; }
.personality-export { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.personality-main-heading { display: none; }
.personality-export-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 4px 0; margin: 0 -8px -24px; }
.personality-summary-row { display: flex; grid-column: 1 / -1; grid-row: 1; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 0 8px; }
.personality-export-toolbar :is(#personality-summary, #personality-learned) { min-width: 0; margin: 0 !important; font-size: 14px; }
.personality-export-toolbar #personality-learned { flex: none; text-align: right; white-space: nowrap; }
.personality-export-toolbar #personality-title { grid-column: 1; grid-row: 2; }
.personality-export-toolbar #personality-export { grid-column: 2; grid-row: 2; }
.book-page #personality-panel .personality-export-toolbar #personality-title { color: #213a43; border: solid #8da7ad; border-width: 2px 0 0; border-radius: 0 0 0 5px; font-size: 14px; font-weight: 800; }
.book-page #personality-panel #personality-title:disabled { background-color: white; }
.book-page #personality-panel #personality-title:focus-visible { outline: none; background-color: #f0f5f6; }
.book-page #personality-panel .personality-export-toolbar #personality-export { border-width: 2px 0 0 2px; border-radius: 0 0 5px 0; font-size: 14px; font-weight: 800; }
.book-page #personality-panel .personality-export-toolbar #personality-export:active:not(:disabled) { min-height: 44px; height: 44px; margin-bottom: 0; border-color: #8da7ad; background: #e4edef; transform: none; }
.book-page #personality-panel :is(.personality-toolbar, .personality-export) :is(input, select, button, .tool-button, .tool-field, .personality-control) { font-size: 14px; }
.personality-export #personality-main-controls { min-width: 0; padding: 0 8px; }
#personality-learned-help { container-type: inline-size; }
.personality-learned-rates { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 4px 20px; margin: 0; font-variant-numeric: tabular-nums; }
@container (min-width: 320px) {
    .personality-learned-rates::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: rgb(255 255 255 / 20%); pointer-events: none; }
}
.personality-learned-rates > span { display: flex; justify-content: space-between; gap: 6px; min-width: 0; }
.personality-learned-rates :is([role="rowheader"], [role="cell"]) { white-space: nowrap; }
.personality-learned-rates [role="cell"] { font-weight: 700; }
.personality-learned-note { display: block; margin-top: 8px; }
.personality-date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.personality-job-slot { display: grid; width: 120px; flex: 0 0 120px; }
.personality-job-slot > button { grid-area: 1 / 1; width: 100%; }
.personality-docks { display: contents; }
.book-page .personality-bench { position: fixed; z-index: 32; right: 14px; bottom: 14px; left: auto; box-sizing: border-box; width: min(400px, calc(100vw - 28px)); margin: 0; padding: 0; border: 2px solid #213a43; border-bottom-width: 5px; border-radius: 5px; outline: 0; background: white; box-shadow: 0 6px 18px rgb(33 58 67 / 18%); }
.personality-bench:not([open]) { width: max-content; max-width: calc(100vw - 28px); }
.personality-bench .personality-test-toggle { display: flex; flex-wrap: nowrap; box-sizing: border-box; align-items: center; gap: 10px; width: 100%; margin: 0; padding: 10px; border-radius: 3px; cursor: pointer; list-style: none; }
.personality-test-toggle::-webkit-details-marker { display: none; }
.personality-test-toggle:focus-visible { outline: none; background: #f0f5f6; }
.personality-bench .personality-test-toggle > i { width: 16px; height: 20px; color: #213a43; font-size: 16px; }
.personality-bench .personality-test-toggle > h2 { flex: none; }
.personality-bench .personality-test-chevron { margin-left: auto; }
.personality-test-toggle #personality-progress { flex: 1; min-width: 0; min-height: 0; margin: 0 !important; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.personality-test-toggle #personality-progress:empty { display: none; }
.personality-bench:not([open]) .personality-test-toggle { gap: 6px; padding: 9px 10px; }
.book-page #personality-panel .personality-bench:not([open]) .personality-test-toggle > h2 { font-size: 14px; }
.personality-bench:not([open]) .personality-test-toggle > i { width: 14px; height: 20px; font-size: 14px; }
.personality-test-chevron { transition: transform 0.18s ease; }
.personality-bench[open] .personality-test-chevron { transform: rotate(180deg); }
.book-page .personality-autofit { position: fixed; z-index: 32; bottom: 14px; left: 14px; box-sizing: border-box; width: min(400px, calc(100vw - 28px)); margin: 0; padding: 0; border: 2px solid #213a43; border-bottom-width: 5px; border-radius: 5px; outline: 0; background: white; box-shadow: 0 6px 18px rgb(33 58 67 / 18%); }
.personality-autofit:not([open]) { width: max-content; }
.personality-autofit .autofit-toggle { display: flex; align-items: center; gap: 10px; box-sizing: border-box; width: 100%; margin: 0; padding: 10px; cursor: pointer; list-style: none; }
.personality-autofit:not([open]) .autofit-toggle { gap: 6px; padding: 9px 10px; }
.book-page #personality-panel .personality-autofit .autofit-toggle h2 { flex: none; font-size: 15px; font-weight: 600; }
.book-page #personality-panel .personality-autofit:not([open]) .autofit-toggle h2 { font-size: 14px; }
.personality-autofit .autofit-toggle > i { width: 16px; height: 20px; color: #213a43; font-size: 16px; }
.autofit-toggle::-webkit-details-marker { display: none; }
.autofit-toggle:focus-visible { outline: none; background: #f0f5f6; }
.personality-autofit .personality-test-chevron { margin-left: auto; }
.personality-autofit[open] .personality-test-chevron { transform: rotate(180deg); }
.autofit-card { box-sizing: border-box; container-type: inline-size; max-height: calc(100dvh - 120px); overflow-y: auto; padding: 0 10px 10px; scrollbar-width: thin; }
.autofit-card form, .autofit-card #autofit-player-controls { display: grid; gap: 10px; margin-top: 10px; }
.autofit-card .tool-file-control { align-self: flex-start; }
.book-page #personality-panel .autofit-actions .install-button { font-weight: 700; }
.autofit-card p { margin: 0; color: #4f6881; font-size: 13px; }
.autofit-card .book-notice { color: #9c2525; }
.autofit-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.autofit-actions { display: grid; gap: 8px; }
.autofit-actions .tool-button { width: 100%; }
.autofit-card :is(#autofit-games-help, .autofit-progress-line) { margin-top: 10px; }
.autofit-progress-line:has(#autofit-eta:not([hidden])) { display: flex; align-items: baseline; gap: 4px; font-size: clamp(7px, 3.8cqi, 12px); font-variant-numeric: tabular-nums; text-align: left; white-space: nowrap; }
.autofit-card .autofit-progress-line:has(#autofit-eta:not([hidden])) p { font-size: inherit; }
.autofit-progress-line #autofit-eta { margin-left: auto; }
.autofit-progress-short { display: none; }
.autofit-progress-accessible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@container (max-width: 360px) {
    .autofit-progress-full { display: none; }
    .autofit-progress-short { display: inline; }
}
.autofit-card:has(#autofit-results:not([hidden])) #autofit-player > :not(#autofit-player-controls),
.autofit-card:has(#autofit-results:not([hidden])) #autofit-player-controls > :not(#autofit-results, .autofit-actions) { display: none; }
.autofit-card:has(#autofit-results:not([hidden])) :is(#autofit-player, #autofit-player-controls) { margin-top: 0; }
.autofit-card:has(#autofit-results:not([hidden])) .autofit-progress-line { margin: 0; }
.autofit-card:has(#autofit-results:not([hidden])) #autofit-status { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.autofit-card #autofit-results:not([hidden]) { display: grid; box-sizing: border-box; min-width: 0; gap: 5px; margin: 0; padding: 8px; border: 1px solid #dce5e6; border-radius: 5px; color: #4f6881; font: 500 14px/1.35 "Rubik", sans-serif; text-align: left; overflow-wrap: anywhere; }
.autofit-card #autofit-results p { font: inherit; }
.autofit-card #autofit-results p:empty { display: none; }
.autofit-card #autofit-phase-results { margin-bottom: 4px; }
.autofit-card #autofit-results > strong { color: #213a43; font-size: 15px; }
.personality-test-card { display: flex; flex-direction: column; box-sizing: border-box; width: min(100%, 400px); min-width: 0; height: var(--personality-test-card-height, auto); max-height: calc(100dvh - 90px); margin: 0 auto; padding: 0 10px 10px; }
.personality-test-card > form { flex: none; }
.personality-test-card #personality-batch-output, .personality-test-card :is(#personality-report, #personality-batch-placeholder):not([hidden]) { display: flex; flex-direction: column; min-height: 0; }
.personality-test-card #personality-batch-output { flex: 1 1 auto; }
.personality-test-card :is(#personality-report, #personality-batch-placeholder):not([hidden]) { flex: 0 1 auto; }
.personality-test-card #personality-batch-placeholder:not([hidden]) { flex: 1 1 auto; }
.personality-test-card .personality-results-actions { flex: none; margin-top: auto; }
@media (max-height: 320px) { .personality-test-card { overflow-y: auto; } }
.personality-test-resize { display: none; }
@media (min-width: 481px) and (hover: hover) and (pointer: fine) {
    .personality-bench[open] .personality-test-resize { display: block; position: absolute; z-index: 3; top: -8px; left: 50%; width: 80px; height: 16px; transform: translateX(-50%); cursor: ns-resize; touch-action: none; }
    .personality-test-resize::after { content: ''; position: absolute; top: 5px; left: 25px; width: 30px; height: 5px; border-radius: 3px; background: #213a43; opacity: 0; }
    .personality-test-resize:hover::after, .personality-test-resize:focus-visible::after { opacity: 1; }
}
.personality-batch-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) 144px; width: 100%; }
.personality-batch-fields input, .personality-batch-fields select { width: 100%; }
.personality-bench-head { margin-bottom: 16px; font-size: 18px; }
.book-page #personality-panel .personality-bench-head > h2 { font-weight: 600; }
.book-page #personality-panel .personality-test-toggle > h2 { font-size: 15px; }
.personality-bench-head > :not(h2) { color: #4f6881; font-size: 13px; font-weight: 600; }
.personality-batch-fields { gap: 8px; }
.personality-test-buttons { display: grid; grid-template-columns: 1fr 1fr; align-self: end; align-items: end; gap: 4px; min-width: 0; }
.personality-test-buttons:has(#personality-ab-save[hidden]) { grid-template-columns: 1fr; }
.book-page #personality-panel .personality-test-buttons :is(#personality-ab-save, .personality-job-slot > button) { min-width: 0; margin: 0; padding: 4px; gap: 3px; font: 600 12px/1.2 "Mona Sans", sans-serif; font-stretch: normal; white-space: nowrap; }
.book-page #personality-panel .personality-test-buttons i { flex: none; width: 12px; font-size: 12px; }
.book-page #personality-panel .personality-test-buttons #personality-ab-save i { width: 16px; font-size: 16px; }
.book-page #personality-panel #personality-ab-save i::before { -webkit-text-stroke: 0; }
.book-page #personality-panel #personality-ab-save .bi-bookmark::before { -webkit-text-stroke: 0.35px currentColor; }
.book-page #personality-panel .personality-test-buttons :is(#personality-batch-run, #personality-stop) i { width: 21px; font-size: 21px; }
.book-page #personality-panel .personality-test-buttons #personality-ab-save { min-height: 40px; height: 40px; }
.book-page #personality-panel .personality-test-buttons > button:active:not(:disabled) { min-height: 37px; height: 37px; }
.personality-batch-fields .maia-field-tip { pointer-events: none; }
.book-page #personality-panel :is(.personality-batch-fields, .autofit-card) .tool-field { color: #4f6881; font-size: 13px; }
.book-page #personality-panel :is(.personality-batch-fields, .autofit-card) :is(input:not([type="file"], [type="checkbox"]), select) { height: 40px; padding: 6px 8px; border-color: #8da7ad; border-bottom-width: 5px; background-color: white; font-family: "Rubik", sans-serif; font-weight: 500; font-variant-numeric: tabular-nums; }
.book-page #personality-panel :is(.personality-test-card, .autofit-card) .tool-button:not(.install-button),
.book-page #personality-panel :is(.personality-test-card, .autofit-card) .tool-button:not(.install-button):active:not(:disabled),
.book-page #personality-panel .autofit-card .tool-file-control input:not(:disabled):active + .tool-button { border-color: #8da7ad; }
.book-page #personality-panel .autofit-card :is(.tool-button, .tool-file-control) { min-height: 40px; height: 40px; }
.book-page #personality-panel .autofit-card :is(button.tool-button:active:not(:disabled), .tool-file-control input:not(:disabled):active + .tool-button) { min-height: 37px; height: 37px; }
.book-page #personality-panel select:not([multiple]):not([size]) { padding-right: 36px; }
.autofit-card #autofit-filename { overflow-wrap: anywhere; font-weight: 600; }
.personality-batch-fields .personality-job-slot { grid-template-columns: minmax(0, 1fr); min-width: 0; width: 100%; }
.book-page #personality-panel .personality-batch-fields .personality-job-slot > button { min-width: 0; min-height: 40px; height: 40px; padding-right: 8px; padding-left: 8px; }
.book-page #personality-panel .personality-batch-fields .personality-job-slot > button:active:not(:disabled) { min-height: 37px; height: 37px; }
.personality-bench :is(#personality-report, #personality-batch-placeholder) .personality-report-grid { display: grid; flex: none; grid-template-columns: repeat(auto-fit, minmax(min(100%, 62px), 1fr)); gap: 0; margin: 10px 0; border: 1px solid #d5dfe2; border-bottom: 3px solid #9aafb3; border-radius: 4px; background: white; }
.personality-bench :is(#personality-report, #personality-batch-placeholder) .personality-report-grid > span { grid-template-columns: minmax(0, 1fr); align-content: start; min-width: 0; padding: 7px 6px; font-size: 11px; line-height: 1.3; text-align: center; }
.personality-bench :is(#personality-report, #personality-batch-placeholder) .personality-report-grid > span + span { border-left: 1px solid #d5dfe2; }
.personality-stat-label { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; }
.personality-stat-label > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.personality-stat-label .maia-field-help { flex: none; margin-left: 3px; }
.book-page #personality-panel .personality-bench .personality-stat-label .maia-field-help > button { width: 14px; height: 18px; font-size: 12px; line-height: 1; }
.book-page #personality-panel .personality-bench .personality-report-grid strong { font-family: "Rubik", sans-serif; font-weight: 600; font-variant-numeric: tabular-nums; }
.personality-bench #personality-report .personality-report-grid strong { justify-self: center; }
#personality-batch-placeholder { position: relative; overflow: hidden; opacity: 0.45; }
#personality-batch-placeholder strong { color: transparent; background: linear-gradient(#9aafb3, #9aafb3) center / 70% 0.6em no-repeat; }
#personality-batch-placeholder td:not(:first-child) { color: transparent; background: linear-gradient(#9aafb3, #9aafb3) right 6px center / 4ch 0.6em no-repeat; }
#personality-batch-placeholder.is-loading::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 70%), transparent); transform: translateX(-100%); animation: book-board-loading 1.5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { #personality-batch-placeholder.is-loading::after { animation: none; } }
.personality-bench .personality-results-actions:not([hidden]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.book-page #personality-panel .personality-bench .personality-results-actions button { min-width: 0; min-height: 40px; height: 40px; padding: 4px 8px; font-size: 13px; white-space: nowrap; }
.book-page #personality-panel .personality-bench .personality-results-actions button:active:not(:disabled) { min-height: 37px; height: 37px; }
#personality-progress { min-height: 24px; margin: 12px 0 0 !important; font-size: 13px; font-weight: 600; color: #4f6881; }
.book-studio.personality-studio { grid-template-columns: minmax(0, 1fr); column-gap: 0; padding: 0; border: 0; border-radius: 0; }
.personality-editor { grid-column: 1 / -1; margin-top: -16px; }
.personality-editor:empty { display: none; }
.personality-editor .personality-rule-rail:first-child .personality-rule-group:first-child { border-top: 0; }
.personality-studio > .book-board-column { position: relative; grid-column: 1; grid-row: 1; width: calc(100% + 16px); margin: -8px -8px 0; }
.personality-studio > .book-side { grid-column: 1; grid-row: 4; margin-top: -22px; }
#personality-analysis-status { display: flex; align-items: center; justify-content: center; min-height: 24px; margin-bottom: 8px; padding-bottom: 3px; border-bottom: 1px solid #ebebeb; color: #4f6881; font-size: 14px; font-weight: 500; text-align: center; }
.personality-studio .book-moves-region { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr); grid-template-rows: 24px minmax(0, 1fr); column-gap: 10px; flex: none; height: 259px; padding: 0; overflow: hidden; }
#personality-panel[aria-busy="true"] .personality-studio :is(#personality-analysis-status, .book-moves-region) { filter: grayscale(1); opacity: 0.45; }
#personality-panel[aria-busy="true"]:has(#autofit-stop:not([hidden])) #personality-board { filter: grayscale(1); opacity: 0.45; }
#personality-panel[aria-busy="true"]:has(#autofit-stop:not([hidden])) :is(.maia-field-label, .personality-summary-row) { opacity: 0.45; }
#personality-panel[aria-busy="true"]:has(#autofit-stop:not([hidden])) .personality-summary-row .maia-field-label { opacity: 1; }
#personality-panel[aria-busy="true"]:has(#autofit-stop:not([hidden])) .personality-control .maia-field-label label { opacity: 1; }
#personality-panel[aria-busy="true"]:has(:is(#autofit-stop, #personality-stop):not([hidden])) :is(.personality-rule-jump, .personality-rule-group-phases h3, .personality-rule-group h3.maia-field-label) { opacity: 0.45; }
.personality-move-header { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; padding: 3px 4px; color: #4f6881; font: 600 14px "Rubik", sans-serif; }
.personality-move-header span:first-child { padding-left: 6px; }
.personality-move-header span:nth-child(2) { text-align: center; }
.personality-move-header span:last-child { text-align: right; }
.personality-studio .book-moves-region.analysis-loading:has(#personality-moves:empty)::before,
.personality-studio .book-moves-region.analysis-loading:has(#personality-moves:empty)::after { content: ''; position: absolute; inset: 24px 0 0; pointer-events: none; }
.personality-studio .book-moves-region.analysis-loading:has(#personality-moves:empty)::before { background: repeating-linear-gradient(to bottom, #eef3f4 0 16px, transparent 16px 47px); }
.personality-studio .book-moves-region.analysis-loading:has(#personality-moves:empty)::after { background: linear-gradient(90deg, transparent, rgb(255 255 255 / 55%), transparent); transform: translateX(-100%); animation: book-board-loading 1.5s ease-in-out infinite; }
#personality-moves.analysis-pending { filter: blur(1px); opacity: 0.65; }
.personality-studio .book-board-surface cg-container { width: 100% !important; height: 100% !important; }
.personality-studio .book-board-surface, #personality-board cg-board { border-radius: 0; }
#personality-board:focus { outline: none; }
#personality-board:focus-visible { outline: 2px solid #527783; outline-offset: -2px; }
.personality-position { position: relative; z-index: 2; display: grid; grid-column: 1; grid-row: 2; width: 100%; min-width: 0; margin: -18px 0 0; padding: 0; }
.book-page #personality-panel #personality-fen { font-size: 14px; border: 0; border-radius: 0; text-overflow: ellipsis; }
.book-page #personality-panel #personality-fen:focus { text-overflow: clip; }
.book-page #personality-panel #personality-fen:focus-visible { outline: none; }
.book-page #personality-panel #personality-fen:focus-visible:not([aria-invalid="true"]) { background-color: #f0f5f6; }
.personality-position .book-nav { grid-row: 1; width: 100%; gap: 0; margin: 0; }
.book-page #personality-panel .personality-studio .book-nav .book-icon-button { min-height: 36px; height: auto; padding: 0; border-bottom-width: 4px; font: 600 14px/1.4 "Mona Sans", sans-serif; }
.book-page #personality-panel .personality-position .book-start-icon { width: 20px; height: 13px; }
.book-page #personality-panel #personality-flip i { font-size: 18px; }
.book-page #personality-panel .personality-position .book-icon-button { border-radius: 0; }
.book-page #personality-panel .personality-position .book-icon-button:first-child { border-top-left-radius: 5px; border-bottom-left-radius: 5px; }
.book-page #personality-panel .personality-position .book-icon-button:last-child { border-top-right-radius: 5px; border-bottom-right-radius: 5px; }
.personality-position .book-icon-button + .book-icon-button { margin-left: -2px; }
.book-page #personality-panel .personality-studio .book-nav .book-icon-button:active:not(:disabled) { min-height: 36px; height: auto; margin-bottom: 0; border-bottom-width: 4px; background: #e4edef; transform: none; }
.personality-position .book-icon-button :is(i, svg), .personality-toolbar #personality-add :is(i, span), .personality-export-toolbar #personality-export :is(i, span) { transition: transform 80ms ease; }
.personality-position .book-icon-button:active:not(:disabled) :is(i, svg), .personality-toolbar #personality-add:active:not(:disabled) :is(i, span), .personality-export-toolbar #personality-export:active:not(:disabled) :is(i, span) { transform: translateY(2px); }
@media (prefers-reduced-motion: reduce) {
    .personality-position .book-icon-button :is(i, svg), .personality-toolbar #personality-add :is(i, span), .personality-export-toolbar #personality-export :is(i, span) { transition: none; }
}
.personality-rule-group { padding: 0 0 12px; }
.book-page :is(.personality-rule-group h3, .personality-main-heading) { padding: 10px 0 8px; border-bottom: 2px solid #dce5e6; background: white; font-size: 14px; font-family: "Mona Sans", sans-serif; font-weight: 800; font-stretch: expanded; }
.book-page .personality-rule-group h3 { position: sticky; top: 117px; z-index: 2; margin: 0 0 8px; }
.book-page #personality-panel .personality-rule-jump { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-stretch: inherit; text-align: left; cursor: pointer; }
.book-page #personality-panel .personality-rule-jump:disabled { cursor: default; }
.personality-rule-group .personality-rule-grid, #personality-main-controls { display: grid; column-gap: 24px; }
.personality-rule-group .personality-rule-grid { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
#personality-main-controls { grid-template-columns: minmax(0, 1fr); }
#personality-panel[inert] #personality-main-controls:empty::before { content: ''; height: 268px; background:
    repeating-linear-gradient(to bottom, #e1eaeb 0 10px, transparent 10px 67px) 0 10px / 48% 258px no-repeat,
    repeating-linear-gradient(to bottom, #dce5e6 0 6px, transparent 6px 67px) 0 37px / 100% 231px no-repeat; }
#personality-main-controls .personality-control { padding: 10px 0; }
.personality-control input[type="range"] { width: 100%; min-width: 0; }
.personality-control .book-move-weight { box-shadow: inset 0 1px 2px rgb(33 58 67 / 20%), inset 0 -1px 1px rgb(255 255 255 / 35%); }
.personality-control .book-move-weight::-webkit-slider-thumb { background: linear-gradient(white, #e4edef); box-shadow: 0 1px 2px rgb(33 58 67 / 25%); }
.personality-control .book-move-weight::-moz-range-thumb { background: linear-gradient(white, #e4edef); box-shadow: 0 1px 2px rgb(33 58 67 / 25%); }
.personality-control output { min-width: 4ch; font-size: 14px; font-weight: 700; }
.personality-slider-track { --book-track-empty: #dfe5e7; position: relative; display: flex; grid-column: 1 / -1; grid-row: 2; align-items: center; min-height: 22px; }
/* Match the 18px range thumb's travel endpoints. */
.personality-default-range { position: absolute; inset: 0 9px; display: flex; align-items: center; pointer-events: none; }
.personality-default-marker { position: absolute; width: 2px; height: 10px; transform: translateX(-50%); border-radius: 1px; background: var(--book-track-empty); }
.personality-slider-track input { position: relative; }
.personality-slider-track:has(input:disabled) { filter: grayscale(1); opacity: 0.45; }
.personality-control:has(input:disabled) :is(label, output) { opacity: 0.45; }
.personality-slider-track input:disabled { cursor: not-allowed; }
.personality-slider-track input:disabled ~ .personality-slider-touch { pointer-events: none; }
.personality-slider-touch { display: none; }
@media (pointer: coarse) {
    .personality-slider-touch { display: block; position: absolute; inset: 0; z-index: 1; touch-action: pan-y; }
}
.book-page #personality-panel .personality-report-grid strong { font-size: 18px; }
.personality-candidate small { font: 600 14px "Rubik", sans-serif; }
.book-page #personality-panel .personality-candidate .book-move-san { font: 500 15px "Rubik", sans-serif; }
.personality-candidate { min-height: 34px; }
.book-page #personality-panel .personality-candidate { padding: 6px 2px 6px 0 !important; }
.personality-candidate small { padding: 3px 2px; }
.book-page #personality-panel .personality-report-table { display: table; width: 100%; table-layout: fixed; border-collapse: collapse; border: 0; margin: 16px 0; font: 600 14px/1.5 "Mona Sans", sans-serif; font-stretch: normal; }
.book-page #personality-panel .personality-report-table :is(th, td) { padding: 10px 12px; border: 0; border-bottom: 1px solid #dce5e6; text-align: right; font: inherit; overflow-wrap: anywhere; }
.book-page #personality-panel .personality-report-table th { font-weight: 800; }
.book-page #personality-panel .personality-report-table tr > :first-child { width: 50%; text-align: left; }
.book-page #personality-panel .personality-report-table tbody th { font-weight: 600; }
.book-page #personality-panel .personality-report-table tr { display: table-row; background: transparent; border: 0; }
.book-page #personality-panel .personality-report-table tbody tr:nth-child(even) { background: #f4f7f7; }
.book-page #personality-panel .personality-report-table tbody tr:last-child > * { border-bottom: 0; }
.personality-batch-table-scroll { flex: 0 1 auto; min-height: 0; max-height: var(--personality-table-height, 200px); margin: 0 0 10px; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #cbd7d8 transparent; }
.personality-batch-table-scroll::-webkit-scrollbar { width: 6px; }
.personality-batch-table-scroll::-webkit-scrollbar-thumb { border-radius: 6px; background: #cbd7d8; }
.personality-batch-table-scroll::-webkit-scrollbar-track { background: transparent; }
.book-page #personality-panel .personality-bench .personality-report-table .personality-feature-group-heading th { background: #eef4f3; }
.book-page #personality-panel .personality-bench .personality-report-table { margin: 0; }
.book-page #personality-panel .personality-bench .personality-report-table :is(th, td) { padding: 6px; font-size: 12px; }
.book-page #personality-panel .personality-bench .personality-report-table th { color: #4f6881; font-size: 12px; font-weight: 700; }
.book-page #personality-panel .personality-bench .personality-report-table tr > :first-child { width: 42%; }
.book-page #personality-panel .personality-bench .personality-report-table th:not(:first-child) { white-space: nowrap; }
.personality-bench .personality-report-table :is(th, .personality-feature-row td:first-child) .maia-field-help { margin-left: 3px; vertical-align: middle; }
.book-page #personality-panel .personality-bench .personality-report-table .maia-field-help > button { width: 14px; height: 18px; font-size: 12px; line-height: 1; }
.book-page #personality-panel .personality-bench .personality-report-table tbody tr:nth-child(even) { background: transparent; }
.book-page #personality-panel .personality-bench .personality-report-table tbody:not(:first-of-type) .personality-feature-group-heading th { border-top: 2px solid #b9cacc; }
.book-page #personality-panel .personality-bench .personality-report-table td:not(:first-child) { font-family: "Rubik", sans-serif; font-variant-numeric: tabular-nums; }
.personality-feature-value { display: inline-block; position: relative; min-width: var(--personality-value-width, 6ch); text-align: right; }
.personality-report-grid .personality-feature-value { box-sizing: border-box; min-width: 0; padding-left: 15px; }
.personality-stat-direction { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.personality-feature-value::before { position: absolute; right: calc(100% + 3px); top: 50%; transform: translateY(-50%); font: 12px/1 bootstrap-icons; -webkit-text-stroke: 0.5px currentColor; }
.personality-report-grid .personality-feature-value::before { right: auto; left: 0; }
.personality-feature-higher .personality-feature-value::before { content: "\f148"; color: #288b5a; }
.personality-feature-lower .personality-feature-value::before { content: "\f128"; color: #c64b4b; }
.personality-feature-unchanged .personality-feature-value::before { content: "\f2ea"; color: #9aafb3; }
.autofit-phase-results > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 1px 0; font-variant-numeric: tabular-nums; }
.autofit-phase-results > div > :last-child { text-align: right; white-space: nowrap; }
.book-checkbox-option, .book-checkbox-option > label { display: flex; align-items: center; gap: 6px; }
.book-checkbox-option { margin-top: 8px; font-size: 12px; }
.book-checkbox-option > label { min-width: 0; cursor: pointer; }
.book-checkbox-option .checkbox-container { box-sizing: border-box; flex: none; width: 24px; height: 24px; border: 2px solid #8da7ad; border-bottom-width: 4px; border-radius: 5px; background: white; }
.book-page #personality-panel .book-checkbox-option input[type="checkbox"] { width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; }
.book-checkbox-option .checkbox-fill { width: 100%; height: 100%; color: #213a43; background: transparent; }
.book-checkbox-option .checkbox-fill::after { content: ''; width: 14px; height: 14px; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23213a43' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5 6.5 12 13 4.5'/%3E%3C/svg%3E"); }
.book-checkbox-option input:checked + .checkbox-fill { opacity: 1; }
.book-checkbox-option .checkbox-container:has(input:focus-visible) { outline: 2px solid #527783; outline-offset: 2px; }
.book-page #personality-panel #personality-fen[aria-invalid="true"] { background-color: #fff1f1; }
@media (max-width: 959px) {
    .book-studio.personality-container { border: 0; border-radius: 0; }
    .book-studio.personality-container { padding: 0 0 16px; }
    .book-page #personality-panel .personality-toolbar { box-sizing: border-box; margin: 0 0 12px; border: 2px solid #8da7ad; border-bottom-width: 4px; border-radius: 5px; overflow: hidden; }
    .book-page #personality-panel .personality-toolbar #personality-preset { border-width: 0; border-radius: 0; }
    .book-page #personality-panel .personality-toolbar #personality-add { border-width: 0 0 0 2px; border-radius: 0; }
    .book-page #personality-panel .personality-toolbar #personality-add:active:not(:disabled) { border-bottom-width: 0; }
    .personality-export-toolbar { margin: 0 0 -16px; }
    .book-page #personality-panel .personality-export-toolbar #personality-title { border-width: 2px 0 4px 2px; border-radius: 5px 0 0 5px; }
    .book-page #personality-panel .personality-export-toolbar #personality-export { border-width: 2px 2px 4px; border-radius: 0 5px 5px 0; }
    .personality-studio > .book-board-column, .personality-position { width: 100%; }
    .personality-studio > .book-board-column { margin: 0; }
    .book-page #personality-panel .personality-studio .book-nav .book-icon-button,
    .book-page #personality-panel .personality-studio .book-nav .book-icon-button:active:not(:disabled) { min-height: 44px; }
    .personality-fen-form { width: 100%; margin: -28px 0 0; }
    .personality-editor { padding: 0 12px; }
    .personality-export #personality-main-controls { padding: 0 20px; }
}
@media (max-width: 959px), (max-height: 399px) {
    .book-page .personality-main-heading { display: block; position: static; margin: 0 20px; }
}
@media (max-width: 480px) {
    .book-page .personality-docks { display: grid; position: fixed; z-index: 32; right: 0; bottom: 0; left: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding-bottom: env(safe-area-inset-bottom); border-top: 2px solid #9aafb3; background: white; box-shadow: 0 -4px 14px rgb(33 58 67 / 12%); }
    .book-page .personality-docks:has(> details[open]) { grid-template-columns: minmax(0, 1fr); }
    .book-page .personality-docks :is(.personality-autofit, .personality-bench) { position: relative; inset: auto; width: auto; max-width: none; min-width: 0; border: 0; border-radius: 0; box-shadow: none; }
    .book-page .personality-docks:has(> details[open]) > details:not([open]) { display: none; }
    .book-page .personality-docks .personality-bench { border-left: 1px solid #d5dfe2; }
    .book-page .personality-docks:has(> details[open]) .personality-bench { border-left: 0; }
    .book-page .personality-docks :is(.autofit-toggle, .personality-test-toggle) { flex-wrap: nowrap; justify-content: center; min-height: 44px; padding: 6px 8px; }
    .book-page .personality-docks .personality-test-chevron { margin-left: 0; }
    .personality-dock-label-suffix { display: none; }
    .book-page #personality-panel .personality-docks :is(.autofit-toggle, .personality-test-toggle) h2 { min-width: 0; flex: 0 1 auto; font-size: 13px; text-align: center; white-space: normal; }
    .book-page #personality-panel .personality-docks details[open] :is(.autofit-toggle, .personality-test-toggle) h2 { font-size: 15px; }
    .personality-docks :is(.autofit-card, .personality-test-card) { max-height: min(calc(100dvh - 120px), 400px); overflow-y: auto; }
    .personality-docks .personality-autofit .autofit-card { max-height: calc(100dvh - 70px - env(safe-area-inset-bottom)); }
    .personality-docks .personality-test-card { width: 100%; height: auto; }
    .personality-docks .personality-test-card :is(#personality-batch-output, #personality-report:not([hidden]), #personality-batch-placeholder:not([hidden])) { flex: none; }
    .personality-docks .personality-batch-table-scroll { flex: none; }
    .personality-bench[open] .personality-batch-table-scroll { max-height: 200px; }
    .personality-docks .autofit-card { text-align: center; }
    .personality-docks .autofit-card .tool-file-control { align-self: center; }
    .book-tabs { width: 100%; }
    .book-tabs a { padding: 0 8px; font-size: 14px; }
    .personality-batch-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .personality-test-buttons { grid-column: 1 / -1; grid-template-columns: 64px minmax(0, 1fr); }
    .book-page #personality-panel :is(.personality-batch-fields, .autofit-card) :is(input:not([type="file"], [type="checkbox"]), select),
    .book-page #personality-panel .autofit-card :is(.tool-button, .tool-file-control),
    .book-page #personality-panel .personality-test-buttons #personality-ab-save,
    .book-page #personality-panel .personality-batch-fields .personality-job-slot > button { min-height: 44px; height: 44px; }
    .book-page #personality-panel .personality-bench .personality-results-actions button { min-height: 44px; height: 44px; }
    .book-page #personality-panel .personality-docks :is(.autofit-card, .personality-test-card) .tool-button:active:not(:disabled),
    .book-page #personality-panel .personality-docks .autofit-card .tool-file-control input:not(:disabled):active + .tool-button {
        min-height: 44px; height: 44px; margin-bottom: 0; border-bottom-width: 5px; transform: none; filter: brightness(0.95);
    }
    .book-page #personality-panel .personality-bench .personality-report-table :is(th, td) { padding: 8px 6px; font-size: 12px; }
    .book-page #personality-panel .personality-bench .personality-report-table th { font-size: 11px; }
    .personality-job-slot { width: 100%; }
    .personality-rule-group .personality-rule-grid, #personality-main-controls { column-gap: 16px; }
}
@media (min-width: 481px) and (max-width: 850px) {
    .book-page :is(.personality-autofit, .personality-bench)[open] { width: calc((100vw - 42px) / 2); }
    .personality-batch-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 481px) and (max-width: 650px) {
    .personality-batch-fields { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
    .personality-bench :is(#personality-report, #personality-batch-placeholder) .personality-report-grid { margin: 5px 0; }
    .personality-bench :is(#personality-report, #personality-batch-placeholder) .personality-report-grid > span { padding: 3px 2px; font-size: 9px; }
    .book-page #personality-panel .personality-bench .personality-report-grid strong { font-size: 14px; }
    .book-page #personality-panel .personality-bench .personality-report-table tr > :first-child { width: 35%; }
    .book-page #personality-panel .personality-bench .personality-report-table :is(th, td) { padding-right: 4px; padding-left: 4px; }
    .book-page #personality-panel .personality-bench .personality-report-table th { font-size: 10px; }
    .book-page #personality-panel .personality-bench .personality-report-table th:not(:first-child) { white-space: normal; }
    .book-page #personality-panel .personality-test-buttons :is(#personality-ab-save, .personality-job-slot > button) { padding-right: 2px; padding-left: 2px; gap: 2px; font-size: 10px; }
    .book-page #personality-panel .personality-test-buttons i { width: 8px; font-size: 9px; }
    .personality-bench .personality-results-actions:not([hidden]) { gap: 4px; }
    .book-page #personality-panel .personality-bench .personality-results-actions button { min-width: 0; padding: 4px 2px; gap: 3px; font-size: 11px; }
    .personality-bench .personality-results-actions button i { width: 14px; font-size: 14px; }
}
@media (max-width: 320px) {
    .book-page #personality-panel .personality-test-buttons :is(#personality-ab-save, .personality-job-slot > button) { padding-right: 2px; padding-left: 2px; gap: 2px; font-size: 10px; }
    .book-page #personality-panel .personality-test-buttons i { width: 8px; font-size: 9px; }
}
@media (min-width: 481px) and (max-width: 560px) {
    .book-page #personality-panel .personality-bench .personality-report-table tr > :first-child { width: 32%; }
    .book-page #personality-panel .personality-bench .personality-report-table td { font-size: 10px; }
    .personality-bench .personality-feature-value::before { font-size: 10px; }
}
@media (max-width: 480px) and (max-height: 450px) {
    .personality-bench :is(#personality-report, #personality-batch-placeholder) .personality-report-grid { margin: 5px 0; }
    .personality-bench :is(#personality-report, #personality-batch-placeholder) .personality-report-grid > span { padding-top: 3px; padding-bottom: 3px; }
}
@media (max-width: 374px) {
    .personality-bench .personality-results-actions:not([hidden]) { gap: 4px; }
    .book-page #personality-panel .personality-bench .personality-results-actions button { min-width: 0; padding: 4px; gap: 3px; font-size: 11px; }
    .personality-bench .personality-results-actions button i { width: 14px; font-size: 14px; }
    .book-page #personality-panel .personality-bench .personality-report-table tr > :first-child { width: 30%; }
    .book-page #personality-panel .personality-bench .personality-report-table :is(th, td) { padding-right: 4px; padding-left: 4px; font-size: 11px; }
    .book-page #personality-panel .personality-bench .personality-report-table th { font-size: 10px; }
}
@media (max-width: 320px) {
    .book-page #personality-panel .personality-bench .personality-report-table th:not(:first-child) { white-space: normal; }
    .personality-bench :is(#personality-report, #personality-batch-placeholder) .personality-report-grid > span { padding-right: 4px; padding-left: 4px; }
    .personality-bench .personality-report-grid :is(#personality-batch-stat-2, #personality-batch-stat-placeholder-2) { font-size: 9px; }
    .book-page #personality-panel .personality-bench .personality-report-grid strong { font-size: 16px; }
}
.book-page .book-workbench .tool-button { gap: 8px; }
.book-page .book-workbench .bi::before { -webkit-text-stroke: 0.9px currentColor; }
.book-page .book-workbench :is(.bi-plus-lg, .bi-x-lg, .bi-upload)::before { -webkit-text-stroke: 1.6px currentColor; }
.book-page .book-workbench .book-layer-button .bi::before { -webkit-text-stroke: 0.6px currentColor; }
.book-page .book-workbench #import + .tool-button .bi-upload::before { -webkit-text-stroke: 1.3px currentColor; }
.book-page #backup-workspace .bi-download::before,
.book-page #restore-workspace + .tool-button .bi-upload::before,
.book-page .book-workbench .bi-download::before,
.book-page .book-workbench .book-layer-button .bi-download::before { -webkit-text-stroke: 1.1px currentColor; }
.book-page #clear-all .bi::before { -webkit-text-stroke: 0.6px currentColor; }

/* One fixed-size line under the button, so status changes never shift the page. */
.book-page .maia-saved-games { grid-template-columns: auto; justify-items: end; }
.book-workspace-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 100%; }
.book-workspace-actions .tool-button { white-space: nowrap; }
.book-notice {
    padding: 10px 12px;
    color: #9c2525;
    background: #ffffff00;
    border: 2px solid #9c2525;
    border-radius: 5px;
    font-size: 13px;
    white-space: pre-line;
    overflow-wrap: anywhere;
    font-weight: 600;
}
.book-notice[hidden] { display: none; }
.book-page #saved-status {
    width: 26ch;
    max-width: 100%;
    min-height: 1.5em;
    overflow: hidden;
    font-size: 13px;
    font-weight: 400;
    opacity: 0.6;
    text-align: right;
    white-space: nowrap;
    text-overflow: ellipsis;
}
@media (max-width: 900px) {
    .book-page .maia-saved-games { justify-items: center; }
    .book-page #saved-status { text-align: center; }
}

.book-studio {
    min-width: 0;
    padding: 28px 24px 0;
    background: white;
    border: 3px solid #dce5e6;
    border-bottom-width: 5px;
    border-radius: 5px;
}
.book-studio {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 28px;
}
.book-stack-box { grid-column: 1 / -1; min-width: 0; padding-top: 40px; border-top: 1px solid rgb(33 58 67 / 10%); }

/* Board */
.book-board-column { min-width: 0; }
.book-position-heading { position: relative; grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.book-opening { align-items: center; justify-content: center; min-width: 0; height: 40px; flex-shrink: 0; color: inherit; font-size: 20px; text-align: center; }
.book-opening span { min-width: 0; max-height: 100%; overflow-y: auto; scrollbar-width: thin; pointer-events: auto; white-space: normal; overflow-wrap: anywhere; }
.book-board-surface { border-radius: 4px; }
.book-board-surface:has(> .board-session > .cg-wrap:empty)::before,
.book-board-surface:has(> .board-session > .cg-wrap:empty)::after,
#books-panel[inert] .book-board-surface::before,
#books-panel[inert] .book-board-surface::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.book-board-surface:has(> .board-session > .cg-wrap:empty)::before,
#books-panel[inert] .book-board-surface::before { background: repeating-conic-gradient(#dce5e6 0% 25%, #eaf0f1 0% 50%) 0 0 / 25% 25%; }
.book-board-surface:has(> .board-session > .cg-wrap:empty)::after,
#books-panel[inert] .book-board-surface::after { background: linear-gradient(90deg, transparent, rgb(255 255 255 / 45%), transparent); transform: translateX(-100%); animation: book-board-loading 1.5s ease-in-out infinite; }
@keyframes book-board-loading { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
    .book-board-surface:has(> .board-session > .cg-wrap:empty)::after,
    #books-panel[inert] .book-board-surface::after,
    .personality-studio .book-moves-region.analysis-loading:has(#personality-moves:empty)::after { animation: none; }
}
.book-stack-ghost { display: none; }
#books-panel[inert] > .book-studio { box-sizing: border-box; height: var(--book-studio-loading-height, auto); align-content: start; overflow: hidden; }
#books-panel[inert] :is(.book-position-heading > *, .book-mode-info, #moves-scroll > *) { visibility: hidden; }
#books-panel[inert] :is(.book-position-heading, .book-stack-head, #moves-scroll, .book-stack-ghost) { position: relative; overflow: hidden; }
#books-panel[inert] :is(.book-position-heading, .book-stack-head, #moves-scroll, .book-stack-ghost)::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 55%), transparent); transform: translateX(-100%); animation: book-board-loading 1.5s ease-in-out infinite; }
#books-panel[inert] .book-position-heading::before { content: ''; position: absolute; inset: 0; background: linear-gradient(#e8edef, #e8edef) center 3px / 150px 18px no-repeat, linear-gradient(#eef3f4, #eef3f4) center 35px / min(75%, 360px) 13px no-repeat; }
#books-panel[inert] .book-stack-head::before { content: ''; position: absolute; inset: 0; background: linear-gradient(#e8edef, #e8edef) center top / min(100%, 400px) 40px no-repeat, linear-gradient(#eef3f4, #eef3f4) center 53px / min(85%, 450px) 13px no-repeat; }
#books-panel[inert] #moves-scroll::before { content: ''; position: absolute; inset: 4px 0 auto; height: 180px; background: repeating-linear-gradient(to bottom, #eef3f4 0 16px, transparent 16px 46px); }
#books-panel[inert] .book-stack { display: none; }
#books-panel[inert] .book-stack-ghost { display: flex; flex-direction: column; gap: 12px; height: var(--book-stack-loading-height, auto); margin-top: 22px !important; }
.book-stack-ghost .book-layer { flex: none; background: #e8edef; border-color: #e8edef !important; }
.book-stack-ghost .book-layer > * { visibility: hidden; }
.book-stack-ghost .book-search { flex: none; margin-top: auto !important; }
.book-stack-ghost .book-search::before { display: none; }
.book-stack-ghost .book-search input { background: #eef3f4; border-color: transparent; }
@media (prefers-reduced-motion: reduce) {
    #books-panel[inert] :is(.book-position-heading, .book-stack-head, #moves-scroll, .book-stack-ghost)::after { animation: none; }
}
.book-board-surface .board-session { touch-action: none; }
.book-board-surface cg-container { touch-action: none !important; }
.book-page .book-board-surface coords { z-index: 3; font-family: "Rubik", sans-serif; font-size: 10px; font-weight: 600; line-height: 1; opacity: 1; }
.book-page .book-board-surface coords.side { right: auto; left: 2px; width: 12px; }
.book-page .book-board-surface coords.side coord { transform: none; padding-top: 2px; }
.book-page .book-board-surface coords.bottom { bottom: 1px; height: 12px; text-transform: none; text-align: right; }
.book-page .book-board-surface coords.bottom coord { padding-right: 2px; }
.book-page .book-board-surface coords coord { flex: 1 1 0; color: #f0d9b5; }
.book-page .book-board-surface .orientation-white coords coord:nth-child(2n),
.book-page .book-board-surface .orientation-black coords coord:nth-child(2n + 1) { color: #5f5341; }
.book-arrows { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }
.book-promotion { position: absolute; inset: 0; z-index: 10; background: rgba(33, 58, 67, 0.35); }
.book-promotion-piece { position: absolute; width: 12.5%; height: 12.5%; padding: 0; background: #f4f7f8 center / 85% no-repeat; border: 0; border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); cursor: pointer; transition: border-radius 0.12s, background-color 0.12s; }
.book-promotion-piece:hover, .book-promotion-piece:focus-visible { background-color: #ffffff; border-radius: 4px; outline: none; }
.book-promotion-piece.wq { background-image: url('../../assets/images/pieces/staunty/wQ.svg'); }
.book-promotion-piece.wn { background-image: url('../../assets/images/pieces/staunty/wN.svg'); }
.book-promotion-piece.wr { background-image: url('../../assets/images/pieces/staunty/wR.svg'); }
.book-promotion-piece.wb { background-image: url('../../assets/images/pieces/staunty/wB.svg'); }
.book-promotion-piece.bq { background-image: url('../../assets/images/pieces/staunty/bQ.svg'); }
.book-promotion-piece.bn { background-image: url('../../assets/images/pieces/staunty/bN.svg'); }
.book-promotion-piece.br { background-image: url('../../assets/images/pieces/staunty/bR.svg'); }
.book-promotion-piece.bb { background-image: url('../../assets/images/pieces/staunty/bB.svg'); }
.book-nav { display: flex; gap: 8px; margin-top: 12px; }
.book-nav .book-icon-button { flex: 1 1 0; min-height: 40px; padding: 0; font-size: 16px; }
.book-page .book-nav .book-icon-button { border-color: #213a43; border-bottom-width: 3px; }
.book-page .book-nav .book-icon-button:active:not(:disabled) { min-height: 40px; border-color: #213a43; border-bottom-width: 3px; transform: translateY(1px); margin-bottom: 0; }
.book-start-icon { width: 24px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.book-page .book-nav .book-icon-button i::before { -webkit-text-stroke: 1.2px currentColor; }
.book-page .book-nav :is(#nav-flip, #personality-flip) i { font-size: 22px; }
.book-page .book-nav :is(#nav-flip, #personality-flip) i::before { -webkit-text-stroke: 0.8px currentColor; }
.book-path { position: relative; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; align-items: baseline; gap: 2px 2px; height: 50px; flex-shrink: 0; overflow-y: auto; font-family: "Rubik", sans-serif; font-size: 16px; line-height: 1.5; scrollbar-width: thin; }
.book-path li { display: inline-flex; align-items: baseline; }
.book-path .book-path-intro { color: #4f6881; font-size: 15px; font-weight: 500; text-align: center; }
.book-path-number { padding-left: 4px; color: #4f6881; font-size: 13px; }
.book-path button { padding: 0 5px; color: #213a43; background: none; border: 0; border-radius: 4px; font: inherit; cursor: pointer; }
.book-path button:hover { background: #eef3f4; }
.book-path button[aria-current] { color: white; background: #213a43; }

/* Moves */
.book-side { position: relative; display: flex; flex-direction: column; gap: 0; min-width: 0; }
.book-page .tool-field { gap: 2px; }
.book-page .book-search { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; justify-self: start; width: min(calc(100% - 40px), 600px); margin-left: 40px !important; margin-bottom: 6px !important; }
.book-search::before { content: ''; position: absolute; top: -12px; right: 0; left: -24px; height: calc(50% + 12px); border-left: 1px solid rgb(33 58 67 / 20%); border-bottom: 1px solid rgb(33 58 67 / 20%); border-bottom-left-radius: 5px; pointer-events: none; }
.book-search input { position: relative; min-width: 0; height: 44px; padding: 10px 12px; border-color: rgb(33 58 67 / 25%); border-width: 1px; border-bottom-width: 2px; font-family: "Rubik", sans-serif; font-weight: 500; }
.book-page #opening-search { font-size: 14px; }
.book-search input::-webkit-search-cancel-button { cursor: pointer; }
#opening-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 5;
    max-height: 360px;
    margin-top: 6px;
    padding: 4px;
    overflow-y: auto;
    background: white;
    border: 2px solid #213a43;
    border-bottom-width: 5px;
    border-radius: 5px;
    box-shadow: 0 10px 24px rgb(33 58 67 / 14%);
}
#opening-results li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 4px; cursor: pointer; }
#opening-results li[aria-selected="true"],
#opening-results li:hover { background: #eef3f4; }
#opening-results strong { font-size: 15px; font-weight: 600; line-height: 1.35; }
#opening-results small { color: #4f6881; font-family: "Rubik", sans-serif; font-size: 13px; font-weight: 400; line-height: 1.4; }
.book-page .book-small-button { min-height: 40px; padding: 6px 12px; }
.book-studio > .book-side { align-self: stretch; }
.book-moves-region { display: flex; flex: 1 1 0; flex-direction: column; box-sizing: border-box; min-height: 0; padding-bottom: 24px; overflow: hidden; scrollbar-width: thin; }
.book-moves-overflow { overflow-y: auto; }
.book-side:has(> .book-moves-more-below)::before { content: ''; position: absolute; right: 0; bottom: 0; left: 0; z-index: 1; height: 48px; background: linear-gradient(to bottom, rgb(255 255 255 / 0%), white); pointer-events: none; }
.book-side:has(> .book-moves-more-below)::after { content: ''; position: absolute; bottom: 8px; left: 50%; z-index: 1; width: 8px; height: 8px; border-right: 2px solid rgb(33 58 67 / 45%); border-bottom: 2px solid rgb(33 58 67 / 45%); transform: translateX(-50%) rotate(45deg); pointer-events: none; }
.book-moves { flex: 0 0 auto; }
.book-moves:empty { display: none; }
.book-add-lines, .book-add-layer { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 10px; box-sizing: border-box; width: 100%; min-height: 46px; padding: 8px; color: rgb(33 58 67 / 55%); background: transparent; border: 0; border-radius: 5px; font-family: "Mona Sans"; font-weight: 600; cursor: pointer; transition: background-color 0.1s, color 0.1s; }
.book-add-lines { margin-top: 8px; }
.book-add-lines:hover:not(:disabled), .book-add-lines:focus-visible,
.book-add-layer:hover, .book-add-layer:focus-visible { color: #213a43; background: #f0f5f6; }
.book-add-lines:active:not(:disabled), .book-add-layer:active { background: #e4edef; }
.book-add-lines:focus-visible, .book-add-layer:focus-visible { outline: 3px solid #5f8895; outline-offset: -3px; }
.book-add-lines:disabled { opacity: 0.45; cursor: not-allowed; }
.book-move {
    display: grid;
    grid-template-columns: minmax(58px, auto) minmax(40px, 1fr) 42px minmax(80px, 130px) 30px;
    align-items: center;
    gap: 10px;
    padding: 6px 2px !important;
    border-bottom: 1px solid #ebebeb !important;
}
.book-move:last-child { border-bottom: 0 !important; }
.book-move-san { padding: 4px 8px; color: #213a43; background: none; border: 0; border-radius: 4px; font-family: "Rubik", sans-serif; font-size: 16px; font-weight: 500; text-align: left; cursor: pointer; }
.book-move-san:hover { background: #eef3f4; }
.book-move-bar { display: flex; height: 12px; overflow: hidden; background: #eef1f2; border-radius: 3px; }
.book-move-bar span { height: 100%; box-shadow: inset 0 1px 1px rgb(255 255 255 / 28%), inset 0 -3px 4px rgb(0 0 0 / 20%); transition: width 0.15s; }
.book-move-share { color: #4f6881; font-family: "Rubik", sans-serif; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.book-move-weight {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    margin: 0;
    background: linear-gradient(90deg, var(--tone) var(--fill), var(--book-track-empty, #dfe5e7) var(--fill));
    border-radius: 3px;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s;
}
.book-move-own .book-move-weight,
.book-move:hover .book-move-weight,
.book-move-weight:focus-visible { opacity: 1; }
.book-move .book-move-weight:disabled { cursor: default; opacity: 0.4; }
.book-move-weight::-webkit-slider-runnable-track { height: 6px; }
.book-move-weight::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; background: white; border: 2px solid #213a43; border-radius: 50%; }
.book-move-weight::-moz-range-thumb { width: 14px; height: 14px; background: white; border: 2px solid #213a43; border-radius: 50%; }
.book-move-weight:focus-visible { outline: 3px solid #5f8895; outline-offset: 4px; }
.book-move-remove { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; color: rgb(75 75 75 / 40%); background: none; border: 0; border-radius: 4px; cursor: pointer; transition: color 0.15s, background-color 0.15s; }
.book-move-remove:is(:hover, :active, :focus-visible) { color: #9c2525; background: rgb(156 37 37 / 8%); }
.book-priority-note { margin: 0; padding: 10px 12px; color: #4f6881; background: #fbfbfb; border-radius: 5px; font-size: 13px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.book-priority-note[hidden] { display: none; }
.book-priority-note button { padding: 0; color: #213a43; background: none; border: 0; font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--tone); text-decoration-thickness: 2px; cursor: pointer; }
.book-priority-note button:focus-visible { outline: 3px solid #5f8895; outline-offset: 2px; }
.book-empty { display: grid; flex: 1 1 0; place-items: center; min-height: 0; margin: 0; color: rgb(33 58 67 / 40%); font-size: 15px; text-align: center; }
.book-empty[hidden] { display: none; }
.book-page .elo-guide details > summary { font-weight: 700; }
.book-status { min-height: 21px; margin: 0; color: #4f6881; font-size: 13px; font-weight: 600; text-align: center; }
.book-stack-box > .book-status { margin-top: 12px; }

/* Stack */
.book-stack-head { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.book-mode-info { display: grid; gap: 8px; width: min(100%, 640px); min-width: 0; text-align: center; }
.book-mode-descriptions { display: grid; min-width: 0; color: #4f6881; font-family: "Rubik", sans-serif; font-size: 15px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.book-mode-descriptions > * { grid-area: 1 / 1; min-width: 0; margin: 0; }
.book-mode-descriptions > [aria-hidden="true"] { visibility: hidden; }
.book-mode { display: flex; justify-self: center; box-sizing: border-box; width: min(100%, 400px); overflow: hidden; background: white; border: 2px solid #213a43; border-bottom-width: 5px; border-radius: 5px; }
.book-mode label { position: relative; display: flex; flex: 1; min-width: 0; }
.book-mode label + label { border-left: 1px solid rgb(33 58 67 / 25%); }
.book-mode input { position: absolute; opacity: 0; pointer-events: none; }
.book-mode label > span { display: flex; flex: 1; align-items: center; justify-content: center; min-height: 36px; padding: 0 16px; color: #213a43; font-family: "Mona Sans"; font-size: inherit; font-weight: 600; box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%), inset 0 -3px 5px rgb(33 58 67 / 12%); cursor: pointer; user-select: none; transition: background-color 0.1s, color 0.1s; }
.book-mode label > span:hover { background: rgb(33 58 67 / 6%); }
.book-mode input:checked + span { color: white; background: #213a43; box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), inset 0 -3px 5px rgb(0 0 0 / 18%); }
.book-mode input:focus-visible + span { outline: 3px solid #5f8895; outline-offset: -3px; }
.book-stack { display: grid; gap: 12px; margin-top: 22px !important; }
.book-add-layer { margin-top: 12px; }
.book-add-close:focus-visible { outline: 3px solid #5f8895; outline-offset: 3px; }
.book-add-dialog { box-sizing: border-box; width: min(460px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 20px; overflow-y: auto; color: #213a43; background: white; border: 2px solid #213a43; border-bottom-width: 5px; border-radius: 5px; box-shadow: 0 12px 32px rgb(33 58 67 / 22%); }
#personality-add-dialog { width: min(560px, calc(100% - 32px)); }
.book-page #personality-panel #personality-add-dialog .tool-file-control,
.book-page #personality-panel #personality-add-dialog .tool-file-control .tool-button { height: auto; }
.book-add-dialog::backdrop { background: rgb(33 58 67 / 45%); }
.book-add-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.book-add-close { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: #213a43; background: none; border: 0; border-radius: 4px; cursor: pointer; }
.book-add-close:hover { background: rgb(0 0 0 / 6%); }
.book-add-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.book-add-options .tool-file-control, .book-add-options .tool-button { width: 100%; }
.book-add-options .tool-button { justify-content: center; }
.book-add-error { margin: 12px 0 0; color: #9c2525; font-size: 13px; font-weight: 600; }
.book-layer {
    --tone: #60aaa5;
    display: grid;
    grid-template-columns: 8px minmax(50px, max-content) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 14px 0 !important;
    overflow: hidden;
    background: white;
    border: 2px solid rgb(33 58 67 / 16%) !important;
    border-radius: 5px;
    cursor: grab;
    user-select: none;
    transition: border-color 0.1s, box-shadow 0.1s, opacity 0.1s;
}
.book-stack-box:has(> #games:not([hidden])) .book-layer { opacity: 0.6; }
.book-stack-box:has(> #games:not([hidden])) .book-layer:is(:hover, :focus-within, .book-layer-dragging) { opacity: 1; }
.book-layer:not(.book-layer-active):hover { border-color: rgb(33 58 67 / 40%) !important; }
.book-layer-active { background: #f7fafb; border-color: #213a43 !important; border-bottom-width: 4px !important; }
.book-layer-dragging { position: relative; z-index: 2; box-shadow: 0 10px 22px rgb(33 58 67 / 18%); cursor: grabbing; }
.book-layer-color { position: relative; align-self: stretch; min-height: 52px; margin: -14px 0; background: var(--tone); touch-action: none; }
.book-layer-color::after { position: absolute; inset: 0 -6px; content: ""; }
.book-layer-off .book-layer-body { opacity: 0.4; }
.book-layer-off .book-layer-color { opacity: 0.4; }
.book-layer-off .book-layer-share { opacity: 0.4; }
.book-layer:focus-visible { outline: 3px solid #5f8895; outline-offset: 2px; }
.book-layer-button:focus-visible { outline: 3px solid #5f8895; outline-offset: 1px; }
.book-layer-body { grid-column: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.book-layer-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; width: 100%; min-width: 0; }
.book-layer-name { box-sizing: content-box; field-sizing: content; min-width: 2ch; max-width: calc(100% - 8px); padding: 1px 4px; margin-left: -4px; color: #213a43; background: transparent; border: 0; border-radius: 4px; font-family: "Mona Sans"; font-size: 16px; font-weight: 700; text-overflow: ellipsis; user-select: text; }
.book-layer-name:hover { background: rgb(0 0 0 / 4%); }
.book-layer-name:focus { background: white; outline: 2px solid #5f8895; }
.book-layer-meta { display: flex; align-items: center; align-self: stretch; gap: 4px; color: #4f6881; font-family: "Rubik", sans-serif; font-size: 13px; }
.book-layer-size { color: #4f6881; font-family: "Rubik", sans-serif; font-size: 13px; font-weight: 500; }
.book-layer-track { flex: 1 1 auto; min-width: 0; height: 10px; overflow: hidden; background: #e8edef; border-radius: 3px; }
.book-layer-priority .book-layer-track { background: color-mix(in srgb, var(--tone) 24%, #e8edef); }
.book-layer-meter { display: block; height: 100%; background: var(--tone); box-shadow: inset 0 1px 1px rgb(255 255 255 / 28%), inset 0 -3px 4px rgb(0 0 0 / 20%); transition: width 0.2s; }
.book-layer-share { grid-column: 2; color: #213a43; font-family: "Rubik", sans-serif; font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; touch-action: none; }
.book-layer-actions { grid-column: 4; display: flex; gap: 4px; }
.book-layer-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: #213a43; background: none; border: 0; border-radius: 4px; font-size: 16px; cursor: pointer; }
.book-layer-button:hover { background: rgb(0 0 0 / 6%); }
.book-presets { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 20px; }
.book-presets > .maia-field-label { grid-column: 1 / -1; }
.book-preset-control { display: flex; align-items: center; gap: 10px; min-width: 0; }
.book-presets label { color: #213a43; font-family: "Mona Sans"; font-size: 16px; font-weight: 600; }
.book-presets select { box-sizing: border-box; font-weight: 500; min-width: 0; width: 100%; min-height: 40px; padding: 6px 38px 6px 10px; color: #213a43; background: white; border: 2px solid #213a43; border-bottom-width: 4px; border-radius: 5px; font-family: "Rubik", sans-serif; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23213a43' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 20px 20px; }
.book-presets select:focus-visible { outline: 3px solid #5f8895; outline-offset: 2px; }
.book-presets select:disabled { opacity: 0.5; }
.book-presets .tool-button { min-width: 76px; justify-content: center; }
.book-page .book-presets select,
.book-page .book-presets .tool-button { box-sizing: border-box; height: 44px; min-height: 44px; }
.book-games { display: grid; gap: 14px; margin-top: 16px; padding: 14px 16px; background: #f8f8f8; border: 2px solid #213a43; border-bottom-width: 4px; border-radius: 5px; }
.book-games[hidden] { display: none; }
.book-games-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-family: "Mona Sans"; font-size: 16px; }
.book-games-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-games-head span { flex: none; color: #4f6881; font-family: "Rubik", sans-serif; font-size: 13px; font-weight: 600; }
.book-games-fields { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 12px; }
.book-games .tool-field { gap: 4px; font-size: 16px; }
.book-games .tool-field select,
.book-games .tool-field input { height: 44px; padding-top: 6px; padding-bottom: 6px; }
.book-games-actions { display: flex; align-items: stretch; justify-content: flex-end; gap: 8px; }
.book-games-note { align-self: center; margin: 0 auto 0 0; color: #9c2525; font-family: "Rubik", sans-serif; font-size: 14px; }
.book-page #books-panel .book-games-note { font-size: 13px; font-weight: 600; }
.book-games-note:empty { display: none; }
.book-page .book-games-build { min-width: 116px; justify-content: center; border-color: transparent; font-weight: 800; }
.book-page .book-games-build:disabled { opacity: 1; }
.book-export { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0; border-top: 1px solid rgb(33 58 67 / 10%); }
.book-export span { min-width: 0; font-family: "Rubik", sans-serif; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.book-export .install-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; min-height: 48px; padding: 10px 22px; border-bottom-width: 5px; font-size: 15px; line-height: 1.4; }

@media (max-width: 900px) {
    .book-studio { grid-template-columns: minmax(0, 1fr); }
    .book-board-column { width: min(100%, 520px); justify-self: center; }
    .book-moves-region { flex: none; height: 300px; }
}
@media (max-width: 768px) {
    .book-workspace-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 340px); }
    .book-workspace-actions .tool-button { width: 100%; min-width: 0; padding: 6px 8px; gap: 6px; }
    .book-mode.book-tabs { width: min(440px, calc(100% - 24px)); }
    .book-page .maia-workbench { margin: 0 12px 28px !important; }
    .book-studio { padding: 28px 14px 0; }
    .book-studio.personality-container { padding: 0 0 16px; }
    .personality-toolbar { margin: 0; }
    .personality-fen-form { width: 100%; margin: -28px 0 0; }
    .personality-export-toolbar { margin: 0 0 -16px; }
    .personality-export #personality-main-controls { padding: 0 20px; }
    .personality-container > :is(#personality-error, #personality-restore-warning) { margin: 12px 12px 20px; }
    .personality-studio > .book-board-column, .personality-position { width: 100%; }
    .personality-studio > .book-board-column { margin: 0; }
    .personality-editor { padding: 0 12px; }
    .book-page .personality-rule-group h3 { top: 68px; }
    .book-page #personality-panel .personality-position .book-icon-button:first-child { border-left-width: 1px; }
    .book-page #personality-panel .personality-position .book-icon-button:last-child { border-right-width: 1px; }
    .book-page #personality-panel #personality-fen { border-radius: 0; }
    .book-stack-box { padding-top: 32px; }
    .book-move { grid-template-columns: minmax(54px, auto) minmax(30px, 1fr) 40px minmax(70px, 110px) 30px; gap: 6px; }
    .book-mode label > span { padding: 0 10px; text-align: center; }
    .book-layer { grid-template-columns: 8px minmax(50px, max-content) minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 10px 10px 0 !important; }
    .book-layer-color { grid-row: 1 / span 2; margin: -10px 0; }
    .book-layer-share { grid-row: 1 / span 2; }
    .book-layer-body { display: contents; }
    .book-layer-heading { grid-column: 3; grid-row: 1; }
    .book-layer-actions { grid-column: 4; grid-row: 1; }
    .book-layer-meta { grid-column: 3 / -1; grid-row: 2; padding-bottom: 2px; }
    .book-layer-track { min-width: 0; max-width: none; }
    .book-layer-off :is(.book-layer-heading, .book-layer-meta) { opacity: 0.4; }
    .book-presets { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; }
    .book-presets > .maia-field-label { grid-column: 1 / -1; }
    .book-games { padding: 12px; }
    .book-games-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .book-games-fields .tool-field:first-child { grid-column: 1 / -1; }
    .book-games-actions { flex-wrap: wrap; }
    .book-games-note { flex-basis: 100%; }
    .book-games-actions .tool-button { flex: 1 1 0; justify-content: center; }
    .book-export { padding: 14px 0; }
    .book-export .install-button { padding-right: 16px; padding-left: 16px; }
}
@media (max-width: 380px) {
    .book-workspace-actions .bi { display: none; }
    .book-add-options { grid-template-columns: 1fr; }
    .book-layer-button { width: 30px; }
}
@media (max-width: 600px) {
    #personality-add-dialog .book-add-options { grid-template-columns: 1fr; }
}
@media (max-width: 300px) {
    .book-tabs a { padding: 0 6px; font-size: 12px; }
}
@media (min-width: 960px) and (min-height: 400px) {
    .personality-workspace {
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr) 240px;
        align-items: start;
        gap: 0;
        width: calc(100% + clamp(20px, 6vw, 100px) + clamp(20px, 6vw, 100px) + 32px);
        max-width: 880px;
    }
    .personality-workspace > .personality-container { grid-column: 2; grid-row: 1; }
    .personality-workspace > #personality-rule-controls { display: contents; }
    .personality-editor { display: none; }
    #personality-panel[inert] .personality-rule-ghost-mobile { display: none; }
    #personality-panel[inert] .personality-rule-ghost {
        position: relative; display: block; grid-row: 1; align-self: stretch; min-width: 0;
        margin: 16px 0; overflow: hidden; border: 1px solid #dce5e6; background: white;
    }
    .personality-rule-ghost-basic { grid-column: 1; border-radius: 5px 0 0 5px; }
    .personality-rule-ghost-advanced { grid-column: 3; border-radius: 0 5px 5px 0; }
    .personality-rule-ghost::before, .personality-rule-ghost::after { content: ''; position: absolute; inset: 0; }
    .personality-rule-ghost::before { background:
        linear-gradient(#dce5e6, #dce5e6) 12px 14px / 45% 12px no-repeat,
        repeating-linear-gradient(to bottom, #e1eaeb 0 10px, transparent 10px 61px) 12px 57px / 55% calc(100% - 57px) no-repeat,
        repeating-linear-gradient(to bottom, #dce5e6 0 6px, transparent 6px 61px) 12px 83px / calc(100% - 24px) calc(100% - 83px) no-repeat; }
    .personality-rule-ghost::after { background: linear-gradient(90deg, transparent, rgb(255 255 255 / 45%), transparent); transform: translateX(-100%); animation: book-board-loading 1.5s ease-in-out infinite; }
    @media (prefers-reduced-motion: reduce) { .personality-rule-ghost::after { animation: none; } }
    .personality-rule-rail { grid-row: 1; align-self: stretch; min-width: 0; contain: size; }
    .personality-rule-rail-basic { grid-column: 1; }
    .personality-rule-rail-advanced { grid-column: 3; }
    .personality-rule-frame {
        position: relative;
        z-index: 5;
        box-sizing: border-box;
        height: calc(100% - 32px);
        margin: 16px 0;
        border: 1px solid #dce5e6;
        border-radius: 0;
        background: white;
    }
    .personality-rule-rail-basic .personality-rule-frame { border-radius: 5px 0 0 5px; }
    .personality-rule-rail-advanced .personality-rule-frame { display: grid; grid-template-rows: minmax(0, 1fr) auto; border-radius: 0 5px 5px 0; }
    .personality-rule-frame::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        z-index: 4;
        width: 20px;
        mask-image: linear-gradient(transparent, black 24px, black calc(100% - 24px), transparent);
        pointer-events: none;
    }
    .personality-rule-rail-basic .personality-rule-frame::before { right: 0; background: linear-gradient(to left, rgb(33 58 67 / 12%), transparent); }
    .personality-rule-rail-advanced .personality-rule-frame::before { left: 0; background: linear-gradient(to right, rgb(33 58 67 / 12%), transparent); }
    .personality-rule-frame.has-more::after {
        content: '';
        position: absolute;
        right: 8px;
        bottom: 0;
        left: 0;
        height: 48px;
        background: linear-gradient(transparent, white 85%);
        border-radius: inherit;
        pointer-events: none;
    }
    .personality-rule-rail-basic .personality-rule-frame.has-more::after { bottom: var(--fade-offset, 0px); z-index: 1; border-radius: 0; }
    .personality-rule-rail-advanced .personality-rule-frame.has-more::after { position: relative; grid-column: 1; grid-row: 1; align-self: end; inset: auto; z-index: 3; margin-right: 8px; border-radius: 0; }
    .personality-rule-wing {
        box-sizing: border-box;
        height: 100%;
        border-radius: inherit;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0 12px;
        scrollbar-width: thin;
        scrollbar-color: #cbd7d8 transparent;
    }
    @supports selector(::-webkit-scrollbar) {
        .personality-rule-wing { scrollbar-width: auto; scrollbar-color: auto; }
        .personality-rule-wing::-webkit-scrollbar { width: 4px; }
        .personality-rule-wing::-webkit-scrollbar-thumb { border-radius: 4px; background: #cbd7d8; }
        .personality-rule-wing::-webkit-scrollbar-track { background: transparent; }
    }
    .personality-rule-wing:focus-visible { outline: 2px solid #527783; outline-offset: -2px; }
    .personality-rule-wing-advanced { grid-column: 1; grid-row: 1; min-height: 0; border-bottom-right-radius: 0; }
    .personality-rule-wing .personality-rule-group:first-child { border-top: 0; }
    .personality-rule-wing .personality-rule-grid { grid-template-columns: minmax(0, 1fr); }
    .book-page .personality-rule-wing .personality-rule-group h3 { top: 0; margin-right: -12px; margin-left: -12px; padding-right: 12px; padding-left: 12px; }
    .personality-rule-wing-basic { scroll-padding: 40px 0 calc(var(--bottom-headers) * 40px); }
    .personality-rule-wing-basic .personality-rule-group { display: contents; }
    .personality-rule-wing-basic .personality-rule-grid { padding: 8px 0 12px; }
    .book-page .personality-rule-wing-basic .personality-rule-group h3 { bottom: calc(var(--remaining-groups) * 39px); margin-bottom: 0; line-height: 20px; }
    .book-page .personality-rule-wing-basic .personality-rule-group h3 { padding: 0; }
    .book-page #personality-panel .personality-rule-wing-basic .personality-rule-jump { padding: 10px 12px 8px; }
    .personality-rule-wing-basic .personality-rule-group h3::before { content: ''; position: absolute; right: 0; bottom: 100%; left: 0; height: 2px; background: linear-gradient(to bottom, #dce5e6 0 1px, white 1px); }
    .personality-rule-group-phases { grid-column: 1; grid-row: 2; padding: 0 12px 12px; }
    .personality-rule-group-phases .personality-rule-grid { grid-template-columns: minmax(0, 1fr); }
    .book-page .personality-rule-group-phases h3 { position: static; margin-right: -12px; margin-left: -12px; padding-right: 12px; padding-left: 12px; }
}
@media (min-width: 960px) and (min-height: 400px) and (max-height: 599px) {
    .personality-rule-group-phases { padding-bottom: 0; }
    .book-page .personality-rule-group-phases h3 { margin-bottom: 4px; padding-top: 5px; padding-bottom: 5px; }
    .personality-rule-group-phases .personality-control { padding: 2px 0; }
}
