.handout-workspace {
  --handout-accent: #287a66;
  color: #26364a;
}

.handout-toolbar,
.handout-panel,
.handout-editor-panel,
.handout-preview-panel {
  border: 1px solid #e2e9f3;
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 36px rgba(38, 56, 86, .055);
}

.handout-toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  min-height: 0;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.handout-eyebrow {
  color: #71819a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.handout-toolbar h2 { margin: 5px 0 4px; color: #24334d; font-size: 24px; }
.handout-toolbar p { margin: 0; color: #78869c; font-size: 13px; }
.handout-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.handout-toolbar-status { align-self: center; color: #71819a; font-size: 11px; white-space: nowrap; }
.handout-toolbar-status + [data-handout-action="library"] { margin-left: auto; }

.handout-button,
.handout-add-actions button {
  min-height: 38px;
  border: 1px solid #dce5f1;
  border-radius: 11px;
  padding: 0 13px;
  background: #fff;
  color: #52647f;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: .16s ease;
}
.handout-button:hover,
.handout-add-actions button:hover { border-color: #a9c0de; background: #f7faff; }
.handout-button.primary { border-color: var(--handout-accent, #287a66); background: var(--handout-accent, #287a66); color: #fff; }
.handout-button.primary:hover { filter: brightness(.95); }
.handout-button.compact { min-height: 32px; font-size: 12px; }

.handout-layout {
  display: grid;
  grid-template-columns: minmax(440px, 1.28fr) minmax(300px, .82fr);
  align-items: start;
  gap: 16px;
}
.handout-sidebar { display: grid; align-content: start; gap: 12px; }
.handout-sidebar-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 5px; border: 1px solid #e2e9f3; border-radius: 13px; background: #f5f8fc; }
.handout-sidebar-tabs button { min-width: 0; min-height: 36px; padding: 0 5px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #71819a; font: inherit; font-size: 12px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.handout-sidebar-tabs button:hover { color: #40516b; background: rgba(255,255,255,.7); }
.handout-sidebar-tabs button.active { border-color: #dfe7f1; background: #fff; color: var(--handout-accent); box-shadow: 0 2px 8px rgba(38,56,86,.06); }
.handout-sidebar [data-handout-tab-panel][hidden] { display: none !important; }
.handout-panel, .handout-editor-panel, .handout-preview-panel { padding: 17px; min-width: 0; }
.handout-panel-heading, .handout-editor-heading, .handout-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}
.handout-panel-heading h3, .handout-editor-heading h3, .handout-preview-heading h3 { margin: 0; color: #2b3b55; font-size: 16px; }
.handout-panel-heading p, .handout-preview-heading span, .handout-editor-heading span { margin: 4px 0 0; color: #8794a8; font-size: 11px; }

.handout-template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.handout-template-card {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 7px;
  border: 1px solid #e4eaf2;
  border-radius: 12px;
  background: white;
  color: #44536a;
  text-align: left;
  cursor: pointer;
}
.handout-template-card.selected { border-color: #7cae9f; box-shadow: 0 0 0 2px rgba(40, 122, 102, .11); }
.handout-template-card strong { font-size: 11px; white-space: nowrap; }
.handout-template-card small { color: #8a96a8; font-size: 9px; white-space: nowrap; }
.template-preview { display: grid; place-items: center; width: 100%; height: 56px; border-radius: 7px; font: 700 20px Georgia, serif; }
.classroom-preview { background: #edf6f2; color: #287a66; border-bottom: 3px solid #287a66; }
.focus-preview { background: #eef2ff; color: #315fd3; box-shadow: inset 4px 0 #315fd3; }
.notes-preview { background: repeating-linear-gradient(#fff, #fff 13px, #e8e3dc 14px); color: #8b6543; }
.minimal-preview { background: #f1f4f7; color: #536477; border-bottom: 2px solid #536477; }
.vibrant-preview { background: #fff1e8; color: #dc7138; box-shadow: inset 0 -4px #f2bc6b; }
.mint-preview { background: linear-gradient(135deg, #e7f5f1, #eef4ff); color: #16877d; border: 1px solid #cde7df; }
.editorial-preview { position: relative; display: block; border-radius: 3px; background: #f8f2ef; }
.editorial-preview i { position: absolute; top: 10px; left: 11px; width: 5px; height: 35px; border-radius: 3px; background: #a34d43; }
.editorial-preview b { position: absolute; top: 13px; left: 23px; width: 42%; height: 7px; border-top: 2px solid #a34d43; border-bottom: 1px solid #c8a6a0; }
.editorial-preview em { position: absolute; right: 10px; bottom: 10px; width: 30%; height: 24px; border-radius: 10px 0; background: #ead8d3; }
.workbook-preview { display: flex; align-items: center; justify-content: center; gap: 4px; background: #f1f5f9; }
.workbook-preview i { width: 21%; height: 32px; border: 1px solid #8ea4bc; border-radius: 3px; background: repeating-linear-gradient(to bottom, transparent 0 8px, #dce5ee 9px 10px); }
.workbook-preview i:first-child { border-top: 4px solid #456d9b; }
.classic-preview { display: flex; flex-direction: column; gap: 3px; border-radius: 2px; background: #f7f5ee; color: #334f75; }
.classic-preview i { width: 48%; height: 1px; background: #8d9caf; }
.classic-preview b { font: 700 16px Georgia, "Songti SC", serif; }
.handout-saved-templates { margin-top: 12px; display: grid; gap: 6px; }
.handout-saved-template-label { color: #7d8ba0; font-size: 11px; font-weight: 800; }
.handout-saved-templates button { display: flex; justify-content: space-between; gap: 8px; padding: 8px 9px; border: 1px solid #e4eaf2; border-radius: 9px; background: #fafcff; color: #485b74; font: inherit; font-size: 11px; cursor: pointer; text-align: left; }
.handout-saved-templates button span { color: var(--handout-accent); font-weight: 800; }
.handout-no-templates { margin: 0; color: #9aa5b5; font-size: 11px; line-height: 1.6; }
.handout-library-modal[hidden] { display: none !important; }
.handout-library-modal { position: fixed; z-index: 10040; inset: 0; display: grid; place-items: center; padding: 20px; }
.handout-library-backdrop { position: absolute; inset: 0; background: rgba(28,42,61,.32); }
.handout-library-dialog { position: relative; display: grid; grid-template-rows: auto auto minmax(160px,1fr); width: min(600px,100%); max-height: min(680px,88vh); overflow: hidden; border: 1px solid #dfe7f1; border-radius: 18px; background: #fff; box-shadow: 0 22px 70px rgba(24,39,61,.2); }
.handout-library-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid #edf0f5; }
.handout-library-dialog h2 { margin: 0; color: #2b3b55; font-size: 18px; }
.handout-library-dialog header p { margin: 5px 0 0; color: #8491a4; font-size: 11px; }
.handout-library-dialog header > button { width: 32px; height: 32px; border: 1px solid #e0e7f0; border-radius: 50%; background: #f8faff; color: #64748a; font-size: 21px; cursor: pointer; }
.handout-library-dialog nav { display: flex; gap: 8px; padding: 12px 18px 0; border-bottom: 1px solid #edf0f5; }
.handout-library-dialog nav button { padding: 9px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #71819a; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.handout-library-dialog nav button[aria-selected="true"] { border-bottom-color: var(--handout-accent); color: var(--handout-accent); }
.handout-library-list { overflow: auto; padding: 8px 18px 16px; }
.handout-library-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 4px; border-bottom: 1px solid #edf1f6; }
.handout-library-row:hover { background: #f8fafc; }
.handout-library-open { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 8px 6px; border: 0; background: transparent; color: #40516b; text-align: left; cursor: pointer; }
.handout-library-open > span { display: grid; gap: 4px; min-width: 0; }
.handout-library-open strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.handout-library-open small { color: #8794a8; font-size: 10px; }
.handout-library-open i { color: var(--handout-accent); font-size: 11px; font-style: normal; font-weight: 800; }
.handout-library-delete { flex: none; padding: 6px 10px; border: 1px solid #f0d6d8; border-radius: 8px; background: #fffafb; color: #b2525b; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.handout-library-delete:hover { border-color: #e6b6ba; background: #fff3f4; }
.handout-library-confirm-backdrop { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 18px; background: rgba(33, 48, 68, .24); }
.handout-library-confirm { width: min(360px, 100%); padding: 22px; border: 1px solid #e2e9f3; border-radius: 16px; background: #fff; box-shadow: 0 18px 48px rgba(28, 42, 62, .18); }
.handout-library-confirm h3 { margin: 0; color: #2b3b55; font-size: 17px; }
.handout-library-confirm p { margin: 10px 0 20px; color: #71819a; font-size: 13px; line-height: 1.6; }
.handout-library-confirm > div { display: flex; justify-content: flex-end; gap: 8px; }
.handout-button.danger { border-color: #bd5b63; background: #bd5b63; color: #fff; }
.handout-library-empty { padding: 34px 12px; color: #8794a8; text-align: center; font-size: 12px; }

.handout-field { display: grid; gap: 6px; margin: 11px 0; color: #63738d; font-size: 11px; font-weight: 750; }
.handout-range-field { gap: 8px; }
.handout-range-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.handout-range-label output { color: var(--handout-accent); }
.handout-field input:not([type="range"]):not([type="color"]):not([type="file"]), .handout-field select {
  width: 100%; min-height: 35px; box-sizing: border-box; border: 1px solid #dfe7f1; border-radius: 9px; padding: 0 9px; background: #fbfcff; color: #34445e; font: inherit; font-size: 12px;
}
.handout-field input[type="color"] { width: 100%; height: 35px; padding: 4px; border: 1px solid #dfe7f1; border-radius: 9px; background: #fbfcff; }
.handout-field input[type="file"] { width: 100%; min-width: 0; color: #65758e; font-size: 10px; }
.handout-field input[type="range"] { width: 100%; accent-color: var(--handout-accent); }
.handout-field output { color: var(--handout-accent); }
.handout-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.handout-text-button { padding: 0; border: 0; background: transparent; color: #8190a5; font: inherit; font-size: 11px; cursor: pointer; }

.handout-editor-heading { align-items: flex-start; flex-wrap: wrap; }
.handout-editor-heading > div:first-child { display: grid; gap: 3px; }
.handout-add-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.handout-add-actions button { min-height: 30px; padding: 0 9px; font-size: 11px; }
.handout-add-actions .handout-import-button { border-color: #c9e2d8; background: #eff8f4; color: #287a66; }
.handout-editor-list { display: grid; gap: 9px; max-height: 72vh; overflow: auto; padding-right: 3px; }
.handout-block-editor { padding: 11px; border: 1px solid #e3eaf2; border-radius: 12px; background: #fcfdff; }
.handout-block-editor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.handout-block-kind { color: var(--handout-accent); font-size: 11px; font-weight: 850; }
.handout-block-actions { display: flex; gap: 4px; }
.handout-block-actions button { min-width: 27px; height: 26px; border: 1px solid #e0e7f0; border-radius: 7px; background: #fff; color: #64748a; font: inherit; font-size: 11px; cursor: pointer; }
.handout-block-actions button:last-child { padding: 0 8px; color: #b25e65; }
.handout-block-actions button:disabled { opacity: .35; cursor: default; }
.handout-block-editor label { display: grid; gap: 5px; margin-top: 8px; color: #8290a3; font-size: 10px; font-weight: 750; }
.handout-block-editor input, .handout-block-editor textarea { box-sizing: border-box; width: 100%; border: 1px solid #e1e8f0; border-radius: 8px; padding: 8px; resize: vertical; color: #35455e; background: #fff; font: inherit; font-size: 12px; line-height: 1.55; }

.handout-preview-panel { position: sticky; top: 14px; }
.handout-preview-heading { margin-bottom: 12px; }
.handout-preview-scroll { height: calc(200vh - 380px); overflow-x: hidden; overflow-y: scroll; scrollbar-width: thin; scrollbar-color: #b8c8d5 #e9eef3; border-radius: 12px; padding: 14px; background: #eef2f7; }
.handout-preview-scroll::-webkit-scrollbar { width: 10px; }
.handout-preview-scroll::-webkit-scrollbar-track { border-radius: 8px; background: #e9eef3; }
.handout-preview-scroll::-webkit-scrollbar-thumb { border: 2px solid #e9eef3; border-radius: 8px; background: #b8c8d5; }
.handout-paper {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  width: min(100%, var(--handout-page-width, 210mm));
  min-height: 430px;
  margin: 0 auto;
  padding: 30px 28px 24px;
  overflow: hidden;
  background: white;
  color: var(--handout-text, #26364a);
  font: 400 var(--handout-font-size, 14px)/1.72 "Noto Serif CJK SC", "Songti SC", serif;
  box-shadow: 0 4px 18px rgba(33, 48, 69, .12);
}
.handout-paper-header, .handout-paper-footer { display: flex; justify-content: space-between; gap: 12px; color: #8a96a8; font: 600 10px/1.4 system-ui, sans-serif; }
.handout-paper-header { padding-bottom: 9px; border-bottom: 1px solid #e7ebf1; }
.handout-paper > h1 { margin: 20px 0 2px; color: var(--handout-accent); text-align: center; font-size: 1.65em; line-height: 1.3; }
.handout-paper-subtitle { margin-bottom: 20px; color: #8a96a8; text-align: center; font: 11px system-ui, sans-serif; }
.handout-paper-content { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(var(--handout-columns, 1), minmax(0, 1fr)); gap: 14px; }
.handout-paper-content > section { break-inside: avoid; }
.handout-preview-heading-block { padding: 10px 12px; border-left: 4px solid var(--handout-accent); border-radius: 0 9px 9px 0; background: color-mix(in srgb, var(--handout-accent) 9%, white); }
.handout-preview-heading-block h2 { margin: 0; color: var(--handout-accent); font-size: 1.17em; }
.handout-preview-heading-block p { margin: 3px 0 0; }
.handout-preview-box { padding: 12px; border-radius: 10px; background: #f3f7f5; }
.handout-preview-box h3 { margin: -12px -12px 9px; padding: 6px 10px; border-radius: 10px 10px 0 0; background: var(--handout-accent); color: white; font-size: .95em; }
.handout-preview-box h3 span { margin-right: 7px; }
.handout-preview-box > div, .handout-preview-question > div, .handout-preview-text > div { overflow-wrap: anywhere; }
.handout-preview-question { padding: 10px 12px; border: 1px solid #e5eaf1; border-radius: 9px; }
.handout-preview-question h3, .handout-preview-text h3 { margin: 0 0 5px; color: var(--handout-accent); font-size: .98em; }
.handout-preview-text { padding: 2px 1px; }
.handout-paper[data-box="focus"] .handout-preview-box { background: #eef2ff; border-left: 3px solid var(--handout-accent); }
.handout-paper[data-box="notes"] .handout-preview-box { border: 1px solid #e8e1d7; border-radius: 3px; background: #fffdf8; }
.handout-paper[data-box="notes"] .handout-preview-box h3 { border-radius: 0; background: #f1e9dc; color: var(--handout-accent); }
.handout-paper[data-box="minimal"] .handout-preview-box { border: 1px solid #e1e6eb; border-radius: 4px; background: #f7f8fa; }
.handout-paper[data-box="minimal"] .handout-preview-box h3 { border-radius: 0; background: transparent; color: var(--handout-accent); border-bottom: 1px solid #d9e0e7; }
.handout-paper[data-box="vibrant"] .handout-preview-box { border: 1px solid #f3d4bd; background: #fff7f0; }
.handout-paper[data-box="vibrant"] .handout-preview-box h3 { background: var(--handout-accent); }
.handout-paper[data-box="mint"] .handout-preview-box { border: 1px solid #d5ebe4; border-radius: 14px; background: #f0f8f5; }
.handout-paper[data-box="mint"] .handout-preview-box h3 { background: #e1f2ec; color: var(--handout-accent); }
.handout-paper[data-box="editorial"] { font-family: "Avenir Next", "PingFang SC", sans-serif; }
.handout-paper[data-box="editorial"] .handout-paper-header { border-bottom: 3px solid var(--handout-accent); }
.handout-paper[data-box="editorial"] > h1 { margin: 30px 0 4px; padding-left: 14px; border-left: 7px solid var(--handout-accent); text-align: left; letter-spacing: .04em; }
.handout-paper[data-box="editorial"] .handout-paper-subtitle { margin-left: 21px; text-align: left; }
.handout-paper[data-box="editorial"] .handout-preview-heading-block { padding: 12px 0; border: 0; border-top: 1px solid #ddc5bf; border-radius: 0; background: transparent; }
.handout-paper[data-box="editorial"] .handout-preview-heading-block h2::before { content: "SECTION"; margin-right: 10px; color: #a6a09a; font: 700 9px/1 system-ui, sans-serif; letter-spacing: .12em; }
.handout-paper[data-box="editorial"] .handout-preview-box { border-radius: 0 14px 14px 0; background: #f6efed; }
.handout-paper[data-box="editorial"] .handout-preview-box h3 { border-radius: 0; background: transparent; color: var(--handout-accent); border-bottom: 1px solid #e5d4d0; }
.handout-paper[data-box="workbook"] { background-color: #fffefa; }
.handout-paper[data-box="workbook"] > h1 { width: fit-content; margin: 18px auto 6px; padding: 7px 28px; border: 2px solid var(--handout-accent); border-radius: 4px; background: #f0f5fa; }
.handout-paper[data-box="workbook"] .handout-paper-subtitle { padding-bottom: 12px; border-bottom: 1px dashed #aebed0; }
.handout-paper[data-box="workbook"] .handout-preview-heading-block { border: 1px solid #9bacc0; border-left: 5px solid var(--handout-accent); border-radius: 3px; background: #f4f7fa; }
.handout-paper[data-box="workbook"] .handout-preview-question { border: 1px solid #afbdcc; border-radius: 3px; background: linear-gradient(#fff 30px, #f3f6f8 31px); }
.handout-paper[data-box="workbook"] .handout-preview-question h3::before { content: "□ "; color: var(--handout-accent); }
.handout-paper[data-box="workbook"] .handout-preview-box { border: 1px dashed #91a7be; border-radius: 4px; background: #f3f7fb; }
.handout-paper[data-box="workbook"] .handout-preview-box h3 { border-radius: 3px 3px 0 0; background: #e1eaf3; color: var(--handout-accent); }
.handout-paper[data-box="classic"] { font-family: Georgia, "Songti SC", "STSong", serif; }
.handout-paper[data-box="classic"] .handout-paper-header { border-bottom: 3px double var(--handout-accent); font-family: Georgia, serif; }
.handout-paper[data-box="classic"] > h1 { margin-top: 28px; padding-bottom: 11px; border-bottom: 1px solid #bdc8d5; letter-spacing: .08em; }
.handout-paper[data-box="classic"] .handout-preview-heading-block { padding: 8px 0; border: 0; border-bottom: 1px solid #bdc8d5; border-radius: 0; background: transparent; text-align: center; }
.handout-paper[data-box="classic"] .handout-preview-heading-block h2::before, .handout-paper[data-box="classic"] .handout-preview-heading-block h2::after { content: "◆"; margin: 0 9px; color: var(--handout-accent); font-size: .6em; vertical-align: .15em; }
.handout-paper[data-box="classic"] .handout-preview-box { border: 1px solid #b9c5d2; border-radius: 0; background: #f8fafc; }
.handout-paper[data-box="classic"] .handout-preview-box h3 { border-radius: 0; background: #e8edf3; color: var(--handout-accent); }
.handout-paper-footer { position: relative; z-index: 1; margin-top: 24px; padding-top: 8px; border-top: 1px solid #e7ebf1; }
.handout-watermark { position: absolute; z-index: 0; inset: 25% 10%; display: grid; place-items: center; pointer-events: none; color: var(--handout-accent); }
.handout-watermark-text { transform: rotate(-25deg); font: 800 34px/1 system-ui, sans-serif; white-space: nowrap; }
.handout-watermark-image { display: block; max-width: 65%; max-height: 70%; object-fit: contain; }
.handout-paper-content, .handout-paper-header, .handout-paper > h1, .handout-paper-subtitle, .handout-paper-footer { position: relative; z-index: 1; }
.handout-workspace.preview-expanded .handout-layout { grid-template-columns: minmax(520px, 1.5fr) minmax(320px, .75fr); }

.handout-import-modal { position: fixed; z-index: 10030; inset: 0; display: grid; place-items: center; padding: 20px; }
.handout-import-backdrop { position: absolute; inset: 0; background: rgba(28, 42, 61, .42); }
.handout-import-dialog { position: relative; display: grid; grid-template-rows: auto auto minmax(180px, 1fr) auto; width: min(780px, 100%); max-height: min(760px, 90vh); overflow: hidden; border: 1px solid #dfe7f1; border-radius: 20px; background: #fff; box-shadow: 0 24px 80px rgba(24, 39, 61, .22); }
.handout-import-dialog > header, .handout-import-dialog > footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; }
.handout-import-dialog > header { border-bottom: 1px solid #edf0f5; }
.handout-import-dialog > header h2 { margin: 0; color: #2b3b55; font-size: 19px; }
.handout-import-dialog > header p { margin: 5px 0 0; color: #8491a4; font-size: 12px; }
.handout-import-dialog > header > button { width: 34px; height: 34px; border: 1px solid #e0e7f0; border-radius: 50%; background: #f8faff; color: #64748a; font-size: 23px; cursor: pointer; }
.handout-import-filters { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 14px 22px; background: #fafcff; }
.handout-import-filters label { display: grid; gap: 5px; color: #71819a; font-size: 11px; font-weight: 750; }
.handout-import-filters input, .handout-import-filters select { box-sizing: border-box; width: 100%; height: 38px; border: 1px solid #dfe7f1; border-radius: 9px; padding: 0 10px; background: #fff; color: #34445e; font: inherit; font-size: 12px; }
.handout-import-results { min-height: 0; overflow: auto; padding: 8px 18px; }
.handout-import-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid #edf1f6; cursor: pointer; }
.handout-import-row input, .handout-import-answer-toggle input { accent-color: #287a66; }
.handout-import-row-copy { display: grid; min-width: 0; gap: 4px; }
.handout-import-row-copy strong { overflow: hidden; color: #40516b; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.handout-import-row-copy > span { display: -webkit-box; overflow: hidden; color: #7b899d; font-size: 11px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.handout-import-row > small { color: #8794a8; font-size: 10px; }
.handout-import-empty { padding: 42px 16px; color: #8a96a8; text-align: center; font-size: 13px; }
.handout-import-dialog > footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 10px 14px; border-top: 1px solid #edf0f5; }
.handout-import-answer-toggle { display: inline-flex; align-items: center; gap: 7px; color: #63738d; font-size: 12px; white-space: nowrap; }
.handout-import-footer-actions { display: flex; grid-column: 1; grid-row: 2; align-items: center; flex-wrap: wrap; gap: 8px; color: #7b899d; font-size: 11px; white-space: nowrap; }
.handout-import-footer-actions button { min-height: 34px; }
.handout-import-footer-actions button:disabled { cursor: default; opacity: .5; }
.handout-import-confirm { grid-column: 2; grid-row: 1 / span 2; min-width: 112px; min-height: 40px; white-space: nowrap; }

@media (max-width: 1260px) {
  .handout-layout { grid-template-columns: minmax(220px, .8fr) minmax(270px, 1fr); }
  .handout-preview-panel { position: static; grid-column: 1 / -1; }
  .handout-preview-scroll { height: auto; max-height: 70vh; }
}
@media (max-width: 760px) {
  .handout-toolbar { align-items: center; flex-direction: row; padding: 10px; }
  .handout-toolbar-actions { width: auto; }
  .handout-layout { grid-template-columns: minmax(0, 1fr); }
  .handout-preview-panel { grid-column: auto; }
  .handout-paper { min-height: 550px; padding: 24px 18px; }
  .handout-preview-scroll { padding: 8px; }
  .handout-editor-list { max-height: none; }
  .handout-import-modal { padding: 8px; }
  .handout-import-dialog { max-height: 94vh; border-radius: 14px; }
  .handout-import-filters { grid-template-columns: 1fr; }
  .handout-import-dialog > footer { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 13px; }
  .handout-import-footer-actions { width: auto; flex-wrap: wrap; justify-content: flex-start; }
}
@media (max-width: 560px) {
  .handout-import-dialog > footer { grid-template-columns: minmax(0, 1fr); }
  .handout-import-answer-toggle, .handout-import-footer-actions, .handout-import-confirm { grid-column: 1; }
  .handout-import-answer-toggle { grid-row: 1; }
  .handout-import-footer-actions { grid-row: 2; }
  .handout-import-confirm { grid-row: 3; width: 100%; }
}
@media print {
  body:has(#page-handout.active) * { visibility: hidden !important; }
  body:has(#page-handout.active) #page-handout.active,
  body:has(#page-handout.active) #page-handout.active * { visibility: visible !important; }
  body:has(#page-handout.active) .shell { display: block !important; max-width: none !important; margin: 0 !important; }
  body:has(#page-handout.active) .side-nav,
  body:has(#page-handout.active) .nav-resizer,
  body:has(#page-handout.active) .app > :not(#page-handout) { display: none !important; }
  body:has(#page-handout.active) .app { min-height: 0 !important; height: auto !important; padding: 0 !important; }
  #page-handout.active { position: static !important; inset: auto !important; display: block !important; width: auto !important; height: auto !important; min-height: 0 !important; overflow: visible !important; padding: 0 !important; background: white !important; }
  #page-handout.active .handout-workspace { height: auto !important; min-height: 0 !important; overflow: visible !important; }
  #page-handout.active .handout-toolbar, #page-handout.active .handout-sidebar, #page-handout.active .handout-editor-panel, #page-handout.active .handout-preview-heading { display: none !important; }
  #page-handout.active .handout-layout { display: block !important; }
  #page-handout.active .handout-preview-panel { position: static !important; display: block !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; }
  #page-handout.active .handout-preview-scroll { height: auto !important; max-height: none !important; overflow: visible !important; padding: 0 !important; background: white !important; }
  #page-handout.active .handout-paper { width: 100% !important; min-height: 0 !important; box-shadow: none !important; }
}
