@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;600;700&display=swap");

:root {
  font-family: "DM Sans", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #233149;
  background: #f5f8fc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #24334b;
  --muted: #8290a4;
  --blue: #4c78ed;
  --blue-dark: #3f66d5;
  --line: #e8edf4;
  --panel: #fff;
  --shadow: 0 7px 24px rgba(34, 57, 91, .055);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(76, 120, 237, .2); outline-offset: 2px; }
button:disabled { cursor: not-allowed !important; opacity: .48; }
.app-shell { min-height: 100vh; }
.sidebar { width: 244px; position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column; padding: 27px 15px 15px; background: #fff; border-right: 1px solid #eaf0f6; }
.brand { display: flex; align-items: center; gap: 10px; height: 36px; border: 0; background: none; padding: 0 9px; font-size: 16px; font-weight: 700; letter-spacing: -.5px; cursor: pointer; color: #24334b; }
.brand-mark { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #71a0ff, #4a70e3); box-shadow: 0 4px 11px #4c78ed45; }
.brand-accent { color: #5279e3; }
.workspace-label { margin: 43px 10px 12px; color: #a3adbd; font-size: 9px; font-weight: 700; letter-spacing: 1.4px; }
.main-nav { display: grid; gap: 5px; }
.nav-item { width: 100%; height: 43px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: #7c899c; text-align: left; font-size: 12px; font-weight: 500; cursor: pointer; transition: background .16s, color .16s; }
.nav-item:hover { color: var(--ink); background: #f6f8fc; }
.nav-item-active { background: #eff4ff; color: #4b70de; font-weight: 700; }
.sidebar-bottom { margin-top: auto; }
.local-note { display: flex; align-items: flex-start; gap: 9px; margin: 0 4px 19px; padding: 13px 10px; border: 1px solid #e6f0eb; border-radius: 9px; background: #f8fcf9; }
.privacy-dot, .status-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #57b882; box-shadow: 0 0 0 3px #57b8821a; }
.privacy-dot { margin: 4px 0 0 1px; }
.local-note b, .local-note small { display: block; }
.local-note b { color: #668274; font-size: 10px; font-weight: 600; }
.local-note small { margin-top: 4px; color: #9baa9f; font-size: 9px; }
.settings-item { height: 39px; font-size: 11px; }
.account-card { display: flex; align-items: center; gap: 9px; margin-top: 13px; padding: 12px 6px 3px; border-top: 1px solid #eef1f5; }
.avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: #ecf1ff; color: #5d7ee4; font-weight: 700; font-size: 12px; }
.account-card b, .account-card small { display: block; }
.account-card b { font-size: 10px; }
.account-card small { margin-top: 3px; color: #9aa5b4; font-size: 9px; }
.account-more { margin-left: auto; color: #a6afbb; }
.main-area { min-height: 100vh; margin-left: 244px; }
.topbar { height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 42px; background: rgba(255,255,255,.82); border-bottom: 1px solid #ebf0f5; }
.breadcrumbs { display: flex; align-items: center; gap: 10px; font-size: 11px; color: #a0a9b7; }
.breadcrumbs b { color: #536177; font-weight: 600; }
.crumb-slash { color: #d3dae4; }
.top-actions { display: flex; align-items: center; gap: 19px; }
.save-status { display: flex; align-items: center; gap: 8px; color: #8491a3; font-size: 10px; }
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 13px; border: 1px solid transparent; border-radius: 7px; font-weight: 600; font-size: 11px; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.button:not(:disabled):active { transform: translateY(1px); }
.button-primary { background: #4e77e9; color: #fff; box-shadow: 0 4px 10px #4e77e922; }
.button-primary:hover:not(:disabled) { background: #426ad9; box-shadow: 0 5px 13px #4e77e936; }
.button-outline { border-color: #e1e7ef; color: #56657a; background: #fff; }
.button-outline:hover:not(:disabled) { border-color: #cbd6e5; background: #f9fbfe; }
.top-create { height: 34px; min-height: 34px; font-size: 10px; }
.content { max-width: 1264px; margin: 0 auto; padding: 33px 42px 40px; }
.mobile-menu-button { display: none; border: 0; background: transparent; }
.global-error, .global-notice { display: flex; align-items: center; gap: 9px; margin-bottom: 17px; padding: 11px 13px; border-radius: 8px; font-size: 11px; line-height: 1.6; }
.global-error { color: #9d4646; background: #fff1ef; border: 1px solid #f5d5d0; }
.global-notice { color: #36734f; background: #f1fbf4; border: 1px solid #d6efde; }
.global-error button, .global-notice button { display: grid; place-items: center; margin-left: auto; padding: 3px; color: inherit; border: 0; background: transparent; cursor: pointer; }
.welcome-row { min-height: 189px; position: relative; display: flex; align-items: center; justify-content: space-between; overflow: hidden; padding: 22px 33px; border: 1px solid #e5ecfa; border-radius: 13px; background: linear-gradient(110deg, #f8faff 0%, #f5f8ff 60%, #eef4ff 100%); }
.eyebrow { margin: 0 0 10px; color: #718de3; font-size: 9px; font-weight: 700; letter-spacing: 1.4px; }
.welcome-row h1 { margin: 0; font-size: 24px; letter-spacing: -.9px; font-weight: 700; color: #2e3b51; }
.welcome-row h1 span { color: #587ce5; }
.welcome-copy { margin: 10px 0 0; color: #8490a2; font-size: 11px; }
.welcome-illustration { width: 190px; height: 155px; position: relative; margin-right: 15px; }
.illus-back { position: absolute; width: 108px; height: 127px; top: 16px; left: 37px; border-radius: 8px; transform: rotate(12deg); background: #dfe9ff; }
.illus-sheet { position: absolute; top: 15px; left: 44px; width: 104px; height: 128px; padding: 25px 15px 10px; transform: rotate(-6deg); background: white; border: 1px solid #e9eef8; border-radius: 5px; box-shadow: 0 8px 20px #5877b321; }
.illus-sheet::before { content: ""; position: absolute; width: 30px; height: 5px; border-radius: 5px; top: 12px; left: 15px; background: #a3b8f5; }
.illus-sheet span { display: block; height: 3px; margin: 8px 0 0; background: #e4e9f2; border-radius: 5px; }
.illus-sheet span:nth-child(2) { width: 66%; }.illus-sheet span:nth-child(3) { margin-top: 16px; width: 86%; }.illus-sheet span:nth-child(4) { width: 54%; }
.illus-spark { position: absolute; top: 5px; right: 24px; color: #829deb; font-size: 25px; }
.illus-pencil { position: absolute; right: 22px; bottom: 20px; width: 8px; height: 64px; transform: rotate(42deg); border-radius: 5px; background: linear-gradient(#f3c874 0 78%, #5277e4 78%); box-shadow: 0 3px 8px #5375b62a; }
.section-heading { display: flex; align-items: end; justify-content: space-between; }
.section-heading h2 { margin: 0; color: #2e3c52; font-size: 14px; letter-spacing: -.25px; }
.section-heading p { margin: 5px 0 0; color: #96a0ae; font-size: 10px; }
.action-heading { margin: 27px 0 13px; }
.shortcut-hint { padding-bottom: 2px; color: #a2adbc; font-size: 9px; }
.action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.action-card { min-height: 117px; position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 15px 14px 12px; border: 1px solid #e7ecf3; border-radius: 10px; text-align: left; background: #fff; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; }
.action-card:hover:not(:disabled) { transform: translateY(-2px); border-color: #d3def3; box-shadow: 0 7px 18px #3a578312; }
.action-icon { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 9px; }
.photo-icon { background: #edf2ff; color: #577be4; }.ai-icon { background: #f2edff; color: #9172d4; }.pdf-icon { background: #eaf7f2; color: #5aa283; }.new-icon { background: #fff4e9; color: #d6964f; }
.action-copy { display: block; margin-top: 10px; }
.action-copy b, .action-copy small { display: block; }
.action-copy b { font-size: 11px; font-weight: 700; color: #34425a; }
.action-copy small { margin-top: 4px; color: #9aa5b5; font-size: 9px; white-space: nowrap; }
.action-arrow { position: absolute; top: 14px; right: 13px; color: #bec7d4; font-size: 14px; }
.card-tag { position: absolute; top: 17px; right: 12px; padding: 3px 6px; border-radius: 5px; color: #7189d9; background: #f1f4ff; font-size: 7px; letter-spacing: .3px; font-weight: 700; }
.recent-heading { margin: 29px 0 14px; }
.text-button { padding: 4px 0; color: #6984dc; font-size: 10px; border: 0; background: transparent; cursor: pointer; }
.text-button span { padding-left: 4px; }
.recent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.recent-card { overflow: hidden; padding: 0; border: 1px solid #e7ecf3; border-radius: 9px; text-align: left; background: #fff; cursor: pointer; transition: transform .16s, box-shadow .16s; }
.recent-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.recent-preview, .library-preview { position: relative; height: 92px; display: grid; place-items: center; overflow: hidden; }
.preview-0 { background: #eef4ff; }.preview-1 { background: #f1f6f2; }.preview-2 { background: #f7f2ff; }
.preview-paper { width: 92px; height: 72px; display: flex; flex-direction: column; gap: 7px; padding: 10px 11px; transform: rotate(-3deg); background: white; border: 1px solid #e9ecf1; box-shadow: 0 4px 10px #35456817; }
.preview-paper b { overflow: hidden; color: #68758a; font-size: 6px; white-space: nowrap; text-overflow: ellipsis; }
.preview-paper i { display: block; height: 2px; background: #e5e9f0; }
.preview-paper i:nth-child(3) { width: 80%; }.preview-paper i:nth-child(4) { width: 92%; }
.preview-type { position: absolute; bottom: 8px; right: 8px; display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 5px; color: #74839b; background: #fff; box-shadow: 0 2px 6px #25334b12; font-size: 8px; }
.recent-info { position: relative; padding: 10px 11px 11px; }
.recent-info b, .recent-info span, .recent-info small { display: block; }
.recent-info b { overflow: hidden; color: #39475d; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.recent-info span { margin-top: 5px; color: #8d99a9; font-size: 9px; }
.recent-info small { position: absolute; right: 11px; bottom: 12px; color: #a7b0bc; font-size: 8px; }
.recent-empty, .library-empty { min-height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px dashed #dfe6ef; border-radius: 10px; color: #9aa6b5; font-size: 10px; }
.recent-empty b, .library-empty b { margin-top: 6px; color: #647289; font-size: 11px; }
.empty-stack { position: relative; width: 38px; height: 35px; display: block; color: #9badd4; }
.empty-stack svg { position: absolute; width: 27px; height: 28px; padding: 4px; border: 1px solid #dce5f6; border-radius: 4px; background: #fff; }
.empty-stack svg:first-child { left: 10px; top: 0; }.empty-stack svg:nth-child(2) { left: 5px; top: 3px; }.empty-stack svg:last-child { left: 0; top: 6px; }
.template-heading { margin: 27px 0 12px; }
.template-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.template-card { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid #e7ecf3; border-radius: 8px; background: #fff; text-align: left; cursor: pointer; transition: border-color .16s; }
.template-card:hover { border-color: #c9d6f1; }
.template-icon { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: #6381d9; background: #eff3ff; }
.template-1 { color: #659879; background: #edf7f0; }.template-2 { color: #bb8b52; background: #fff5e9; }.template-3 { color: #9377c6; background: #f4efff; }
.template-card b, .template-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-card b { color: #57657a; font-size: 9px; }.template-card small { margin-top: 4px; color: #a0aaba; font-size: 8px; }
.template-plus { display: grid; place-items: center; margin-left: auto; color: #aab4c2; }
.home-footnote { display: flex; align-items: center; gap: 7px; margin-top: 21px; color: #9aa5b4; font-size: 9px; }
.home-footnote button { padding: 0; border: 0; color: #7089de; background: none; font-size: inherit; cursor: pointer; }
.privacy-shield { width: 15px; height: 15px; display: grid; place-items: center; border-radius: 5px; color: #68a180; background: #edf7f0; font-size: 9px; font-weight: 700; }

/* Worksheet editor */
.editor-topline { display: flex; justify-content: space-between; align-items: center; margin: 0 0 15px; }
.back-button { display: flex; align-items: center; gap: 6px; padding: 3px 0; border: 0; color: #7d8ba0; background: transparent; font-size: 10px; cursor: pointer; }
.autosave-mini { display: flex; align-items: center; gap: 7px; color: #8d9aab; font-size: 9px; }
.autosave-mini .status-dot { width: 6px; height: 6px; }
.editor-heading, .library-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 21px; }
.editor-heading .eyebrow, .library-heading .eyebrow, .ai-heading .eyebrow { margin-bottom: 7px; }
.editor-heading h1, .library-heading h1, .ai-heading h1 { margin: 0; color: #2d3b52; font-size: 23px; letter-spacing: -.6px; }
.editor-heading p:not(.eyebrow), .library-heading p:not(.eyebrow), .ai-heading > p:not(.eyebrow) { margin: 7px 0 0; color: #8d99aa; font-size: 10px; }
.editor-header-actions, .library-actions { display: flex; gap: 8px; }
.source-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 8px 12px; border: 1px solid #e5eaf7; border-radius: 8px; background: #fff; }
.source-banner img { width: 38px; height: 38px; object-fit: cover; border-radius: 5px; }
.source-banner b, .source-banner small { display: block; }.source-banner b { color: #4f5f78; font-size: 10px; }.source-banner small { margin-top: 4px; color: #9ba6b5; font-size: 9px; }.source-check { margin-left: auto; color: #63ad81; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 222px; align-items: start; gap: 16px; }
.worksheet-panel { min-width: 0; padding: 17px; border: 1px solid #e5eaf1; border-radius: 10px; background: #edf1f7; }
.worksheet-paper { position: relative; width: min(100%, 660px); min-height: 720px; margin: auto; padding: 39px 47px 50px; background: #fff; box-shadow: 0 2px 10px #36496512; }
.paper-header { padding-bottom: 15px; border-bottom: 1px solid #dce2eb; }
.worksheet-title { width: 100%; padding: 0; border: 0; color: #344156; font-size: 18px; font-weight: 700; text-align: center; background: transparent; }
.student-line { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin: 17px 0 10px; color: #657187; font-size: 9px; }
.student-line span { width: 100px; height: 14px; border-bottom: 1px solid #c8d0db; }
.paper-meta { display: flex; justify-content: center; align-items: center; gap: 7px; color: #b0b8c5; }
.paper-meta input { width: 82px; padding: 0; border: 0; color: #8793a5; font-size: 9px; text-align: center; background: transparent; }
.paper-meta input:first-child { width: 105px; }
.question-list { margin-top: 19px; }
.question-card { position: relative; display: flex; gap: 10px; padding: 10px 5px 16px 0; border-bottom: 1px solid #f0f2f6; }
.question-number { flex: 0 0 auto; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: #5576df; background: #eff3ff; font-size: 10px; font-weight: 700; }
.question-body { min-width: 0; flex: 1; }
.question-prompt { width: 100%; min-height: 39px; resize: vertical; padding: 3px 3px 7px; border: 0; color: #3d495b; background: transparent; font-size: 11px; line-height: 1.7; }
.question-prompt::placeholder { color: #c3cad4; }
.choices-list { display: grid; gap: 5px; margin: 3px 0 9px; }
.choices-list label { display: flex; gap: 6px; color: #68768b; font-size: 10px; }.choices-list input { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid #e8edf3; font-size: 10px; }
.answer-lines { display: grid; gap: 10px; margin: 7px 4px 0 0; }
.answer-lines span { height: 1px; background: #e7ebf1; }
.answer-edit { display: grid; gap: 6px; padding: 8px; border: 1px solid #e6ebf4; border-radius: 6px; background: #fbfcfe; }
.answer-edit label { display: grid; gap: 3px; color: #6781d3; font-size: 9px; }
.answer-edit textarea { resize: vertical; border: 1px solid #e7ecf3; border-radius: 4px; padding: 5px; color: #5c697d; background: white; font-size: 10px; }
.question-actions { display: flex; justify-content: flex-end; gap: 4px; margin-top: 4px; opacity: .16; transition: opacity .16s; }
.question-card:hover .question-actions, .question-actions:focus-within { opacity: 1; }
.question-actions button { width: 23px; height: 22px; display: grid; place-items: center; padding: 0; border: 1px solid #e7ebf2; border-radius: 5px; color: #8d99aa; background: #fff; cursor: pointer; }
.question-actions button:hover:not(:disabled) { color: #5879df; border-color: #d8e1f7; }
.add-question-button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 13px; padding: 8px; border: 1px dashed #cbd6e9; border-radius: 6px; color: #7189d8; background: #fbfcff; font-size: 10px; cursor: pointer; }
.add-question-button:hover { background: #f5f8ff; }
.paper-footer { position: absolute; right: 47px; bottom: 17px; color: #c2c9d3; font-size: 8px; }
.editor-settings { overflow: hidden; border: 1px solid #e5eaf1; border-radius: 9px; background: white; }
.settings-title { display: flex; align-items: center; gap: 8px; padding: 13px; border-bottom: 1px solid #edf0f5; color: #536177; font-size: 11px; }
.settings-title-icon { color: #778de0; }
.settings-block { padding: 13px; border-bottom: 1px solid #f0f2f6; }
.settings-block > b { display: block; color: #526078; font-size: 10px; }
.settings-block > p { margin: 5px 0 10px; color: #a0aaba; font-size: 8px; line-height: 1.5; }
.settings-block select, .form-field select, .form-field input { width: 100%; height: 34px; padding: 0 9px; border: 1px solid #e3e8f0; border-radius: 6px; color: #637086; outline: 0; background: #fff; font-size: 9px; }
.switch-row { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 7px 0 0; border: 0; color: #818da0; background: transparent; font-size: 9px; cursor: pointer; }
.switch-row i { width: 29px; height: 16px; position: relative; border-radius: 20px; background: #dfe4ec; transition: background .15s; }
.switch-row i::after { content: ""; position: absolute; width: 12px; height: 12px; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #28354b24; transition: transform .15s; }
.switch-on i { background: #6b89e8; }.switch-on i::after { transform: translateX(13px); }
.settings-info { display: flex; justify-content: space-between; margin-top: 8px; color: #9ba5b3; font-size: 9px; }.settings-info b { color: #66748a; font-weight: 600; }
.button-full { width: 100%; }
.print-preview-link { width: 100%; display: flex; align-items: center; gap: 8px; padding: 13px; border: 0; color: #6280db; background: #f9faff; font-size: 9px; cursor: pointer; }.print-preview-link span { margin-left: auto; }

/* AI generation */
.ai-heading { margin-bottom: 20px; }
.ai-layout { display: grid; grid-template-columns: minmax(0, 1fr) 248px; align-items: start; gap: 15px; }
.ai-form-card, .ai-side-note, .ai-preview { border: 1px solid #e6ebf3; border-radius: 10px; background: #fff; box-shadow: 0 2px 7px #263b5810; }
.ai-form-card { padding: 19px; }
.ai-card-title { display: flex; align-items: center; gap: 10px; padding-bottom: 15px; border-bottom: 1px solid #f0f2f6; }
.ai-title-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: #8269c1; background: #f3efff; }
.ai-card-title b, .ai-card-title small { display: block; }.ai-card-title b { color: #405068; font-size: 12px; }.ai-card-title small { margin-top: 4px; color: #a0aaba; font-size: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 17px 0; }
.form-field { display: grid; gap: 6px; color: #66748b; font-size: 9px; font-weight: 600; }.form-field input, .form-field select { font-size: 10px; font-weight: 400; }.form-field input::placeholder { color: #bcc4cf; }
.full-field { grid-column: 1 / -1; }
.answer-option { display: flex; align-items: center; gap: 9px; padding: 11px; border: 1px solid #e8edf3; border-radius: 7px; cursor: pointer; }
.answer-option input { position: absolute; opacity: 0; pointer-events: none; }
.custom-checkbox { width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid #d5dce7; border-radius: 4px; color: white; background: white; }
.answer-option-on .custom-checkbox { border-color: #6f8be4; background: #6f8be4; }
.answer-option b, .answer-option small { display: block; }.answer-option b { color: #637189; font-size: 9px; }.answer-option small { margin-top: 3px; color: #a1aaba; font-size: 8px; }
.generate-button { width: 100%; height: 40px; margin-top: 13px; font-size: 11px; }
.ai-privacy { display: flex; align-items: center; gap: 5px; margin: 10px 0 0; color: #9da8b7; font-size: 8px; }
.ai-side-note { padding: 20px 17px; background: linear-gradient(160deg, #fff, #f8f7ff); }
.ai-side-art { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 12px; color: #9474d3; background: #f0eaff; }
.ai-side-note h3 { margin: 14px 0 6px; color: #49566b; font-size: 12px; }.ai-side-note > p { margin: 0; color: #929eaf; font-size: 9px; line-height: 1.8; }
.ai-tip { display: flex; align-items: center; gap: 9px; margin-top: 17px; }.ai-tip > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #8471bf; background: #f0eaff; font-size: 8px; font-weight: 700; }.ai-tip b, .ai-tip small { display: block; }.ai-tip b { color: #667287; font-size: 9px; }.ai-tip small { margin-top: 3px; color: #a0aaba; font-size: 8px; }
.ai-preview { margin-top: 20px; padding: 18px; }.preview-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 13px; }.preview-heading .eyebrow { margin-bottom: 6px; }.preview-heading h2 { margin: 0; font-size: 15px; }.preview-heading h2 span { display: inline-grid; place-items: center; min-width: 21px; height: 20px; margin-left: 4px; border-radius: 10px; color: #657fda; background: #eff3ff; font-size: 9px; }.preview-heading p:not(.eyebrow) { margin: 5px 0 0; color: #9aa5b4; font-size: 9px; }.preview-heading > div:last-child { display: flex; gap: 7px; }
.generated-list { display: grid; gap: 7px; }.generated-question { display: flex; align-items: flex-start; gap: 10px; padding: 11px; border: 1px solid #edf0f5; border-radius: 7px; }.generated-number { color: #8196dc; font-size: 10px; font-weight: 700; }.generated-question > div { flex: 1; }.generated-question b { color: #536178; font-size: 10px; font-weight: 600; line-height: 1.7; }.generated-question small { display: block; margin-top: 5px; color: #96a1b0; font-size: 9px; }.generated-question .generated-answer { color: #cd7676; }.generated-format { padding: 4px 6px; border-radius: 4px; color: #7d8fba; background: #f3f5fa; font-size: 8px; white-space: nowrap; }
.spin { animation: spin 1s linear infinite; }@keyframes spin { to { transform: rotate(360deg); } }

/* PDF workspace */
.pdf-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }.pdf-toolbar h2 { margin: 0; color: #344157; font-size: 18px; }.pdf-toolbar p { margin: 5px 0 0; color: #8e9aab; font-size: 10px; }.toolbar-actions { display: flex; gap: 8px; }
.pdf-upload { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; padding: 14px; border: 1px dashed #cdd8e9; border-radius: 9px; background: #fbfcff; cursor: pointer; }.pdf-upload:hover { border-color: #95a9dc; background: #f7f9ff; }.upload-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: #6b85d6; background: #edf2ff; }.pdf-upload strong, .pdf-upload span:not(.upload-icon) { display: block; }.pdf-upload strong { color: #53637a; font-size: 10px; }.pdf-upload div > span { margin-top: 4px; color: #a0aaba; font-size: 9px; }.upload-limit { margin-left: auto; color: #9ba6b5; font-size: 9px; }
.inline-error { margin: 10px 0; padding: 10px 12px; border: 1px solid #f1d8d5; border-radius: 7px; color: #9d4c4a; background: #fff5f3; font-size: 10px; }
.pdf-empty { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: #a7b4c7; border: 1px solid #e8edf3; border-radius: 10px; background: #fff; }.pdf-empty strong { color: #65748b; font-size: 12px; }.pdf-empty span { color: #9ba6b4; font-size: 9px; }
.pdf-page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 13px; }.pdf-page-card { overflow: hidden; border: 1px solid #e6ebf2; border-radius: 8px; background: white; }.pdf-page-preview { height: 208px; display: grid; place-items: center; overflow: hidden; padding: 9px; background: #f0f3f8; }.pdf-page-preview img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 2px 7px #30445e1c; }.muted { color: #9aa7bb; }.pdf-page-meta { padding: 9px 10px 4px; }.pdf-page-meta span { display: block; color: #526178; font-size: 10px; font-weight: 700; }.pdf-page-meta small { display: block; overflow: hidden; margin-top: 4px; color: #9aa5b3; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }.pdf-page-actions { display: flex; gap: 4px; padding: 7px 9px 9px; }.pdf-page-actions button { flex: 1; height: 25px; display: grid; place-items: center; padding: 0; border: 1px solid #e8ecf2; border-radius: 5px; color: #8491a3; background: white; font-size: 12px; cursor: pointer; }.pdf-page-actions button:hover:not(:disabled) { color: #5f7cda; border-color: #d4def2; }.pdf-page-actions .danger-icon:hover:not(:disabled) { color: #c66666; border-color: #efdbd9; }.pdf-footnote { margin-top: 15px; color: #a0aab8; font-size: 9px; }

/* Project library */
.library-tools { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; color: #9aa5b3; font-size: 9px; }.search-box { width: min(300px, 55%); height: 35px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #e3e8ef; border-radius: 7px; color: #a0aaba; background: #fff; }.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; color: #526179; background: transparent; font-size: 10px; }.search-box input::placeholder { color: #aeb7c3; }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }.library-card { overflow: hidden; border: 1px solid #e6ebf2; border-radius: 9px; background: white; }.library-preview { width: 100%; height: 130px; border: 0; cursor: pointer; }.library-preview .preview-paper { width: 105px; height: 94px; padding: 14px; gap: 9px; }.library-card-info { padding: 11px; }.library-card-title { display: block; max-width: 100%; overflow: hidden; padding: 0; border: 0; color: #425169; background: none; font-size: 11px; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }.library-card-info > span, .library-card-info > small { display: block; margin-top: 5px; color: #8e9aac; font-size: 9px; }.library-card-info > small { color: #a4adba; font-size: 8px; }.library-card-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px solid #f0f2f6; }.library-card-actions button { display: inline-flex; align-items: center; gap: 5px; padding: 3px; border: 0; color: #6982d0; background: transparent; font-size: 9px; cursor: pointer; }.library-card-actions .delete-project { color: #a2aab6; }.library-empty { min-height: 245px; border-style: solid; background: #fff; }.library-empty .button { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media (max-width: 1120px) {
  .sidebar { width: 220px; }.main-area { margin-left: 220px; }.topbar { padding: 0 26px; }.content { padding: 28px 26px 35px; }.action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.action-card { min-height: 103px; }.template-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 7px 0 24px #1e32441a; }.sidebar-open { transform: translateX(0); }.main-area { margin-left: 0; }.topbar { height: 57px; padding: 0 18px; }.mobile-menu-button { display: grid; place-items: center; margin-right: 7px; color: #627087; }.breadcrumbs { margin-right: auto; }.content { padding: 22px 18px 30px; }.top-actions { gap: 12px; }.save-status { display: none; }.welcome-row { min-height: 165px; padding: 21px 23px; }.welcome-row h1 { max-width: 360px; font-size: 21px; }.welcome-illustration { width: 130px; transform: scale(.84); transform-origin: center right; margin-right: -6px; }.editor-layout { grid-template-columns: minmax(0, 1fr); }.editor-settings { display: grid; grid-template-columns: 1fr 1fr; }.settings-title { grid-column: 1 / -1; }.ai-layout { grid-template-columns: minmax(0, 1fr); }.ai-side-note { display: grid; grid-template-columns: 40px 1fr 1fr; align-items: center; gap: 7px 12px; }.ai-side-note h3 { margin: 0; }.ai-side-note > p { grid-column: 2 / -1; }.ai-tip { margin-top: 5px; }.library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.recent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .topbar { padding: 0 12px; }.breadcrumbs { gap: 6px; font-size: 10px; }.top-create { width: 34px; overflow: hidden; gap: 20px; padding: 0 8px; font-size: 0; }.top-create svg { flex: 0 0 auto; }.content { padding: 17px 13px 26px; }.welcome-row { min-height: 150px; padding: 18px 16px; }.welcome-row h1 { max-width: 270px; font-size: 18px; }.welcome-copy { max-width: 230px; font-size: 9px; line-height: 1.7; }.welcome-illustration { width: 84px; margin-right: -7px; transform: scale(.68); }.eyebrow { font-size: 8px; }.section-heading h2 { font-size: 13px; }.shortcut-hint { display: none; }.action-grid { gap: 8px; }.action-card { min-height: 108px; padding: 12px 10px; }.action-copy b { font-size: 10px; }.action-copy small { font-size: 8px; }.card-tag { top: 12px; right: 8px; font-size: 6px; }.recent-grid { grid-template-columns: 1fr; gap: 8px; }.recent-card { display: flex; align-items: center; min-height: 78px; }.recent-preview { flex: 0 0 98px; height: 78px; }.recent-info { flex: 1; }.recent-info small { position: static; margin-top: 5px; }.template-strip { grid-template-columns: 1fr 1fr; gap: 7px; }.template-card { gap: 6px; padding: 8px 6px; }.template-icon { width: 26px; height: 26px; }.template-card b { font-size: 8px; }.template-card small { font-size: 7px; }.template-plus { display: none; }.home-footnote { align-items: flex-start; line-height: 1.7; font-size: 8px; }
  .editor-heading, .library-heading { align-items: flex-start; gap: 12px; }.editor-heading h1, .library-heading h1, .ai-heading h1 { font-size: 19px; }.editor-heading p:not(.eyebrow), .library-heading p:not(.eyebrow) { max-width: 235px; line-height: 1.6; }.editor-header-actions { gap: 5px; }.editor-header-actions .button { padding: 0 8px; font-size: 9px; }.worksheet-panel { padding: 7px; }.worksheet-paper { min-height: 680px; padding: 30px 19px 42px; }.worksheet-title { font-size: 15px; }.student-line { font-size: 8px; }.student-line span { width: 75px; }.question-prompt { font-size: 10px; }.editor-settings { grid-template-columns: 1fr; }.settings-title { grid-column: auto; }.source-banner small { font-size: 8px; line-height: 1.5; }.library-heading { flex-direction: column; }.library-actions { width: 100%; }.library-actions .button { flex: 1; }.library-grid { gap: 8px; }.library-preview { height: 105px; }.library-card-info { padding: 9px; }.library-card-title { font-size: 9px; }.library-card-info > span { font-size: 8px; }.library-card-actions button { font-size: 8px; }.ai-form-card { padding: 13px; }.form-grid { gap: 10px 8px; }.ai-side-note { grid-template-columns: 36px 1fr; padding: 14px; }.ai-side-note > p { grid-column: 1 / -1; }.ai-tip { grid-column: span 1; }.ai-tip small { font-size: 7px; }.preview-heading { align-items: flex-start; gap: 10px; flex-direction: column; }.pdf-toolbar { align-items: flex-start; gap: 10px; flex-direction: column; }.toolbar-actions { width: 100%; }.toolbar-actions .button { flex: 1; }.upload-limit { display: none !important; }.pdf-page-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.pdf-page-preview { height: 170px; }.generated-format { display: none; }
}

@media print {
  @page { size: A4 portrait; margin: 15mm; }
  body, .app-shell, .main-area { margin: 0 !important; min-width: 0; background: #fff !important; }
  .sidebar, .topbar, .global-error, .global-notice, .editor-topline, .editor-heading, .source-banner, .editor-settings, .question-actions, .add-question-button, .autosave-mini { display: none !important; }
  .content { max-width: none; margin: 0; padding: 0; }
  .editor-layout { display: block; }
  .worksheet-panel { margin: 0; padding: 0; border: 0; background: white; }
  .worksheet-paper { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  .paper-header { break-inside: avoid; }
  .question-card { break-inside: avoid; padding-top: 13px; padding-bottom: 19px; }
  input, textarea { color: #182233 !important; }
  .answer-edit textarea { border-color: transparent; }
}

.pdf-annotation-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0 0 14px; padding: 9px; border: 1px solid #e6ebf2; border-radius: 8px; background: #fff; }
.pdf-tool-buttons { display: flex; flex-wrap: wrap; gap: 4px; padding-right: 7px; border-right: 1px solid #e8ecf1; }
.pdf-tool { min-height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 5px; color: #78869a; background: transparent; font-size: 9px; cursor: pointer; }
.pdf-tool:hover:not(:disabled) { color: #5879dc; background: #f4f6fd; }
.pdf-tool-active { color: #4c70df; border-color: #dce5fc; background: #eff3ff; font-weight: 700; }
.pdf-annotation-toolbar > label { display: inline-flex; align-items: center; gap: 5px; color: #7e8ba0; font-size: 9px; }
.pdf-annotation-toolbar input[type="color"] { width: 25px; height: 23px; padding: 1px; border: 1px solid #e5e9ef; border-radius: 4px; background: #fff; }
.pdf-annotation-toolbar input[type="range"] { width: 66px; accent-color: #5879df; }
.pdf-pages-count { margin: 0 0 10px; color: #8390a3; font-size: 9px; }
.pdf-page-preview { position: relative; width: 100%; height: 208px; display: grid; place-items: center; overflow: hidden; padding: 9px; border: 0; background: #f0f3f8; cursor: crosshair; }
.pdf-page-preview img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 2px 7px #30445e1c; }
.pdf-page-preview .pdf-annotation-layer { position: absolute; inset: 9px; width: calc(100% - 18px); height: calc(100% - 18px); object-fit: contain; touch-action: none; pointer-events: auto; }
.pdf-selected { border-color: #7893e7; box-shadow: 0 0 0 2px #8099e51f; }
.icon-glyph { width: 20px; display: inline-grid; place-items: center; font-size: 17px; line-height: 1; }
.pdf-tool[data-tool="text"]::after { content: "（ページ上でクリック）"; margin-left: 3px; color: #a1aaba; font-size: 7px; }
.pdf-empty .button { margin-top: 6px; }
.worksheet-paper[data-layout="1"] .paper-header { border-bottom: 3px double #778de0; }
.worksheet-paper[data-layout="2"] .question-number { border-radius: 4px; color: #fff; background: #6f91e7; }
.worksheet-paper[data-layout="4"] .question-card { padding-top: 17px; padding-bottom: 23px; }
.worksheet-paper[data-layout="5"] .question-card { min-height: 80px; }
.worksheet-paper[data-layout="6"] .question-prompt { font-weight: 600; }
.worksheet-paper[data-layout="7"] .answer-lines span { height: 1px; background: #abb9d0; }
.worksheet-paper[data-layout="8"] .answer-lines { gap: 19px; margin-top: 18px; }

.photo-progress { position: relative; margin: -5px 0 15px; padding: 12px 14px; border: 1px solid #e4eafb; border-radius: 9px; background: linear-gradient(110deg, #fff 0%, #fbfcff 100%); }
.photo-progress-heading { display: flex; align-items: center; gap: 9px; }
.photo-progress-icon { width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; color: #617edb; background: #edf2ff; font-size: 14px; font-weight: 700; }
.photo-progress b, .photo-progress small { display: block; }
.photo-progress b { color: #4a5870; font-size: 10px; }
.photo-progress-heading small { margin-top: 4px; color: #8d99aa; font-size: 9px; }
.photo-progress-count { margin-left: auto; color: #6b83d4; font-size: 10px; font-weight: 700; }
.photo-progress-track { position: relative; height: 6px; overflow: hidden; margin-top: 11px; border-radius: 8px; background: #edf0f6; }
.photo-progress-done { position: absolute; inset: 0 auto 0 0; z-index: 1; border-radius: inherit; background: linear-gradient(90deg, #6e91ee, #789dec); transition: width .25s ease; }
.photo-progress-active { position: absolute; top: 0; bottom: 0; z-index: 2; overflow: hidden; border-radius: 8px; background: #dce5ff; }
.photo-progress-active::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, #7d98e8 0 8px, #a5b8f1 8px 16px); background-size: 32px 100%; animation: photo-progress-stripes .8s linear infinite; }
@keyframes photo-progress-stripes { to { background-position: 32px 0; } }
.photo-progress-file { margin-top: 7px; overflow: hidden; color: #9aa5b4; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.photo-progress-dismiss { position: absolute; top: 12px; right: 12px; padding: 3px 7px; border: 1px solid #e2e8f0; border-radius: 5px; color: #738198; background: white; font-size: 8px; cursor: pointer; }
.photo-progress[aria-live="polite"] .photo-progress-active { transition: left .25s ease; }

@media print {
  .pdf-workspace { display: none !important; }
  .worksheet-paper[data-layout="1"] .paper-header { border-bottom: 3px double #778de0 !important; }
}
@media (max-width: 600px) {
  .pdf-annotation-toolbar { gap: 5px; padding: 7px; }
  .pdf-tool-buttons { width: 100%; padding-right: 0; border-right: 0; }
  .pdf-page-preview { height: 170px; }
  .pdf-page-preview .pdf-annotation-layer { inset: 9px; width: calc(100% - 18px); height: calc(100% - 18px); }
}
