:root {
  --bg: #f7f6f2;
  --paper: #fff;
  --ink: #24231f;
  --muted: #8a8880;
  --line: #e9e7e0;
  --accent: #ef693d;
  --green: var(--accent);
  --green-dark: #d8552c;
  --pale: #f6f3ed;
  --orange: var(--accent);
  --soft-orange: #fff2e9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .35; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { transition: color .16s, background .16s, border-color .16s, box-shadow .16s, transform .16s; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #ef693d65; outline-offset: 4px; }
svg { width: 22px; height: 22px; flex-shrink: 0; }
[hidden] { display: none !important; }
p { line-height: 1.8; }
.header { max-width: 1376px; height: 86px; margin: auto; padding: 0 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 23px; font-weight: 780; letter-spacing: -.7px; }
.brand-icon { display: grid; place-items: center; width: 35px; height: 35px; background: var(--accent); color: #fff; border-radius: 50%; transform: rotate(-8deg); }
.brand-icon svg { width: 24px; height: 24px; }
.brand small { display: inline-block; font-size: 10px; letter-spacing: 2px; font-weight: 650; margin-left: 9px; vertical-align: middle; color: #77746e; }
.header-right { display: flex; align-items: center; gap: 30px; }
.privacy-pill { display: inline-flex; align-items: center; gap: 8px; color: #7c7972; font-size: 11px; }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.text-button { padding: 7px 0; border: 0; background: none; color: #827e75; font-size: 12px; line-height: 1.5; }
.text-button:hover:not(:disabled) { color: var(--ink); }
.app-shell { max-width: 1056px; padding: 28px 28px 0; margin: 0 auto; }
.intro { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 0 2px 38px; }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: 2px; margin-bottom: 9px; }
.intro .eyebrow { display: none; }
h1 { font-size: clamp(40px, 4.5vw, 64px); line-height: 1.2; letter-spacing: -3px; font-weight: 700; margin: 0 0 17px; }
h1 span { color: var(--accent); }
.intro p { margin: 0; font-size: 15px; letter-spacing: .3px; color: #8c8981; }
#demo-btn { background: none; border: 0; border-radius: 0; padding: 8px 0; min-height: 36px; font-size: 12px; color: #766f64; font-weight: 450; margin-bottom: 2px; }
#demo-btn:hover { color: var(--accent); transform: translateX(3px); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 40px; padding: 10px 17px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 550; line-height: 1.4; white-space: nowrap; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #291910; }
.button.primary:hover:not(:disabled) { background: #e95f32; border-color: #e95f32; transform: translateY(-1px); }
.button.light { background: transparent; border-color: #dedbd3; color: #625f57; }
.button.light:hover:not(:disabled) { background: #f0eee8; border-color: #ccc8bd; }
.button.soft { background: var(--ink); color: #fff; }
.button.soft:hover:not(:disabled) { background: #454139; }
.button.full { width: 100%; }
.button.small { min-height: 35px; padding: 8px 13px; font-size: 11px; }
.button svg { width: 16px; height: 16px; }
.workflow, .footer { display: none; }
.workspace-top { display: flex; justify-content: space-between; align-items: center; gap: 18px; min-height: 43px; padding: 0 2px; margin: 0 0 13px; }
.workspace-top > div { display: flex; align-items: center; gap: 12px; }
.workspace-top > div:last-child { gap: 20px; }
.workspace-label { color: #aaa293; font-size: 10px; letter-spacing: .5px; }
.tiny-square { display: inline-block; width: 5px; height: 5px; background: var(--accent); border-radius: 1px; }
.workspace-top .button { min-height: 31px; padding: 6px 10px; border-radius: 5px; background: none; border-color: transparent; color: #7a766d; font-size: 11px; font-weight: 450; }
.workspace-top .button:hover { background: #eae7df; color: #27251f; }
.workspace-top #open-categories { color: var(--ink); }
.template-label, .template-name, #current-template, #template-label { font-size: 11px; color: #918c81; line-height: 1.5; }
.workspace { background: #fff; border: 1px solid #eeece5; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 40px #39332604; }
.editor { padding: 28px 30px 23px; min-width: 0; }
.editor-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.editor h2 { font-size: 20px; line-height: 1.5; font-weight: 600; letter-spacing: -.4px; margin: 0 0 10px; }
.required-badge { display: inline-block; margin-left: 9px; padding: 2px 0; font-size: 9px; font-weight: 450; color: #b19b8d; vertical-align: middle; letter-spacing: 0; }
.quota-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { padding: 0; border: 0; color: #918c82; font-size: 11px; line-height: 1.5; }
.chip + .chip::before { content: '·'; margin-right: 8px; color: #c1bbb0; }
.chip.green { color: var(--accent); }
.material-note { font-size: 11px; line-height: 1.8; color: #9a958b; margin: 14px 0 20px; padding: 0; white-space: pre-line; max-height: 58px; overflow: auto; scrollbar-width: thin; }
details.material-note { max-height: none; overflow: visible; white-space: normal; margin: 13px 0 19px; }
details.material-note summary { width: fit-content; cursor: pointer; color: #a69b88; font-size: 10px; }
details.material-note summary:hover { color: #806d4e; }
details.material-note p { max-height: 150px; overflow: auto; white-space: pre-line; margin: 12px 0 0; padding: 0 0 0 10px; border-left: 2px solid #eee7d9; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 242px; padding: 24px; border: 1px dashed #d8d2c6; border-radius: 10px; background: #faf9f6; transition: background .2s, border-color .2s; }
.dropzone.dragover { background: #fff2e9; border-color: var(--accent); box-shadow: inset 0 0 0 1px #ef693d; }
.drop-illustration { height: 52px; width: 68px; position: relative; margin-bottom: 17px; }
.paper-back, .paper-front { position: absolute; width: 34px; height: 45px; border: 1px solid #d6d0c5; border-radius: 3px; background: #eae5db; left: 8px; top: 4px; transform: rotate(-11deg); }
.paper-front { left: 23px; top: 0; transform: rotate(8deg); background: #fff; display: flex; flex-direction: column; padding: 13px 7px; gap: 5px; box-shadow: 0 4px 8px #34302507; }
.paper-front i { height: 1px; width: 18px; background: #bcb4a8; }
.paper-front i:last-child { width: 11px; }
.paper-check { position: absolute; right: 0; bottom: 0; display: grid; place-items: center; height: 23px; width: 23px; border: 3px solid #faf9f6; border-radius: 50%; color: #fff; background: var(--accent); font-size: 14px; line-height: 1; }
.drop-title { margin: 0 0 8px; font-size: 16px; font-weight: 500; letter-spacing: -.2px; }
.drop-subtitle { margin: 0 0 19px; font-size: 11px; color: #a19b90; }
.dropzone .button.primary { min-height: 42px; padding-left: 22px; padding-right: 22px; }
.dropzone.compact { flex-direction: row; gap: 14px; margin-top: 19px; min-height: 72px; padding: 14px; }
.dropzone.compact .drop-illustration { display: none; }
.dropzone.compact .drop-title { font-size: 12px; color: #91897e; margin: 0; }
.dropzone.compact .button { min-height: 32px; padding: 7px 13px; font-size: 11px; }
.empty-hint { font-size: 10px; display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 18px; color: #a7a095; }
.hint-number { font-size: 17px; font-weight: 300; line-height: 1; color: #bab2a5; }
.empty-hint strong { font-size: 10px; font-weight: 450; color: #a49d92; }
.empty-hint p { display: none; }
.small-print { display: flex; align-items: center; justify-content: center; gap: 10px; color: #aaa497; font-size: 10px; line-height: 1.8; text-align: center; padding: 21px 0 27px; }
.small-print span + span::before { content: '·'; margin-right: 10px; color: #c5bfb3; }
.statusbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 2px 0; margin: 0; }
.status-summary strong { font-size: 11px; font-weight: 450; color: #777064; }
.status-summary small { display: block; font-size: 10px; color: #aba291; line-height: 1.7; margin-top: 5px; }
.status-actions { display: flex; gap: 8px; }
.status-actions .button { min-height: 36px; font-size: 11px; padding: 8px 14px; }
.progress-wrap { width: min(300px, 100%); }
.progress-wrap progress { display: block; width: 100%; height: 4px; accent-color: var(--accent); margin-top: 9px; }
.view-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 1px 0 19px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 24px; }
.tab { background: none; padding: 12px 0; border: 0; border-bottom: 2px solid transparent; color: #a49a8b; font-size: 12px; }
.tab.active { color: var(--ink); border-color: var(--accent); }
.tab em { margin-left: 4px; font-style: normal; color: #b2a99b; font-size: 10px; }
.page-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.page-card { min-width: 0; border: 0; border-radius: 6px; overflow: hidden; background: #fff; }
.page-thumb { position: relative; display: flex; align-items: center; justify-content: center; padding: 15px; width: 100%; height: 180px; border: 0; border-radius: 5px; background: #f4f2ed; cursor: zoom-in; }
.page-thumb:hover { background: #eeebe4; }
.page-thumb img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px #00000016); }
.page-index { position: absolute; top: 8px; left: 8px; display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 4px; background: #ffffffeb; color: #8d8272; font-size: 10px; }
.page-info { padding: 10px 1px 0; }
.page-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #686052; font-size: 11px; }
.page-meta { display: block; color: #ada393; font-size: 10px; line-height: 1.6; margin: 5px 0 8px; }
.page-actions { display: flex; justify-content: space-between; align-items: center; gap: 3px; }
.page-actions button { width: 30px; height: 28px; padding: 5px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: #908573; }
.page-actions button svg { width: 14px; height: 14px; }
.page-actions button:hover:not(:disabled) { background: #f2efe8; color: #342d23; }
.page-move { width: 100%; margin-top: 7px; padding: 6px 4px; border: 0; border-bottom: 1px solid #ece7dd; border-radius: 0; background: transparent; color: #a19582; font-size: 10px; }
.group-hint { margin-top: 17px; padding: 0; font-size: 11px; line-height: 1.8; color: #9a8c79; }
.group-hint b { font-weight: 550; color: #79684f; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.result-card { min-width: 0; border: 0; border-radius: 6px; overflow: hidden; }
.result-card .page-thumb { height: 230px; }
.result-info { padding: 13px 1px 0; }
.result-info strong { display: block; overflow-wrap: anywhere; color: #625746; font-size: 12px; font-weight: 500; line-height: 1.7; }
.result-info .size { display: block; font-size: 12px; color: #8e5939; margin: 8px 0; }
.result-info .size small { font-size: 10px; color: #aa9b86; }
.result-info .button { margin-top: 3px; }
.result-warnings { margin: 10px 0; padding: 10px 12px; border-radius: 5px; background: #fff3e8; color: #af7852; font-size: 11px; line-height: 1.8; }
.result-summary { font-size: 11px; line-height: 1.8; color: #9a8b75; margin-bottom: 17px; }
.empty-results { padding: 62px 20px; text-align: center; color: #a99d88; font-size: 13px; line-height: 2; }
.dialog { width: min(640px, calc(100vw - 40px)); max-height: 88vh; border: 1px solid #e8e3d9; border-radius: 16px; padding: 30px; overflow: auto; background: #fffefa; color: var(--ink); box-shadow: 0 25px 90px #2d251e26; }
dialog::backdrop { background: #211e1945; backdrop-filter: blur(5px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.dialog h2 { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: -.5px; line-height: 1.4; }
.dialog .eyebrow { margin-bottom: 8px; display: block; }
.icon-button { display: grid; place-items: center; border: 0; background: transparent; width: 32px; height: 32px; border-radius: 50%; font-size: 25px; font-weight: 300; color: #a1988b; }
.icon-button:hover { background: #f1ede5; color: #383127; }
.muted { color: #a29888; font-size: 12px; line-height: 1.8; }
.dialog textarea { display: block; width: 100%; resize: vertical; padding: 16px; min-height: 160px; border: 1px solid #e4ded3; border-radius: 7px; background: #faf8f2; color: #665a49; font-size: 12px; line-height: 1.9; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.parse-list { padding: 12px 0; max-height: 220px; overflow: auto; }
.parse-rule { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); color: #796c58; font-size: 11px; line-height: 1.5; }
.parse-rule span:last-child { white-space: nowrap; color: #ac8661; }
.parse-warnings { color: #b47c53; font-size: 11px; line-height: 1.8; }
.sidebar { padding: 0; border: 0; background: transparent; }
.sidebar-heading { display: flex; justify-content: space-between; align-items: center; margin: 0 0 16px; font-size: 14px; font-weight: 550; }
.counter { font-size: 11px; color: #a69a87; font-weight: 400; }
.template-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.template-bar select { width: 100%; padding: 11px 12px; border: 1px solid #e6dfd1; border-radius: 6px; background: #faf8f1; font-size: 12px; color: #7c6c52; }
#category-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.category { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 53px; padding: 11px 12px; border: 1px solid transparent; border-radius: 7px; background: transparent; text-align: left; font-size: 12px; line-height: 1.6; color: #8b7e68; }
.category:hover { background: #f5f0e7; }
.category.active { background: #fff0e5; border-color: #f5d6bd; color: #a34d28; }
.category-icon { flex: 0 0 20px; width: 20px; display: grid; place-items: center; color: #b3a48a; }
.category-icon svg { width: 17px; height: 17px; }
.category.active .category-icon { color: var(--accent); }
.category-name { flex: 1; min-width: 0; }
.category-check { font-size: 10px; color: #c0b29a; flex-shrink: 0; }
.category-check.done { color: #a56d48; }
.required-dot { color: var(--accent); font-size: 10px; margin-left: 4px; }


.sidebar-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: #b1a38c; font-size: 10px; line-height: 1.8; }
.sidebar-note p { margin: 0; }
.note-icon { font-size: 14px; }
.settings-dialog { width: min(530px, calc(100vw - 40px)); }
.settings-panel { padding: 0; border: 0; background: transparent; }
.settings-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; font-size: 13px; color: #77674f; font-weight: 550; }
.settings-title span { font-size: 10px; color: #b1a187; font-weight: 400; }
.settings-panel fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 7px; color: #918065; font-size: 11px; }
.field input:not([type=checkbox]), .field select { width: 100%; height: 39px; padding: 9px 11px; border: 1px solid #e4dbca; border-radius: 5px; background: #fffefa; color: #736044; font-size: 12px; }
.field input[type=checkbox] { accent-color: var(--accent); vertical-align: middle; }
.field small { display: block; font-size: 10px; line-height: 1.7; color: #b3a084; margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.input-with-unit { position: relative; }
.input-with-unit input { padding-right: 34px !important; }
.input-with-unit em { position: absolute; top: 12px; right: 11px; font-style: normal; font-size: 10px; color: #b4a080; }
.settings-note { padding: 13px 15px; margin-top: 6px; background: #f8f3e9; border-radius: 6px; color: #ac9674; font-size: 10px; line-height: 1.9; }
.settings-note strong { display: block; margin-bottom: 3px; color: #99815f; font-weight: 500; }
.settings-bottom { display: flex; justify-content: space-between; gap: 15px; padding-top: 15px; margin-top: 18px; border-top: 1px solid var(--line); }
.danger { color: #bd8467 !important; }
.preview-dialog { width: min(1150px, calc(100vw - 36px)); height: 90vh; max-width: none; border: 0; border-radius: 12px; padding: 0; color: var(--ink); overflow: hidden; background: #fffdfa; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 23px; border-bottom: 1px solid var(--line); }
.preview-head strong { display: block; overflow-wrap: anywhere; font-size: 13px; font-weight: 550; }
.preview-head small { display: block; margin-top: 5px; color: #aa997e; font-size: 10px; }
.preview-head > div:last-child { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.preview-content { height: calc(100% - 127px); overflow: auto; background: #eae6dc; padding: 25px; text-align: center; }
.preview-content img { display: inline-block; max-width: 100%; height: auto; box-shadow: 0 4px 20px #33281914; }
.preview-content.actual img { max-width: none; }
.preview-foot { padding: 14px 22px; color: #a28b67; font-size: 11px; line-height: 1.8; }
.help-list { padding-left: 22px; margin: 26px 0; }
.help-list li { padding-left: 7px; margin: 23px 0; color: var(--accent); }
.help-list strong { font-size: 13px; font-weight: 550; color: #756144; }
.help-list p { font-size: 12px; color: #a18b6a; margin: 7px 0; }
.local-info { font-size: 11px; line-height: 1.9; padding: 15px; background: #f8f1e5; color: #ac916a; border-radius: 6px; margin-bottom: 22px; }
.toast { position: fixed; bottom: 25px; left: 50%; z-index: 30; max-width: min(90vw, 700px); padding: 13px 21px; background: #322c23; color: #fff8e9; border-radius: 8px; box-shadow: 0 8px 24px #2d221b1f; font-size: 12px; line-height: 1.8; white-space: pre-line; opacity: 0; transform: translate(-50%, 12px); transition: .2s; pointer-events: none; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.inline-error { padding: 12px 14px; margin: 13px 0; border-radius: 6px; background: #fff0e7; color: #bc7852; font-size: 11px; line-height: 1.8; white-space: pre-line; }
.busy .workspace { opacity: .72; }
.busy .workspace button, .busy .workspace input, .busy .workspace select { pointer-events: none; }
.busy #editor { cursor: progress; }
@media (min-width: 1600px) {
  .app-shell { padding-top: 51px; }
  .intro { padding-bottom: 45px; }
  .dropzone { min-height: 270px; }
}
@media (max-width: 850px) {
  .header { height: 76px; padding: 0 28px; }
  .app-shell { padding-top: 25px; }
  .intro { padding-bottom: 28px; }
  h1 { font-size: 49px; letter-spacing: -2px; }
  .editor { padding: 24px; }
  .page-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-thumb { height: 170px; }
  .statusbar { align-items: flex-start; }
  .status-summary small { max-width: 260px; }
}
@media (max-width: 600px) {
  .header { height: 69px; padding: 0 20px; }
  .brand { font-size: 21px; gap: 8px; }
  .brand-icon { width: 30px; height: 30px; }
  .brand-icon svg { width: 20px; height: 20px; }
  .brand small { font-size: 8px; margin-left: 6px; }
  .header-right { gap: 0; }
  .header-right .privacy-pill { display: none; }
  .header-right .text-button { font-size: 11px; }
  .app-shell { padding: 25px 17px 0; }
  .intro { display: block; padding: 0 2px 22px; }
  h1 { font-size: clamp(36px, 9vw, 47px); letter-spacing: -2px; margin-bottom: 13px; }
  .intro p { font-size: 12px; letter-spacing: 0; }
  #demo-btn { margin-top: 12px; padding: 5px 0; font-size: 11px; min-height: 30px; }
  .workspace-top { margin-bottom: 8px; gap: 6px; min-height: 36px; }
  .workspace-top > div { gap: 5px; }
  .workspace-top > div:last-child { gap: 12px; }
  .workspace-label { font-size: 9px; }
  .tiny-square { display: none; }
  .workspace-top .button { padding: 7px 5px; font-size: 10px; min-height: 33px; }
  .workspace-top .text-button { font-size: 10px; }
  .template-label, .template-name, #current-template, #template-label { display: none; }
  .workspace { border-radius: 12px; }
  .editor { padding: 22px 18px 18px; }
  .editor-header { gap: 10px; }
  .editor h2 { font-size: 16px; line-height: 1.7; letter-spacing: -.3px; margin-bottom: 8px; }
  .editor-header .button { min-height: 34px; padding: 8px 10px; font-size: 10px; gap: 5px; }
  .editor-header .button svg { width: 13px; height: 13px; }
  .required-badge { font-size: 8px; margin-left: 6px; }
  .quota-chips { gap: 6px; }
  .chip { font-size: 10px; }
  .chip + .chip::before { margin-right: 6px; }
  .material-note { max-height: 58px; font-size: 10px; margin: 12px 0 17px; }
  .dropzone { min-height: 245px; padding: 23px 15px; border-radius: 7px; }
  .drop-title { font-size: 14px; }
  .drop-subtitle { font-size: 10px; max-width: 250px; line-height: 1.8; margin-bottom: 18px; }
  .dropzone .button.primary { min-height: 42px; font-size: 12px; }
  .empty-hint { margin-top: 16px; }
  .empty-hint strong { font-size: 9px; }
  .small-print { padding: 18px 0 24px; font-size: 9px; gap: 7px; flex-wrap: wrap; }
  .small-print span + span::before { margin-right: 7px; }
  .statusbar { flex-wrap: wrap; gap: 13px; padding-top: 17px; }
  .status-summary strong { font-size: 10px; }
  .status-summary small { font-size: 9px; max-width: none; }
  .status-actions { width: 100%; }
  .status-actions .button { flex: 1; min-height: 41px; font-size: 11px; }
  .page-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 12px; }
  .page-thumb { height: 157px; padding: 12px; }
  .page-name { font-size: 10px; }
  .page-meta { font-size: 9px; }
  .page-actions button { width: 29px; height: 31px; }
  .page-move { min-height: 32px; font-size: 9px; }
  .view-toolbar { gap: 8px; margin-bottom: 15px; }
  .tabs { gap: 18px; }
  .tab { font-size: 11px; }
  .view-toolbar .text-button { font-size: 10px; }
  .group-hint { font-size: 10px; }
  .dropzone.compact { gap: 8px; padding: 12px 8px; min-height: 67px; }
  .dropzone.compact .drop-title { font-size: 10px; }
  .dropzone.compact .button.primary { min-height: 35px; font-size: 10px; padding: 8px; }
  .result-grid { gap: 15px; }
  .result-card .page-thumb { height: 180px; }
  .result-info strong { font-size: 10px; }
  .result-info .size { font-size: 10px; }
  .result-info .size small { font-size: 9px; }
  .result-info .button { font-size: 10px; min-height: 35px; }
  .result-warnings { padding: 8px; font-size: 9px; }
  .dialog { width: calc(100vw - 24px); padding: 23px 20px; border-radius: 12px; max-height: 90vh; }
  .dialog h2 { font-size: 20px; }
  .dialog-head { margin-bottom: 17px; }
  .dialog textarea { padding: 13px; font-size: 11px; }
  .dialog-actions { gap: 7px; margin-top: 20px; }
  .dialog-actions .button { padding: 9px 11px; font-size: 11px; }
  .settings-dialog { width: calc(100vw - 24px); }
  #category-list { grid-template-columns: 1fr; gap: 4px; }
  .category { min-height: 45px; padding: 10px; font-size: 12px; }
  .template-bar { margin-bottom: 15px; }
  .sidebar-note { margin-top: 19px; padding-top: 15px; }
  .field-row { gap: 12px; }
  .field input:not([type=checkbox]), .field select { height: 42px; }
  .settings-title { margin-bottom: 18px; }
  .preview-dialog { width: calc(100vw - 18px); height: 91vh; border-radius: 9px; }
  .preview-head { padding: 12px; gap: 8px; }
  .preview-head strong { font-size: 11px; }
  .preview-head small { font-size: 9px; }
  .preview-head > div:last-child { gap: 3px; }
  .preview-head .button { font-size: 9px; padding: 8px; min-height: 32px; }
  .preview-head .icon-button { width: 27px; }
  .preview-content { height: calc(100% - 128px); padding: 14px; }
  .preview-foot { padding: 12px 14px; font-size: 10px; }
  .toast { font-size: 11px; padding: 12px 16px; bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Examples remain visibly separate from real materials. */





.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0 0 11px; padding: 12px 0; border-top: 1px solid #f0e9de; }
.demo-banner > div { display: flex; align-items: center; gap: 10px; font-size: 11px; color: #a28c73; }
.demo-badge { color: #b47d4b; font-size: 10px; padding: 3px 6px; border-radius: 4px; background: #f6eddf; white-space: nowrap; }
.demo-replace { display: inline-flex; align-items: center; gap: 5px; padding: 7px 0 7px 8px; border: 0; background: transparent; color: #bd5c32; font-size: 11px; white-space: nowrap; }
.demo-replace:hover { color: #8b391c; }
.demo-replace svg { width: 13px; height: 13px; }
.page-grid.demo-pages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) {
  .workspace-top { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }



  .workspace-top > .workspace-tools { justify-content: flex-end; width: 100%; gap: 18px; }
  .demo-banner { align-items: flex-start; gap: 9px; padding: 11px 0; }
  .demo-banner > div { align-items: flex-start; flex-direction: column; gap: 6px; font-size: 9px; }
  .demo-replace { font-size: 10px; padding-top: 5px; }
  .page-grid.demo-pages { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .demo-pages .page-thumb { height: 126px; padding: 8px; }
  .demo-pages .page-actions { gap: 0; }
  .demo-pages .page-actions button { width: 21px; min-width: 0; flex: 1; height: 28px; padding: 3px; }
  .demo-pages .page-actions button svg { width: 12px; height: 12px; }
  .demo-pages .page-name { font-size: 9px; }
  .demo-pages .page-meta { font-size: 8px; }
}

/* Material categories stay visible beside the editor. */
.app-shell { max-width: 1256px; }
.workspace { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: stretch; }
.material-sidebar { min-width: 0; padding: 24px 13px 20px; border-right: 1px solid #eee9df; background: #fcfbf7; }
.material-sidebar .sidebar-heading { margin: 0 9px 14px; font-size: 12px; font-weight: 550; color: #796d59; }
.material-sidebar .counter { font-size: 10px; color: #b2a690; }
.material-sidebar .template-bar { margin: 0 8px 15px; }
.material-sidebar .template-bar select { width: 100%; min-height: 34px; padding: 8px 9px; background: #fffefa; border-color: #e8dfcf; font-size: 10px; }
.material-sidebar #category-list { display: flex; flex-direction: column; gap: 3px; }
.material-sidebar .category { min-height: 43px; padding: 9px 9px; gap: 8px; font-size: 11px; line-height: 1.6; border-radius: 6px; color: #8d8069; }
.material-sidebar .category:hover { background: #f4eee3; color: #6c5c44; }
.material-sidebar .category.active { border-color: #efccb4; background: #fff0e4; color: #a24a25; box-shadow: inset 2px 0 0 var(--accent); }
.material-sidebar .category-icon { flex-basis: 18px; width: 18px; }
.material-sidebar .category-icon svg { width: 15px; height: 15px; }
.material-sidebar .category-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.material-sidebar .category-check { font-size: 9px; white-space: nowrap; }


.material-sidebar .sidebar-note { margin: 18px 9px 0; padding: 0; border: 0; font-size: 9px; color: #b9aa90; line-height: 1.8; }
.workspace-top > .workspace-tools { width: auto; }
@media (min-width: 721px) and (max-width: 1000px) {
  .workspace { grid-template-columns: 208px minmax(0, 1fr); }
  .material-sidebar { padding-left: 9px; padding-right: 9px; }
  .material-sidebar .category { padding-left: 7px; padding-right: 7px; gap: 6px; font-size: 10px; }
  .workspace .editor { padding: 24px 20px; }
  .workspace .page-grid:not(.demo-pages) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .workspace { display: flex; flex-direction: column; }
  .material-sidebar { padding: 18px 16px 17px; border-right: 0; border-bottom: 1px solid #eee7da; }
  .material-sidebar .sidebar-heading { margin: 0 0 12px; font-size: 12px; }
  .material-sidebar .template-bar { margin: 0 0 12px; }
  .material-sidebar .template-bar select { min-height: 35px; font-size: 11px; }
  .material-sidebar #category-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .material-sidebar .category { min-height: 44px; height: 100%; gap: 6px; padding: 8px; font-size: 10px; line-height: 1.55; background: #f8f4ed; }
  .material-sidebar .category.active { background: #ffecdc; }
  .material-sidebar .category-icon { width: 15px; flex-basis: 15px; }
  .material-sidebar .category-icon svg { width: 14px; height: 14px; }
  .material-sidebar .category-check { font-size: 8px; }

  .material-sidebar .sidebar-note { display: none; }
  .workspace-top { flex-wrap: nowrap; gap: 10px; }
  .workspace-top > .workspace-tools { width: auto; gap: 13px; }
}
/* Application types keep room for future tabs without adding extra actions. */
.application-tabs { display: flex; align-items: flex-end; gap: 14px; min-height: 43px; margin: 0 0 17px; padding: 0 2px; border-bottom: 1px solid #e6e0d4; }
.application-tab { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 100px; min-height: 43px; padding: 10px 17px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #9f9078; font-size: 13px; font-weight: 500; }
.application-tab.active { border-bottom-color: var(--accent); color: #9c4828; }
.application-tab.active::before { content: ''; position: absolute; inset: 4px 3px 7px; z-index: -1; border-radius: 5px; background: #fff0e5; }
.application-tab-slot { display: block; width: 83px; height: 29px; margin-bottom: 9px; border: 1px dashed #e2d9c9; border-radius: 5px; opacity: .65; }
@media (max-width: 720px) {
  .application-tabs { gap: 11px; margin-bottom: 13px; }
  .application-tab { min-width: 90px; padding-left: 12px; padding-right: 12px; font-size: 12px; }
  .application-tab-slot { width: 65px; height: 27px; }
}

/* Give importing files a generous, obvious drop target. */
.dropzone { min-height: 300px; padding: 30px 24px; }
.drop-illustration { display: block; width: 88px; height: 70px; margin-bottom: 19px; }
.paper-back, .paper-front { width: 44px; height: 58px; left: 10px; top: 7px; border-radius: 4px; }
.paper-front { left: 29px; top: 1px; padding: 17px 9px; gap: 7px; }
.paper-front i { width: 24px; height: 2px; }
.paper-front i:last-child { width: 15px; }
.paper-check { width: 30px; height: 30px; right: 1px; bottom: 0; border-width: 3px; font-size: 20px; }
.dropzone .button.primary { min-height: 50px; padding: 13px 25px; font-size: 14px; gap: 9px; }
.dropzone .button.primary svg { width: 23px; height: 23px; }
.dropzone.compact { min-height: 180px; padding: 14px 24px; margin-top: 21px; flex-direction: column; gap: 0; }
.dropzone.compact .drop-illustration { display: block; width: 88px; height: 58px; margin: 0 0 8px; }
.dropzone.compact .drop-title { font-size: 13px; margin: 0 0 10px; color: #8e8270; }
.dropzone.compact .button.primary { min-height: 50px; padding: 13px 25px; font-size: 14px; gap: 9px; }
@media (max-width: 720px) {
  .dropzone { min-height: 290px; padding: 27px 16px; }
  .dropzone.compact { min-height: 180px; padding: 14px 16px; }
  .dropzone.compact .drop-title { font-size: 12px; line-height: 1.6; }
  .dropzone .button.primary, .dropzone.compact .button.primary { min-height: 50px; max-width: 100%; padding: 12px 24px; font-size: 14px; }
  .dropzone .button.primary svg { width: 23px; height: 23px; }
}

/* Emphasize the one-step mixed-format workflow. */
.intro h1 { font-size: clamp(31px, 4.1vw, 50px); }
.intro .hero-promise { font-size: 17px; color: #5b5449; letter-spacing: .1px; }
@media (max-width: 720px) {
  .intro { flex-wrap: wrap; }
  .intro h1 { font-size: clamp(29px, 5.6vw, 39px); }
  .intro .hero-promise { font-size: 14px; }
  .intro .demo-button { margin-top: 0; }
}
@media (max-width: 430px) {
  .intro h1 span { display: block; }
}
/* Keep the header compact and the upload area ahead of the sample pages. */
.header { height: 62px; }
.app-shell { padding-top: 12px; }
.intro { align-items: center; gap: 18px; padding: 0 2px 14px; }
.intro h1 { font-size: clamp(32px, 3vw, 38px); line-height: 1.3; letter-spacing: -1.2px; margin: 0 0 7px; }
.intro p, .intro .hero-promise { font-size: 13px; line-height: 1.7; margin: 0; }
#demo-btn { margin-top: 0; margin-bottom: 0; min-height: 32px; }
.application-tabs { min-height: 37px; margin-bottom: 10px; }
.application-tab { min-height: 37px; padding: 7px 15px 9px; }
.application-tab-slot { height: 24px; margin-bottom: 7px; }
.workspace-top { justify-content: flex-end; min-height: 30px; margin-bottom: 8px; gap: 14px; }
.workspace-top > .workspace-tools { min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 8px 18px; }
.workspace .editor { padding: 20px 24px 21px; }
.editor-header { gap: 14px; }
.editor h2 { font-size: 18px; line-height: 1.45; margin-bottom: 7px; }
.material-note, details.material-note { margin: 9px 0 12px; }
.dropzone.compact { margin-top: 0; margin-bottom: 16px; }
@media (max-width: 720px) {
  .header { height: 58px; }
  .app-shell { padding-top: 10px; }
  .intro { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 5px 12px; padding-bottom: 10px; }
  .intro > div { flex: 1 1 100%; }
  .intro h1 { font-size: clamp(30px, 5.2vw, 36px); line-height: 1.3; letter-spacing: -1px; margin-bottom: 5px; }
  .intro p, .intro .hero-promise { font-size: 12px; }
  #demo-btn { min-height: 27px; padding: 4px 0; }
  .application-tabs { margin-bottom: 8px; min-height: 36px; }
  .application-tab { min-height: 36px; }
  .workspace-top { gap: 12px; margin-bottom: 10px; align-items: center; }
  .workspace-top > .workspace-tools { gap: 4px 12px; }
  .workspace-top .workspace-tools .text-button { font-size: 10px; line-height: 1.5; }
  .workspace .editor { padding: 18px 18px 19px; }
  .editor h2 { font-size: 16px; }
  .dropzone.compact { margin-top: 0; margin-bottom: 16px; }
}
@media (max-width: 380px) {
  .workspace-top { gap: 8px; }
  .workspace-top > .workspace-tools { flex: 1; gap: 3px 9px; }
}
/* Upload limits and submission requirements are primary information. */
.editor .required-badge { padding: 2px 7px; border-radius: 4px; background: #fff0e4; color: #9b4522; font-size: 12px; font-weight: 600; line-height: 1.5; }
.quota-chips { gap: 8px; margin-top: 3px; }
.quota-chips .chip { display: inline-flex; align-items: center; min-height: 31px; padding: 5px 10px; border: 1px solid #dbe4e9; border-radius: 5px; background: #eef3f6; color: #365365; font-size: 13px; font-weight: 550; line-height: 1.5; }
.quota-chips .chip:first-child { border-color: #efccb4; background: #fff0e4; color: #9b4522; font-weight: 650; }
.quota-chips .chip + .chip::before { content: none; margin: 0; }
details.material-note { margin: 12px 0 14px; padding: 12px 14px; border: 1px solid #eee1d2; border-radius: 6px; background: #faf4ec; color: #594a39; font-size: 14px; line-height: 1.8; max-height: none; overflow: visible; }
details.material-note summary { width: fit-content; font-size: 14px; font-weight: 650; line-height: 1.7; color: #62472f; }
details.material-note summary:hover { color: #9b4522; }
details.material-note p { max-height: none; overflow: visible; margin: 8px 0 0; padding: 0; border-left: 0; color: #594a39; font-size: 14px; font-weight: 400; line-height: 1.8; white-space: pre-line; }
@media (max-width: 720px) {
  .quota-chips { gap: 6px; }
  .quota-chips .chip { min-height: 30px; padding: 5px 8px; font-size: 12px; }
  details.material-note { margin: 11px 0 13px; padding: 11px 12px; font-size: 13px; }
  details.material-note summary { font-size: 13px; }
  details.material-note p { font-size: 13px; line-height: 1.8; }
}

/* Keep supported formats visible in both empty and sample-filled upload areas. */
.dropzone .drop-title, .dropzone.compact .drop-title { margin: 0 0 9px; color: #493d30; font-size: 15px; font-weight: 600; line-height: 1.6; }
.dropzone .drop-subtitle, .dropzone.compact .drop-subtitle { display: block; max-width: none; margin: 0 0 15px; color: #655544; font-size: 13px; line-height: 1.8; }
.drop-input-note { display: block; margin: 0 0 7px; color: #2f654c; font-size: 14px; font-weight: 650; }
.drop-formats { display: block; color: #914523; font-size: 14px; font-weight: 600; }
.drop-mixed { display: block; margin-top: 2px; }
@media (max-width: 720px) {
  .dropzone .drop-title, .dropzone.compact .drop-title { font-size: 14px; }
  .dropzone .drop-subtitle, .dropzone.compact .drop-subtitle { font-size: 12px; }
  .drop-formats, .drop-input-note { font-size: 13px; }
}

/* Make the processing action explicit and easy to find. */
.editor-header > div { min-width: 0; flex: 1; }
.editor-header .generate-button { flex: 0 0 auto; min-height: 50px; padding: 13px 22px; font-size: 16px; font-weight: 650; gap: 9px; border-radius: 8px; box-shadow: 0 3px 10px #ef693d18; }
.editor-header .generate-button svg { width: 21px; height: 21px; }
@media (max-width: 720px) {
  .editor-header { flex-wrap: wrap; }
  .editor-header > div { flex-basis: 100%; }
  .editor-header .generate-button { width: 100%; min-height: 50px; font-size: 15px; padding: 13px 18px; }
}
