/* Product layout. Circuit artwork and electrical interaction remain in their owners. */
:root {
  --ink: #203b32;
  --muted: #687a70;
  --page: #f6f7f4;
  --line: #dfe6df;
  --green-soft: #eaf2ed;
  --radius: 12px;
  font-size: 15px;
}
[hidden] { display: none !important; }
body { background: var(--page); }
button, summary, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, summary { transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
button:focus-visible, summary:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #7ba68e;
  outline-offset: 3px;
}
button:disabled { cursor: default; }
.button { min-height: 40px; height: auto; padding: 9px 15px; font-size: 13px; border-radius: 8px; font-weight: 500; }
.button.small { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.button.selected { background: var(--green-soft); border-color: #b9d0c1; color: var(--green); }
.text-button { font-size: 12px; line-height: 1.6; padding: 5px 0; }
.icon-button { width: 34px; height: 34px; border-radius: 7px; }
.check-label { font-size: 13px; line-height: 1.6; }
.field { font-size: 13px; gap: 7px; margin-top: 18px; }
.field input, .field select, .field textarea { padding: 10px 12px; font-size: 14px; line-height: 1.6; border-radius: 8px; }
.field-note, .inspector-note { font-size: 12px; line-height: 1.75; color: var(--muted); }
.form-error:not(:empty) { margin-top: 12px; padding: 10px 12px; background: #fcf1ed; border-radius: 7px; font-size: 13px; }
.tag { font-size: 11px; padding: 3px 7px; color: #596f60; border-color: var(--line); background: #f8faf6; }
.difficulty { font-size: 11px; border-radius: 5px; }

/* One global navigation, with account controls kept separate. */
.app-header { height: 68px; min-height: 68px; padding: 0 24px; gap: 30px; position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--line); }
.brand { gap: 10px; flex-shrink: 0; }
.brand>svg { width: 36px; height: 36px; }
.brand strong { font-size: 19px; font-weight: 650; letter-spacing: .2px; }
.brand small { font-size: 10px; letter-spacing: .6px; color: var(--muted); margin-top: 3px; }
.main-nav { display: flex; align-items: stretch; height: 100%; gap: 24px; flex: 1; margin: 0; }
.main-nav button { position: relative; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-size: 14px; color: #687a70; white-space: nowrap; }
.main-nav button:hover { color: var(--green); background: transparent; }
.main-nav button.nav-active { color: var(--green); border-bottom-color: var(--green); font-weight: 650; }
.main-nav button::after { display: none; }
.main-nav #bank-nav-label { font: inherit; color: inherit; padding: 0; margin: 0; border: 0; background: none; }
.header-account { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-shrink: 0; }
.hub-active .mode-control { display: none; }
.mode-control { padding: 3px; border: 1px solid var(--line); background: #f6f8f4; border-radius: 8px; margin: 0; }
.mode-control button { min-height: 28px; padding: 4px 10px; font-size: 11px; border-radius: 5px; }
.account-button { display: flex; align-items: center; gap: 8px; padding: 5px 0; border: 0; background: none; font-size: 13px; color: var(--ink); }
.account-avatar { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 12px; }
#classroom-identity { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 1840px; padding: 16px 24px 0; margin: auto; }
.workspace-heading { min-height: 52px; padding: 0; margin: 0 0 14px; gap: 16px; align-items: center; }
.workspace-title-group { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.workspace-heading h1 { font-size: 25px; line-height: 1.4; font-weight: 650; margin: 0; letter-spacing: -.5px; }
.workspace-mode { color: var(--muted); font-size: 12px; padding-left: 14px; border-left: 1px solid #cbd8cc; }
.heading-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.heading-actions .button { min-height: 36px; padding: 7px 12px; font-size: 12px; }

/* Native disclosure menus are keyboard operable and share one presentation. */
.action-menu { position: relative; flex-shrink: 0; font-size: 13px; }
.action-menu>summary { display: flex; align-items: center; justify-content: center; gap: 7px; list-style: none; cursor: pointer; padding: 8px 10px; min-height: 34px; border: 1px solid transparent; border-radius: 7px; color: #536b5d; }
.action-menu>summary::-webkit-details-marker { display: none; }
.action-menu>summary:hover, .action-menu[open]>summary { background: var(--green-soft); color: var(--green); }
.action-menu>summary .icon { width: 13px; height: 13px; transform: rotate(90deg); }
.action-menu[open]>summary .icon { transform: rotate(-90deg); }
.menu-panel, .dropdown-menu { position: absolute; right: 0; top: calc(100% + 7px); width: 220px; min-width: 220px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 10px 32px #203b321a; z-index: 90; }
.menu-panel button, .dropdown-menu button { display: block; text-align: left; width: 100%; min-height: 38px; padding: 9px 10px; border: 0; border-radius: 6px; font-size: 13px; background: none; color: var(--ink); line-height: 1.6; }
.menu-panel button:hover, .dropdown-menu button:hover { background: #f0f5ee; }
.menu-panel button.danger-text { color: var(--danger); }
.menu-label { color: var(--muted); padding: 7px 10px; font-size: 11px; line-height: 1.7; }
.dropdown-menu { width: 265px; }
.menu-panel .canvas-options { display: grid; gap: 10px; border-top: 1px solid var(--line); padding: 12px 10px 7px; margin-top: 6px; }

/* Exercise order: read the question, choose apparatus, work on the canvas. */
body .workbench, body.drawing-task-active .workbench {
  display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 16px;
  height: calc(100dvh - 184px); min-height: 560px; max-height: none; align-items: stretch;
}
.exercise-sidebar { display: flex; flex-direction: column; gap: 14px; height: 100%; min-height: 0; padding: 0; overflow: hidden; }
.exercise-sidebar .question-panel, body.drawing-task-active .exercise-sidebar .question-panel { flex: 1 1 0; min-height: 180px; padding: 18px 20px; overflow-y: auto; }
.exercise-sidebar .component-panel { flex: 0 0 auto; padding: 15px 16px; max-height: 250px; overflow-y: auto; }
.question-panel, .component-panel { border: 1px solid var(--line); border-radius: 12px; background: white; scrollbar-width: thin; }
.panel-title { display: flex; align-items: center; gap: 12px; margin: 0; }
.panel-title h2, .panel-title h3 { font-size: 14px; font-weight: 650; }
.panel-title>span { font-size: 11px; background: #f4f7f1; padding: 2px 6px; color: var(--muted); }
.panel-title .text-button { font-size: 12px; }
.question-panel .question-body { display: block; padding: 0; margin-top: 17px; }
.question-number { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.question-body h3, body.drawing-task-active .question-body h3 { font-size: 20px; line-height: 1.5; margin: 10px 0 13px; letter-spacing: -.2px; color: var(--ink); }
.question-prompt, body.drawing-task-active .question-prompt { font-size: 15px; line-height: 1.85; color: #425c4d; white-space: pre-line; margin: 0; }
.question-details { margin-top: 14px; padding-top: 10px; border-top: 1px solid #edf0e9; font-size: 11px; color: var(--muted); }
.question-details summary { cursor: pointer; font-size: 11px; padding: 3px 0; }
.question-details p { margin: 8px 0; }
.question-details .question-tags { margin: 8px 0 0; gap: 5px; }
.resume-note { margin-top: 10px; font-size: 11px; color: var(--green); }
body .drawing-source-panel { display: block; border-bottom: 0; border-top: 1px solid var(--line); margin: 16px 0 0; padding: 14px 0 0; }
.drawing-source-heading { margin: 0; }
.drawing-source-heading h2 { font-size: 13px; font-weight: 600; }
.drawing-source-heading button { font-size: 11px; }
#source-origin { font-size: 10px; line-height: 1.6; margin: 6px 0 10px; color: var(--muted); }
#source-figure { position: relative; margin: 0; width: 100%; max-width: none; background: white; border: 1px solid #e8ede5; border-radius: 8px; overflow: hidden; }
#source-figure>svg:not(.source-draft-overlay), .drawing-source-upload { display: block; width: 100%; height: auto; max-height: none; object-fit: contain; }
.drawing-source-note { font-size: 11px; color: var(--muted); margin: 9px 0 0; line-height: 1.7; }
.question-panel:has(#source-panel:not([hidden])) { display: flex; flex-direction: column; }
.question-panel:has(#source-panel:not([hidden])) .question-body { display: contents; }
.question-panel:has(#source-panel:not([hidden])) .question-number { display: none; }
.question-panel:has(#source-panel:not([hidden])) .panel-title { order: 0; }
.question-panel:has(#source-panel:not([hidden])) .question-body h3 { order: 1; font-size: 18px; margin: 15px 0 0; }
.question-panel:has(#source-panel:not([hidden])) .drawing-source-panel { order: 2; margin-top: 12px; padding-top: 0; border-top: 0; }
.question-panel:has(#source-panel:not([hidden])) .question-prompt { order: 3; font-size: 13px; line-height: 1.8; margin-top: 14px; }
.question-panel:has(#source-panel:not([hidden])) .question-details { order: 4; }
.question-panel:has(#source-panel:not([hidden])) .resume-note { order: 5; }
.question-panel:has(#source-panel:not([hidden])) #source-origin { display: none; }
.question-panel:has(#source-panel:not([hidden])) .drawing-source-note { display: none; }
.question-panel:has(#source-panel:not([hidden])) .drawing-source-heading { margin: 0 0 9px; }
.question-panel:has(#source-panel:not([hidden])) .drawing-source-heading h2 { font-size: 11px; color: var(--muted); }
.source-draft-overlay { position: absolute; inset: 0; width: 100%!important; height: 100%!important; pointer-events: none; touch-action: none; }
.source-draft-overlay.ink-enabled { pointer-events: auto; cursor: crosshair; }
.source-enlarge-dialog { width: min(860px,96vw); }
.enlarged-source-figure { position: relative; max-width: 720px; margin: auto; overflow: hidden; }
.enlarged-source-figure img, .enlarged-source-figure>svg:not(.source-draft-overlay) { display: block; width: 100%; height: auto; }
.source-enlarge-dialog .draft-toolbar { margin-bottom: 14px; }

/* Apparatus and the inspector share the lower left context. */
.panel-description { display: block; color: var(--muted); font-size: 11px; line-height: 1.7; margin: 7px 0 0; }
.palette, .given-palette { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 10px; overflow: visible; }
.palette .palette-item { width: auto; min-width: 0; min-height: 58px; display: flex; flex-direction: row; align-items: center; gap: 7px; text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: 7px; background: #fafcf8; }
.palette .palette-item:hover:enabled { border-color: #a6c3af; background: #eff5ed; }
.palette .component-mini { display: flex; align-items: center; justify-content: center; width: 42px; min-width: 42px; height: 42px; background: none; }
.palette .component-mini svg { width: 42px; height: 42px; }
.palette .component-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.palette .component-info strong { font-size: 14px; font-weight: 600; }
.palette .component-info small { display: block; font-size: 10px; color: var(--muted); white-space: normal; }
.palette .palette-plus { position: static; display: block; font-size: 14px; opacity: 1; margin-left: auto; color: #7a977f; }
.catalog-card { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #fafcf8; overflow: hidden; }
.palette .catalog-card .palette-item { width: 100%; min-height: 58px; border: 0; border-radius: 0; background: transparent; }
.catalog-parameter { display: flex; align-items: center; gap: 5px; border-top: 1px solid #e9eee5; margin: 0 8px; padding: 5px 0; }
.catalog-parameter>span { font-size: 10px; color: var(--muted); flex-shrink: 0; }
.catalog-parameter select { width: 100%; min-width: 0; min-height: 28px; border: 0; border-radius: 4px; padding: 3px 14px 3px 2px; background-color: transparent; color: var(--ink); font-size: 11px; }
.given-palette .given-placed:disabled { opacity: .5; }
.exercise-sidebar .palette-foot, body.drawing-task-active .palette-foot { display: flex; border-top: 0; padding: 0; margin-top: 10px; }
.palette-foot .text-button { font-size: 11px; display: flex; align-items: center; gap: 5px; }
.inspector { display: block; border-left: 0; border-top: 1px solid var(--line); margin-top: 14px; padding: 14px 0 0; }
.inspector:empty { display: none; }
.inspector-title { font-size: 13px; }
.inspector .field { margin-top: 13px; font-size: 12px; }
.inspector .field select, .inspector .field input { font-size: 13px; }
.inspector-note { font-size: 11px; line-height: 1.7; margin-top: 8px; }

/* Canvas controls, drawing tools and answer actions have distinct levels. */
body .drawing-panel, body.drawing-task-active .drawing-panel { display: flex; flex-direction: column; grid-column: 2; grid-row: 1; height: 100%; min-height: 0; overflow: hidden; border-radius: 12px; box-shadow: none; }
.canvas-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: auto; min-height: 58px; padding: 9px 14px; border-bottom: 1px solid var(--line); position: relative; z-index: 8; }
.view-control { display: flex; padding: 3px; border: 1px solid #e2e8dc; background: #f3f6ee; border-radius: 8px; }
.view-control button { min-height: 32px; padding: 6px 11px; font-size: 13px; border-radius: 5px; }
.view-control .icon { width: 16px; height: 16px; }
.canvas-extra-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.canvas-zoom { display: flex; align-items: center; height: 34px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: white; }
.canvas-zoom button { height: 32px; min-width: 29px; font-size: 15px; padding: 4px 6px; }
#canvas-zoom-label { min-width: 52px; font-size: 11px; }
.canvas-menu>summary { border: 1px solid var(--line); background: white; font-size: 12px; min-height: 34px; }
.draft-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 14px; min-height: 50px; border-bottom: 1px solid var(--line); background: #fafbf7; position: relative; z-index: 7; }
.drawing-tool-group { display: flex; gap: 2px; border-radius: 7px; padding: 2px; background: #edf2e8; }
.draft-toolbar button { min-height: 32px; padding: 5px 9px; font-size: 12px; border: 1px solid transparent; border-radius: 5px; color: #556e5d; background: transparent; }
.drawing-tool-group button[aria-pressed=true] { background: white; color: var(--green); border-color: #d7e3d3; box-shadow: 0 1px 3px #203b3209; font-weight: 600; }
.draft-toolbar .tool-button:hover, .draft-toolbar button:hover:enabled { background: var(--green-soft); }
.draft-toolbar .tool-divider { display: block; width: 1px; height: 19px; background: var(--line); margin: 0 3px; }
.draft-menu>summary { font-size: 12px; padding: 5px 9px; min-height: 32px; }
.draft-toolbar .menu-panel button { min-height: 38px; text-align: left; width: 100%; padding: 9px 10px; font-size: 13px; color: var(--ink); }
#run-button { margin-left: auto; border: 1px solid var(--line); background: white; color: var(--green); min-width: 90px; }
#run-button[aria-pressed=true] { background: var(--green-soft); border-color: #a6c3af; }
#run-button:disabled { opacity: .55; }
.canvas-wrap, body.drawing-task-active .canvas-wrap { min-height: 0; flex: 1 1 0; background: #edf1eb; }
#circuit-canvas { width: 100%; height: 100%; min-height: 0; touch-action: none; }
.paper-background { fill: #fdfefa; }
body.drawing-task-active .paper-background { fill: #fff; }
.paper-boundary { fill: none; stroke: #b9c7b5; stroke-width: 1; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.paper-growing .paper-boundary { stroke: #63896b; stroke-width: 1.5; }
.component-rotate { position: absolute; width: 36px; height: 36px; min-height: 36px; padding: 7px; border: 1px solid #bed1ba; border-radius: 50%; background: #fff; color: var(--green); box-shadow: 0 2px 7px #203e3224; z-index: 5; cursor: pointer; }
.component-rotate:hover { background: #edf5e8; border-color: #709776; }
.component-rotate:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.component-rotate svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.canvas-caption { top: 13px; left: 17px; color: #81917e; font-size: 10px; letter-spacing: .3px; }
.canvas-caption>.live-dot { display: none; }
.canvas-empty h3 { font-size: 19px; font-weight: 500; color: #617d64; }
.canvas-empty p { font-size: 13px; color: var(--muted); line-height: 1.8; }
.canvas-hint { font-size: 11px; max-width: 90%; padding: 7px 11px; bottom: 16px; white-space: normal; line-height: 1.7; }
.canvas-bottom { min-height: 43px; flex-shrink: 0; padding: 5px 12px; gap: 8px; }
.canvas-tool-tip { color: #7a8c7c; font-size: 10px; margin-left: auto; }
.edit-tools { display: flex; align-items: center; gap: 5px; }
.edit-tools .text-button { font-size: 11px; margin-left: 6px; }
.flow-status { font-size: 12px; padding: 9px 14px; line-height: 1.7; }
.exercise-actions { padding: 12px 14px; border-top: 1px solid var(--line); background: #fff; flex-shrink: 0; }
.exercise-actions .question-actions { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 8px 16px; margin: 0; max-width: none; }
.exercise-actions .question-actions>.button { width: auto; min-width: 112px; min-height: 38px; font-size: 13px; }
.question-minor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; margin: 0; }
.question-minor-actions .text-button { font-size: 12px; }
.assignment-actions { margin-left: auto; }
.answer-menu { margin-left: auto; }
.exercise-actions .menu-panel { top: auto; bottom: calc(100% + 9px); }
.practice-note { display: block; width: 100%; margin: 0; padding: 0; font-size: 10px; color: var(--muted); line-height: 1.6; }
.check-result { max-height: 155px; overflow-y: auto; margin: 0 0 12px; padding: 11px 13px; border-radius: 8px; }
.check-result strong { font-size: 14px; }
.check-result p { font-size: 12px; line-height: 1.7; margin-top: 4px; }
.anonymous-rate { color: var(--green); }
.drawing-solution { margin: 0 0 12px; max-height: 170px; overflow: auto; }
.drawing-solution strong { font-size: 13px; }
.drawing-solution p { font-size: 12px; }
.teacher-answer-image img { max-height: 230px; }
.workspace-footer { height: 35px; font-size: 10px; gap: 15px; }
.workspace-footer .footer-hint { display: none; }
.workspace-footer .text-button { font-size: 11px; margin-left: auto; }

/* Question bank, paper basket and assignments. */
.hub-active main>.workspace-heading, .hub-active main>.workbench, .hub-active main>.workspace-footer { display: none!important; }
#learning-home { max-width: 1600px; margin: auto; padding: 5px 0 36px; }
.hub-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 25px; min-height: 77px; }
.hub-heading h1 { font-size: 28px; font-weight: 650; line-height: 1.4; margin: 0 0 7px; letter-spacing: -.4px; }
.hub-heading p { font-size: 13px; color: var(--muted); line-height: 1.8; }
.hub-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.hub-bank-layout { display: grid; grid-template-columns: 164px minmax(0,1fr) 292px; gap: 20px; align-items: start; }
.hub-bank-layout:not(:has(.hub-basket)) { grid-template-columns: 164px minmax(0,1fr); }
.hub-filters { display: flex; flex-direction: column; padding: 14px 10px; border: 1px solid var(--line); border-radius: 10px; background: white; position: sticky; top: 88px; }
.hub-filters h3 { font-size: 12px; color: var(--muted); margin: 6px 9px 10px; font-weight: 500; }
.hub-filters h3:not(:first-child) { margin-top: 25px; }
.hub-filters button { padding: 10px 9px; border-radius: 6px; text-align: left; font-size: 12px; line-height: 1.7; }
.hub-filters button[aria-pressed=true] { color: var(--green); background: var(--green-soft); font-weight: 600; }
.hub-filters button:hover { background: #f3f7ef; }
.hub-list-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.hub-list-bar .search-field { width: min(400px,80%); height: 40px; border-radius: 8px; background: white; }
.hub-list-bar input { font-size: 13px; }
.hub-list-bar select, .hub-basket select, .export-controls select { padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: white; font-size: 13px; color: var(--ink); }
.hub-question { display: grid; grid-template-columns: 155px minmax(0,1fr); gap: 20px; padding: 20px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 11px; background: white; min-width: 0; }
.hub-question.is-selected { border-color: #98b9a4; }
.hub-question-image { display: flex; align-items: center; justify-content: center; min-width: 0; }
.hub-question-image img, .hub-question-image svg { width: 100%; height: auto; max-width: 100%; max-height: 190px; object-fit: contain; }
.hub-question-copy { min-width: 0; }
.hub-question h3 { font-size: 17px; font-weight: 600; margin: 8px 0; line-height: 1.55; }
.hub-question-copy>p { font-size: 12px; line-height: 1.8; color: #5f7566; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hub-question .question-tags { margin: 10px 0 0; gap: 5px; }
.hub-question .hub-row-actions { margin-top: 14px; }
.hub-source { font-size: 10px; color: var(--muted); display: block; margin-top: 9px; }
.hub-attempt-result { font-size: 11px; color: #986333; margin-top: 9px; }
.hub-attempt-result.is-correct { color: var(--green); }
.notebook-action { margin-left: auto; }
.hub-basket { position: sticky; top: 88px; padding: 18px; border: 1px solid #d3dfd5; border-radius: 11px; background: white; min-width: 0; }
.hub-basket .field { margin-top: 16px; font-size: 12px; }
.hub-basket input { font-size: 13px; min-width: 0; }
.hub-basket ol { padding: 0; margin: 15px 0; list-style: none; max-height: calc(100dvh - 430px); overflow-y: auto; scrollbar-width: thin; }
.hub-basket li { padding: 12px 0; border-bottom: 1px solid var(--line); cursor: grab; }
.hub-basket li strong { display: flex; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 500; line-height: 1.7; }
.basket-number { font-variant-numeric: tabular-nums; color: #8ca38e; min-width: 15px; }
.basket-item-tools { display: flex; align-items: center; gap: 4px; margin-top: 9px; }
.basket-item-tools select { min-width: 0; flex: 1; padding: 6px 3px; font-size: 11px; }
.basket-item-tools button { border: 1px solid var(--line); border-radius: 5px; width: 29px; height: 30px; font-size: 13px; }
.basket-item-tools button:hover:enabled { background: var(--green-soft); }
.hub-basket .field-note { font-size: 10px; margin-bottom: 12px; }
.hub-basket .check-label { font-size: 12px; }
.hub-basket-actions { display: grid; gap: 8px; margin-top: 17px; }
.mobile-basket-bar { display: none; }
.basket-empty { padding: 28px 4px; text-align: center; }
.basket-empty strong { font-size: 14px; font-weight: 500; color: #6b846f; }
.basket-empty p { font-size: 11px; line-height: 1.8; color: var(--muted); margin-top: 7px; }
.hub-empty { padding: 40px 24px; text-align: center; font-size: 14px; line-height: 1.9; color: var(--muted); background: #fff; border-radius: 10px; }
.hub-empty .button { margin-top: 16px; }
.hub-error strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 7px; }
.guest-notice { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 15px; margin-bottom: 20px; border-radius: 8px; background: #edf3eb; color: #5f7565; font-size: 12px; }
.hub-cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(290px,1fr)); gap: 18px; }
.hub-paper-card, .hub-class-card { padding: 24px; border: 1px solid var(--line); border-radius: 11px; background: white; text-align: left; }
.hub-paper-card h3 { font-size: 21px; font-weight: 600; line-height: 1.6; margin: 11px 0; }
.hub-paper-card>p { font-size: 13px; color: var(--muted); line-height: 1.8; margin-bottom: 22px; }
.hub-paper-card .eyebrow { font-size: 11px; letter-spacing: 0; }
.hub-class-card { display: flex; flex-direction: column; gap: 12px; }
.hub-class-card span { font-size: 12px; color: var(--muted); }
.hub-detail-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 22px; }
.hub-detail-title h2 { font-size: 23px; margin: 12px 0 7px; line-height: 1.5; }
.hub-detail-title p { font-size: 13px; line-height: 1.8; color: var(--muted); }
.hub-detail-questions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.hub-detail-question { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.hub-detail-question:has(>.hub-question) { background: none; padding: 0; border: 0; }
.hub-detail-question>.eyebrow { display: block; font-size: 12px; margin: 0 0 9px; }
.hub-detail-question .hub-question { grid-template-columns: 130px minmax(0,1fr); padding: 18px; gap: 16px; height: calc(100% - 25px); }
.hub-detail-question>h3 { font-size: 15px; margin-bottom: 12px; }
.hub-detail-question>p { font-size: 12px; color: var(--muted); margin-bottom: 13px; }
.hub-student-summary { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 12px; margin: 0 0 25px; }
.hub-student-summary button { display: flex; flex-direction: column; gap: 8px; text-align: left; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 16px; }
.hub-student-summary span { font-size: 12px; color: var(--muted); }

/* Task dialogs use concrete titles, readable forms and consistent feedback. */
dialog { max-height: 90dvh; border-radius: 15px; }
dialog::backdrop { background: #182c245c; backdrop-filter: blur(2px); }
.classroom-dialog, .save-dialog, .help-dialog, .source-enlarge-dialog, .image-export-dialog { padding: 26px; }
.classroom-dialog:has(#classroom-auth-form) { width: min(460px,96vw); }
.setup-help, .statistics-help { margin: 12px 0; font-size: 12px; line-height: 1.8; color: var(--muted); }
.setup-help summary, .statistics-help summary { cursor: pointer; }
.dialog-heading { gap: 20px; margin-bottom: 22px; }
.dialog-heading .eyebrow { display: none; }
.dialog-heading h2, .classroom-dialog .dialog-heading h2, .image-export-dialog h2 { font-size: 24px; line-height: 1.5; font-weight: 650; }
.dialog-heading p, .classroom-dialog .dialog-heading p { font-size: 13px; color: var(--muted); line-height: 1.8; margin-top: 8px; }
.dialog-footer { padding-top: 18px; gap: 12px; }
.classroom-dialog .classroom-bar { gap: 12px; flex-wrap: wrap; }
.classroom-dialog .classroom-tabs { gap: 18px; overflow-x: auto; }
.classroom-tabs button, .classroom-login-tabs button { font-size: 14px; white-space: nowrap; }
.classroom-dialog .classroom-code { font-size: 13px; gap: 12px; flex-wrap: wrap; }
.classroom-code small { font-size: 11px; }
.classroom-note { font-size: 12px; line-height: 1.8; background: #f1f5ef; color: #5c7462; border-radius: 8px; }
.classroom-table th { font-size: 12px; font-weight: 600; }
.classroom-table td { font-size: 13px; line-height: 1.7; }
.classroom-table small { font-size: 11px; }
.table-scroll { overflow-x: auto; max-width: 100%; }
.teacher-entry-routes { margin-bottom: 22px; }
.teacher-entry-routes button { min-height: 66px; padding: 12px; border-radius: 9px; }
.teacher-entry-routes button strong { font-size: 14px; }
.teacher-entry-routes button span { font-size: 11px; }
.teacher-entry-note { font-size: 11px; line-height: 1.8; color: var(--muted); }
.teacher-entry-footer { font-size: 11px; }
.teacher-route-intro h3, .teacher-package-heading h3 { font-size: 18px; }
.teacher-codex-view details { padding: 13px 0; margin-top: 15px; border-top: 1px solid var(--line); }
.teacher-codex-view summary { font-size: 13px; cursor: pointer; }
.teacher-reference-note { font-size: 12px; line-height: 1.8; }
.help-steps { display: grid; gap: 20px; }
.help-steps h3 { font-size: 15px; }
.help-steps p { font-size: 13px; line-height: 1.8; }
.help-note { font-size: 12px; line-height: 1.8; }
.image-export-dialog { width: min(1080px,96vw); background: var(--page); }
.export-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.export-controls label { font-size: 13px; display: flex; align-items: center; gap: 12px; }
.export-preview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.export-preview figure { margin: 0; min-width: 0; }
.export-preview:has(>figure:only-child) { grid-template-columns: minmax(0,1fr); }
.export-preview img { width: 100%; height: auto; background: white; box-shadow: 0 2px 14px #203b3210; border-radius: 2px; }
.export-preview figcaption { text-align: center; font-size: 11px; color: var(--muted); padding: 10px; }
.export-content-options { display: flex; flex-wrap: wrap; gap: 8px; }
.export-content-options button { min-height: 38px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; background: white; }
.export-content-options button[aria-pressed=true] { background: var(--green-soft); border-color: #9ab8a5; color: var(--green); }
.export-content-options button:disabled { opacity: .45; }

/* Responsive behavior keeps question order and allows the canvas to be used. */
/* Account administration uses a separate surface from teaching work. */
.admin-active main>.workspace-heading, .admin-active main>.workbench,
.admin-active main>.workspace-footer, .admin-active #learning-home { display: none!important; }
.admin-active .mode-control { display: none; }
#admin-home { max-width: 1280px; margin: 0 auto; padding: 16px 0 40px; }
.admin-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.admin-summary>div { display: flex; align-items: baseline; gap: 12px; padding: 18px 22px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.admin-summary strong { font-size: 28px; font-weight: 600; }
.admin-summary span { font-size: 13px; color: var(--muted); }
.admin-tabs { display: flex; gap: 24px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.admin-tabs button { min-height: 42px; padding: 7px 0; color: var(--muted); border-bottom: 2px solid transparent; font-size: 14px; }
.admin-tabs button[aria-pressed=true] { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.admin-list-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 0 0 15px; }
.admin-list-tools .search-field { flex: 1 1 200px; max-width: 400px; }
.admin-list-tools>span { font-size: 12px; color: var(--muted); }
.admin-role-filter { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.admin-role-filter select { min-height: 38px; border: 1px solid var(--line); border-radius: 7px; background: white; font-size: 13px; padding: 6px 10px; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid #e7ece5; }
.admin-table th { color: var(--muted); font-size: 12px; background: #f0f4ed; }
.admin-table td { font-size: 13px; }
.admin-table small { display: block; margin-top: 3px; color: var(--muted); }
.admin-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.account-state { display: inline-flex; border-radius: 5px; padding: 3px 7px; font-size: 11px; white-space: nowrap; }
.account-state.is-enabled { color: #386b4e; background: #edf5e9; }
.account-state.is-disabled { color: #8c6258; background: #f7eee9; }
.admin-editor { width: min(520px,96vw); }
.admin-editor .check-label { margin-top: 18px; }
.account-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.legacy-login { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.legacy-login>summary { cursor: pointer; padding: 5px 0; }
.classroom-login-tabs { overflow-x: auto; }
.classroom-dialog:has(#account-password-form), .classroom-dialog:has(#classroom-join-form), .classroom-dialog:has(#classroom-transfer-form) { width: min(520px,96vw); }
.classroom-owner { margin: 0 0 15px; }
.classroom-dialog:has(#account-recovery-form), .classroom-dialog:has(#account-recovery-reset-form) { width: min(520px,96vw); }
.account-auth-message:empty { display: none; }
.account-auth-message:not(:empty) { padding: 12px 14px; border-radius: 8px; background: var(--green-soft); color: var(--green); }
.recovery-status { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 16px 0; color: var(--muted); font-size: 13px; }
.recovery-card-dialog { width: min(540px,96vw); }
.recovery-card-paper { margin: 8px 0 16px; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--page); }
.recovery-card-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.recovery-card-heading strong { color: var(--green); font-size: 18px; font-weight: 650; }
.recovery-card-heading span { font-size: 12px; color: var(--muted); }
.recovery-card-account { display: grid; gap: 8px; margin: 16px 0; font-size: 14px; }
.recovery-card-account>div { display: grid; grid-template-columns: 60px minmax(0,1fr); gap: 12px; }
.recovery-card-account dt { color: var(--muted); }
.recovery-card-account dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.recovery-card-label { margin: 0; }
.recovery-card-label textarea { font-family: ui-monospace,Consolas,monospace; font-size: 19px; font-weight: 600; line-height: 1.75; letter-spacing: .03em; resize: none; cursor: text; background: #fff; color: var(--green); }
.recovery-card-date { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.recovery-card-save-state:empty { display: none; }
.recovery-card-save-state:not(:empty) { color: var(--green); }
.recovery-code-input { font-family: ui-monospace,Consolas,monospace; letter-spacing: .02em; }
@media (max-width:600px) {
  .admin-summary { gap: 8px; }
  .admin-summary>div { flex-direction: column; gap: 4px; padding: 12px; }
  .admin-summary strong { font-size: 23px; }
  .admin-summary span { font-size: 11px; }
  .admin-table th, .admin-table td { padding: 11px 8px; }
  .admin-table th:nth-child(2), .admin-table td:nth-child(2), .admin-table td:nth-child(3) { white-space: nowrap; }
  .admin-table td:first-child { overflow-wrap: anywhere; }
  .admin-row-actions { gap: 8px; min-width: 110px; }
  #admin-home .hub-heading { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .recovery-card-paper { padding: 16px; }
  .recovery-card-label textarea { font-size: 16px; }
  .recovery-card-dialog .dialog-footer { flex-wrap: wrap; }
  .recovery-card-dialog .dialog-footer .button { flex: 1 1 140px; }
}

@media (min-width:1600px) {
  body .workbench, body.drawing-task-active .workbench { grid-template-columns: 350px minmax(0,1fr); gap: 20px; }
  .question-body h3, body.drawing-task-active .question-body h3 { font-size: 22px; }
  .question-prompt, body.drawing-task-active .question-prompt { font-size: 16px; }
  .hub-bank-layout { grid-template-columns: 180px minmax(0,1fr) 320px; }
  .hub-question { grid-template-columns: 200px minmax(0,1fr); gap: 25px; padding: 23px; }
}
@media (max-width:1180px) {
  .app-header { padding: 0 18px; gap: 20px; }
  .brand strong { font-size: 17px; }
  .main-nav { gap: 17px; }
  .main-nav button { font-size: 13px; }
  .header-account { gap: 12px; }
  main { padding: 14px 18px 0; }
  body .workbench, body.drawing-task-active .workbench { grid-template-columns: 292px minmax(0,1fr); gap: 13px; }
  .exercise-sidebar .question-panel, body.drawing-task-active .exercise-sidebar .question-panel { padding: 17px; }
  .hub-bank-layout { grid-template-columns: 140px minmax(0,1fr) 265px; gap: 15px; }
  .hub-bank-layout:not(:has(.hub-basket)) { grid-template-columns: 140px minmax(0,1fr); }
  .hub-question { grid-template-columns: 120px minmax(0,1fr); padding: 17px; gap: 16px; }
  .hub-question h3 { font-size: 16px; }
  .hub-question .button.small { padding: 6px 9px; font-size: 11px; }
  .hub-detail-questions { grid-template-columns: 1fr; }
}
@media (max-width:1000px) {
  .app-header { height: auto; min-height: 68px; flex-wrap: wrap; padding: 12px 18px 0; gap: 10px 20px; }
  .main-nav { order: 3; width: 100%; flex: auto; height: 39px; overflow-x: auto; gap: 25px; }
  .header-account { margin-left: auto; }
  body .workbench, body.drawing-task-active .workbench { height: calc(100dvh - 225px); min-height: 620px; }
  .hub-bank-layout { grid-template-columns: 145px minmax(0,1fr); }
  .hub-basket { grid-column: 1/-1; position: static; }
  .hub-basket ol { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; max-height: 350px; }
  .hub-basket-actions { display: flex; flex-wrap: wrap; }
  .hub-basket-actions .button { flex: 1; }
  .hub-active #learning-home { padding-bottom: 95px; }
  .mobile-basket-bar { display: flex; align-items: center; justify-content: space-between; position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); width: min(600px,calc(100% - 24px)); z-index: 45; padding: 9px 12px; border: 1px solid #bfd0c3; border-radius: 10px; background: white; box-shadow: 0 5px 24px #203b3220; font-size: 13px; }
  .mobile-basket-bar .button { min-height: 42px; }
  .hub-filters { top: 120px; }
  .canvas-toolbar { padding: 8px 10px; gap: 8px; }
  .draft-toolbar { padding: 7px 10px; }
  .canvas-menu>summary { font-size: 11px; padding: 6px 7px; }
}
@media (max-width:850px) {
  main { padding: 12px 12px 0; }
  .workspace-heading { min-height: 50px; flex-wrap: wrap; gap: 10px; }
  .workspace-heading h1 { font-size: 23px; }
  body .workbench, body.drawing-task-active .workbench { display: flex; flex-direction: column; gap: 12px; height: auto; min-height: 0; }
  .exercise-sidebar { display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,.75fr); align-items: start; height: auto; overflow: visible; gap: 12px; }
  .exercise-sidebar .question-panel, body.drawing-task-active .exercise-sidebar .question-panel { flex: none; min-height: 0; height: auto; overflow: visible; order: 0; }
  .exercise-sidebar .component-panel { max-height: 390px; overflow-y: auto; order: 1; }
  .question-body h3, body.drawing-task-active .question-body h3 { font-size: 20px; }
  .question-prompt, body.drawing-task-active .question-prompt { font-size: 14px; }
  body .drawing-panel, body.drawing-task-active .drawing-panel { grid-column: auto; grid-row: auto; height: 660px; min-height: 660px; order: 1; flex-shrink: 0; }
  .canvas-wrap { min-height: 320px; }
  .hub-heading { gap: 16px; margin-bottom: 20px; }
  .hub-heading h1 { font-size: 25px; }
  .hub-bank-layout, .hub-bank-layout:not(:has(.hub-basket)) { grid-template-columns: 1fr; }
  .hub-filters { position: static; flex-direction: row; flex-wrap: wrap; gap: 3px; padding: 10px; }
  .hub-filters h3 { width: 100%; margin: 6px 7px!important; font-size: 11px; }
  .hub-filters button { padding: 7px 9px; font-size: 12px; }
  .hub-question { grid-template-columns: 155px minmax(0,1fr); }
  .hub-basket { grid-column: auto; }
  .hub-detail-title { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dialog-heading h2, .classroom-dialog .dialog-heading h2 { font-size: 22px; }
  .export-controls { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width:560px) {
  .app-header { padding: 11px 12px 0; gap: 10px; }
  .brand>svg { width: 31px; height: 31px; }
  .brand strong { font-size: 17px; }
  .brand small { font-size: 9px; letter-spacing: .2px; }
  .header-account { gap: 9px; }
  .account-button { font-size: 12px; }
  .account-avatar { display: none; }
  #classroom-identity { max-width: 72px; }
  .mode-control button { padding: 4px 7px; font-size: 11px; }
  .main-nav { gap: 24px; height: 40px; }
  .main-nav button { font-size: 13px; min-height: 40px; }
  .workspace-heading { gap: 12px; margin-bottom: 12px; }
  .workspace-title-group { gap: 10px; }
  .workspace-mode { font-size: 11px; padding-left: 10px; }
  .heading-actions { width: 100%; justify-content: flex-start; gap: 8px; }
  .heading-actions .button { min-height: 38px; font-size: 12px; padding: 8px 10px; }
  .exercise-sidebar { display: flex; flex-direction: column; gap: 12px; }
  .exercise-sidebar .question-panel, .exercise-sidebar .component-panel { width: 100%; max-height: none; }
  .exercise-sidebar .question-panel, body.drawing-task-active .exercise-sidebar .question-panel { padding: 17px; }
  .exercise-sidebar .component-panel { padding: 14px; }
  .palette, .given-palette { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .palette .palette-item { min-height: 70px; padding: 6px; flex-direction: column; gap: 3px; align-items: center; text-align: center; }
  .palette .component-mini, .palette .component-mini svg { width: 40px; height: 36px; min-width: 40px; }
  .palette .component-info strong { font-size: 13px; }
  .palette .component-info small { display: none; }
  .palette .palette-plus { display: none; }
  #source-figure { max-width: 310px; margin: auto; }
  body .drawing-panel, body.drawing-task-active .drawing-panel { height: 700px; min-height: 700px; }
  .canvas-toolbar { padding: 9px; flex-wrap: wrap; gap: 8px; }
  .view-control button { padding: 6px 8px; font-size: 12px; min-height: 34px; }
  .canvas-extra-tools { gap: 5px; }
  .canvas-menu>summary { min-height: 34px; font-size: 11px; padding: 6px; }
  .canvas-menu>summary .icon { display: none; }
  .canvas-zoom button { min-width: 26px; padding: 4px; }
  #canvas-zoom-label { min-width: 39px; font-size: 10px; }
  .draft-toolbar { padding: 7px 8px; gap: 5px; }
  .draft-toolbar button, .draft-menu>summary { min-height: 36px; padding: 6px 8px; font-size: 11px; }
  .draft-toolbar>.tool-divider { display: none; }
  #run-button { min-width: 76px; }
  .canvas-caption { font-size: 9px; left: 12px; right: 12px; }
  .canvas-tool-tip { display: none; }
  .canvas-bottom .icon-button { width: 36px; height: 36px; }
  .exercise-actions { padding: 11px; }
  .exercise-actions .question-actions { gap: 9px 12px; }
  .exercise-actions .question-actions>.button { min-width: 100px; min-height: 44px; }
  .question-minor-actions { gap: 12px; }
  .assignment-actions { margin-left: 0; }
  .question-minor-actions .text-button { padding: 8px 0; }
  .workspace-footer { height: auto; min-height: 44px; flex-wrap: wrap; padding: 10px 0; gap: 5px 12px; }
  #circuit-count { margin-left: auto; }
  .workspace-footer>button { display: none; }
  .hub-heading { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  .hub-heading h1 { font-size: 25px; }
  .hub-heading p { font-size: 12px; }
  .hub-row-actions .button { min-height: 40px; }
  .hub-question { grid-template-columns: 1fr; padding: 17px; gap: 14px; }
  .hub-question-image img, .hub-question-image svg { width: auto; max-width: 100%; max-height: 200px; }
  .hub-question h3 { font-size: 17px; }
  .hub-question-copy>p { font-size: 13px; }
  .hub-question .button.small { min-height: 44px; padding: 8px 12px; font-size: 12px; }
  .hub-basket ol { grid-template-columns: 1fr; max-height: none; }
  .basket-item-tools button { width: 36px; height: 36px; }
  .basket-item-tools select { min-height: 36px; }
  .hub-basket-actions { display: grid; grid-template-columns: 1fr; }
  .hub-cards { grid-template-columns: 1fr; }
  .hub-detail-question .hub-question { grid-template-columns: 1fr; height: auto; }
  .guest-notice { flex-wrap: wrap; gap: 5px; font-size: 11px; }
  .classroom-dialog, .save-dialog, .help-dialog, .source-enlarge-dialog, .image-export-dialog { width: 96vw; max-width: 96vw; padding: 20px 16px; }
  .dialog-heading { margin-bottom: 18px; gap: 12px; }
  .dialog-heading p, .classroom-dialog .dialog-heading p { font-size: 12px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .classroom-dialog .classroom-tabs { gap: 16px; }
  .classroom-dialog .classroom-bar label { width: 100%; }
  .classroom-dialog .classroom-code { flex-direction: column; align-items: flex-start; }
  .teacher-entry-routes { grid-template-columns: 1fr; }
  .teacher-entry-routes button { min-height: 52px; padding: 10px; }
  .teacher-entry-routes button span { margin-top: 3px; }
  .export-preview { grid-template-columns: 1fr; }
  .export-controls { gap: 14px; }
  .export-controls label, .export-controls select { width: 100%; }
  .export-content-options { display: grid; width: 100%; grid-template-columns: 1fr; }
  .export-content-options button { text-align: left; min-height: 44px; }
}

/* Content facets stay with the question list; the paper basket keeps its own place. */
.hub-bank-layout.hub-faceted-layout { grid-template-columns: minmax(0,1fr) 292px; }
.hub-bank-layout.hub-faceted-layout:not(:has(.hub-basket)) { grid-template-columns: minmax(0,1fr); }
.hub-faceted-layout>.hub-bank-list { min-width: 0; }
.hub-faceted-layout>.hub-basket { grid-column: auto; }
.hub-bank-scopes { display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); margin: -6px 0 20px; }
.hub-bank-scopes button { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 9px 0; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.hub-bank-scopes button[aria-pressed=true] { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.hub-bank-scopes button>span { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--green-soft); color: var(--green); font-variant-numeric: tabular-nums; }
.hub-filter-panel { border: 1px solid var(--line); border-radius: 11px; background: white; padding: 18px 20px 0; margin-bottom: 18px; }
.hub-filter-search { margin-bottom: 12px; }
.hub-filter-search .search-field { width: min(500px,80%); }
.hub-match-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hub-facets>summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 9px 0 13px; cursor: pointer; list-style: none; }
.hub-facets>summary::-webkit-details-marker { display: none; }
.hub-facets>summary strong { font-size: 13px; font-weight: 600; }
.hub-facets>summary>span { color: var(--muted); font-size: 11px; }
.hub-facets>summary>span:after { content: '⌄'; display: inline-block; font-size: 15px; margin-left: 12px; }
.hub-facets[open]>summary>span:after { transform: rotate(180deg); }
.hub-facet-groups { display: grid; gap: 0; border-top: 1px solid var(--line); }
.hub-facet-group { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.hub-facet-group:last-child { border-bottom: 0; }
.hub-facet-heading { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 8px; }
.hub-facet-heading>strong { font-size: 12px; font-weight: 500; }
.hub-facet-heading>small { font-size: 10px; color: var(--muted); }
.hub-facet-options { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 5px 7px; min-width: 0; }
.hub-facet-option { display: inline-flex; align-items: baseline; gap: 8px; min-height: 36px; max-width: 100%; padding: 8px 10px; border-radius: 6px; color: var(--ink); font-size: 12px; line-height: 1.6; text-align: left; }
.hub-facet-option>span { min-width: 0; max-width: 40ch; overflow-wrap: anywhere; }
.hub-facet-option>small { flex-shrink: 0; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hub-facet-option:hover { background: var(--page); }
.hub-facet-option.is-zero { color: var(--muted); }
.hub-facet-option[aria-pressed=true] { background: var(--green-soft); color: var(--green); font-weight: 600; }
.hub-facet-option[aria-pressed=true]>small { color: var(--green); }
.hub-knowledge-mode { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 5px; }
.hub-knowledge-mode button { min-height: 27px; padding: 3px 6px; border-radius: 3px; font-size: 10px; color: var(--muted); }
.hub-knowledge-mode button[aria-pressed=true] { background: var(--green-soft); color: var(--green); font-weight: 600; }
.hub-selected-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 52px; border-top: 1px solid var(--line); padding: 11px 0; }
.hub-selected-filters>.text-button { margin-left: auto; }
.hub-selected-chip { display: inline-flex; align-items: baseline; gap: 10px; max-width: 100%; min-height: 31px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; line-height: 1.6; color: var(--green); overflow-wrap: anywhere; text-align: left; }
.hub-selected-chip>span { flex-shrink: 0; font-size: 13px; }
.hub-sharing { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; }
.hub-sharing-state { border-radius: 4px; padding: 3px 7px; background: var(--page); color: var(--muted); font-size: 10px; }
.hub-sharing-state.is-approved { background: var(--green-soft); color: var(--green); }
.hub-sharing-state.needs-edit { color: #986333; }
.hub-sharing details { max-width: 100%; font-size: 11px; color: var(--muted); }
.hub-sharing summary { cursor: pointer; }
.hub-sharing details p { font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 8px; }
.hub-public-note { margin: 0 0 15px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.hub-public-preview { width: min(960px,96vw); }
.hub-public-prompt { font-size: 15px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.hub-public-figures { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin: 22px 0; }
.hub-public-figures>section { min-width: 0; }
.hub-public-figures h3 { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 9px; }
.hub-public-figures section>div { display: flex; align-items: center; justify-content: center; padding: 14px; min-height: 190px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.hub-public-figures img,.hub-public-figures svg { width: 100%; max-height: 360px; object-fit: contain; }
.hub-public-solution { font-size: 13px; margin: 15px 0 20px; }
.hub-public-solution>summary { cursor: pointer; }
.hub-public-solution>p { padding-top: 12px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (min-width:1600px) {
  .hub-bank-layout.hub-faceted-layout { grid-template-columns: minmax(0,1fr) 320px; }
}
@media (max-width:1050px) {
  .hub-bank-layout.hub-faceted-layout { grid-template-columns: minmax(0,1fr); }
  .hub-faceted-layout>.hub-basket { grid-column: 1/-1; position: static; }
}
@media (max-width:700px) {
  .hub-filter-panel { padding: 12px 14px 0; }
  .hub-filter-search { flex-wrap: wrap; gap: 9px; }
  .hub-filter-search .search-field { width: 100%; }
  .hub-match-count { margin-left: auto; font-size: 11px; }
  .hub-facet-group { grid-template-columns: minmax(0,1fr); gap: 9px; padding: 13px 0; }
  .hub-facet-heading { flex-direction: row; align-items: center; justify-content: space-between; padding-top: 0; }
  .hub-facet-option { min-height: 40px; padding: 9px; }
  .hub-knowledge-mode button { min-height: 32px; min-width: 40px; }
  .hub-bank-scopes { margin-top: 0; }
  .hub-selected-chip { min-height: 36px; }
  .hub-public-figures { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .hub-public-preview .dialog-footer { flex-wrap: wrap; }
  .hub-public-preview .dialog-footer .button { flex: 1 1 140px; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { transition: none!important; scroll-behavior: auto!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; }
}
