.blank-page-dialog { width:min(900px, calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; padding:24px; border-radius:18px; }
.blank-page-heading { display:flex; align-items:center; gap:16px; margin-top:6px; flex-wrap:wrap; }
.blank-paper-button, .blank-template-button { border:1px solid var(--line); border-radius:10px; background:var(--brand-soft); color:var(--brand-strong); cursor:pointer; padding:10px 16px; font:inherit; }
.blank-page-content { grid-template-columns:minmax(0, 1.35fr) minmax(0, 1fr); gap:26px; margin:26px 0 22px; }
.blank-page-options { gap:16px; }
.blank-destination-storage { display:none; }
.blank-choice-options { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px; padding:0; margin:0; border:0; min-width:0; }
.blank-choice-options[hidden] { display:none; }
.blank-choice-options legend { color:var(--muted); font-size:13px; margin-bottom:10px; }
.blank-choice-options label { position:relative; cursor:pointer; }
.blank-choice-options input { position:absolute; opacity:0; width:1px; height:1px; }
.blank-choice-options span, .blank-page-dialog .blank-ratio-options span { display:grid; place-items:center; min-height:52px; border:1px solid var(--line); border-radius:12px; background:#fff; color:var(--brand-strong); font-weight:700; }
.blank-choice-options input:checked + span { border-color:var(--brand); box-shadow:inset 0 0 0 1px var(--brand); background:var(--brand-soft); }
.blank-choice-options input:disabled + span { opacity:.45; cursor:not-allowed; }
.blank-choice-options input:focus-visible + span, .blank-ratio-options input:focus-visible + span { outline:2px solid var(--brand); outline-offset:3px; }
.blank-size-options { grid-template-columns:repeat(3, minmax(0, 1fr)); }
.blank-page-dialog .blank-ratio-options legend { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.blank-page-dialog .blank-color-field { font-size:13px; grid-template-columns:minmax(0, 1fr) 46px 100px; margin-top:4px; }
.blank-page-dialog #blank-page-color { width:46px; height:40px; border:1px solid var(--line); border-radius:6px; background:#fff; cursor:pointer; }
.blank-page-dialog #blank-page-color-value { width:100%; height:40px; border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; color:var(--ink); padding:4px; font:600 14px monospace; box-sizing:border-box; }
.blank-page-dialog #blank-page-color-value[aria-invalid="true"] { border-color:var(--red); }
.blank-page-dialog .blank-color-presets { gap:14px; padding:4px; }
.blank-page-dialog .blank-color-presets button { width:36px; height:36px; cursor:pointer; }
.blank-page-dialog .blank-count-field { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.blank-count-stepper { display:flex; align-items:center; gap:8px; }
.blank-count-stepper button, .blank-page-dialog .blank-count-stepper input { width:44px; height:44px; min-height:44px; border:0; border-radius:12px; background:#f1f7f5; color:var(--brand-strong); padding:0; text-align:center; font:inherit; }
.blank-count-stepper button { font-size:24px; cursor:pointer; }
.blank-count-stepper button:disabled { opacity:.4; cursor:default; }
.blank-count-stepper input { appearance:textfield; -moz-appearance:textfield; }
.blank-count-stepper input::-webkit-inner-spin-button { appearance:none; }
.blank-template-button { display:flex; align-items:center; justify-content:space-between; text-align:left; border:0; }
.blank-template-button b { font-weight:400; }
.blank-template-button > span:last-child { font-size:26px; line-height:1; }
.blank-page-dialog .blank-page-preview-wrap { min-height:360px; align-content:start; padding:20px 16px; gap:18px; }
.blank-page-dialog .blank-page-preview { display:block; max-width:100%; box-shadow:0 5px 18px #24413a0d; }
.blank-page-dialog .blank-page-footer { align-items:center; }
.blank-page-dialog .blank-page-footer > span { text-align:left; }
.blank-page-dialog #blank-page-create { min-height:52px; padding:12px 22px; white-space:nowrap; }
#paper-template-modal { z-index:140; }
.paper-template-dialog { width:min(860px, calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; padding:24px; }
.paper-template-layout { display:grid; grid-template-columns:130px minmax(0, 1fr); gap:20px; margin-top:22px; }
#paper-template-categories { display:flex; flex-direction:column; gap:8px; }
#paper-template-categories button { border:0; border-radius:10px; padding:12px; background:transparent; color:var(--ink); cursor:pointer; text-align:left; font:inherit; }
#paper-template-categories button[aria-pressed="true"] { color:var(--brand-strong); background:var(--brand-soft); font-weight:700; }
.paper-template-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:14px; align-content:start; }
.paper-template-card { display:grid; justify-items:center; gap:10px; border:1px solid var(--line); border-radius:12px; background:#f2f6f5; padding:12px; color:var(--ink); cursor:pointer; font:inherit; }
.paper-template-card[aria-pressed="true"] { border-color:var(--brand); box-shadow:inset 0 0 0 1px var(--brand); background:var(--brand-soft); }
.paper-template-card canvas { width:100%; height:auto; max-width:110px; border:1px solid #b9c8c4; }
@media (max-width:680px) {
  .blank-page-dialog { padding:18px; }
  .blank-page-content { grid-template-columns:1fr; gap:18px; }
  .blank-page-dialog .blank-page-preview-wrap { min-height:0; }
  .blank-page-dialog .blank-page-footer { align-items:stretch; }
  .blank-page-heading { gap:10px; }
  .blank-page-dialog h2 { font-size:18px; }
  .paper-template-layout { grid-template-columns:1fr; }
  #paper-template-categories { flex-direction:row; flex-wrap:wrap; gap:4px; }
  #paper-template-categories button { padding:8px; font-size:13px; }
  .paper-template-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
