/* Application surfaces only. Artwork and inline text retain document styling. */
:root{font-size:16px;--ui-bg:#edf0f5;--ui-panel:#fff;--ui-rail:#f7f8fb;--ui-input:#f4f6fa;--ui-text:#232838;--ui-muted:#667084;--ui-line:#dfe4ee;--ui-accent:#6c5ce7;--ui-active:#eeeaff;--navy:var(--ui-text);--border:var(--ui-line);--muted:var(--ui-muted);font-family:'Pretendard','Malgun Gothic',sans-serif}
:root[data-theme=dark]{--ui-bg:#15171d;--ui-panel:#20232c;--ui-rail:#191c24;--ui-input:#2a2e39;--ui-text:#eef0f7;--ui-muted:#a8afc2;--ui-line:#363c4b;--ui-accent:#aa9dff;--ui-active:#39324f;--navy:var(--ui-text);--border:var(--ui-line);--muted:var(--ui-muted);background:var(--ui-bg);color:var(--ui-text)}
html[data-theme] .editor-header,html[data-theme] .setup-panel,html[data-theme] dialog{background:var(--ui-panel);color:var(--ui-text)}
html[data-theme] button,html[data-theme] input,html[data-theme] select,html[data-theme] textarea:not(.inline-text-editor){background:var(--ui-input);color:var(--ui-text);border-color:var(--ui-line);border-radius:9px;min-height:42px;font-size:14px}
html[data-theme] button{transition:background .15s,border-color .15s,box-shadow .15s;font-weight:550}
html[data-theme] button:hover{background:var(--ui-active);border-color:var(--ui-accent)}
html[data-theme] input,html[data-theme] select,html[data-theme] textarea:not(.inline-text-editor){font-size:16px}
html[data-theme] label{font-size:14px;gap:8px;color:var(--ui-muted)}
html[data-theme] input[type=checkbox]{min-height:18px;accent-color:var(--ui-accent)}
html[data-theme] button:focus-visible,html[data-theme] input:focus-visible,html[data-theme] select:focus-visible,html[data-theme] summary:focus-visible{outline:2px solid var(--ui-accent);outline-offset:3px}
.editor-header{height:76px;min-height:76px;padding:12px 24px;gap:24px;border-bottom:1px solid var(--ui-line)}
.brand{gap:10px;font-size:16px;letter-spacing:-.04em}
html[data-theme] .brand-symbol{background:#7261d9;color:#fff;width:38px;height:38px;border-radius:12px;font-size:27px;box-shadow:inset 0 1px 0 #ffffff30}
.brand small{display:block;font-size:10px;letter-spacing:.13em;color:var(--ui-muted);margin-top:4px}
.document-title{border-left:1px solid var(--ui-line);padding-left:22px}
.document-title input{background:transparent!important;border-color:transparent!important;width:min(23vw,300px);max-width:300px;font-size:15px;min-height:28px;padding:1px 4px}
.document-title input:focus{background:var(--ui-input)!important}
.document-title span{font-size:12px;color:var(--ui-muted);padding-left:4px;margin-top:4px}
.header-actions{gap:8px;align-items:center}
.header-actions button{padding:10px 14px;white-space:nowrap}
html[data-theme] .header-actions .primary,html[data-theme] .primary{background:#8b78ef;color:#fff;border-color:#8b78ef;font-weight:650;box-shadow:0 3px 10px #0002}
html[data-theme] .primary:hover{background:#7763dc;border-color:#aa9dff}
#open-shortcuts,#theme-toggle{background:transparent;border-color:transparent;color:var(--ui-muted)}
.editor-layout{grid-template-columns:380px minmax(0,1fr);height:calc(100dvh - 76px);min-height:560px}
.setup-panel{padding-left:76px;scrollbar-color:var(--ui-line) transparent;border-right:1px solid var(--ui-line)}
html[data-theme] .panel-tabs{top:76px;width:76px;background:var(--ui-rail);border-color:var(--ui-line);padding:12px 8px;gap:5px}
html[data-theme] .panel-tabs button{border:0;border-radius:11px;background:transparent;color:var(--ui-muted);height:64px;min-height:64px;padding:8px 0;font-size:12px;box-shadow:none}
html[data-theme] .panel-tabs button:hover{background:var(--ui-input);color:var(--ui-text)}
html[data-theme] .panel-tabs button[aria-pressed=true]{background:var(--ui-active);color:var(--ui-accent);box-shadow:none}
.panel-tabs b{display:flex;align-items:center;justify-content:center;height:24px;margin:0 0 6px;font-size:22px}
.panel-tabs svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.panel-section{padding:24px 20px}
.panel-section h2{font-size:17px;font-weight:650;letter-spacing:-.035em;margin-bottom:20px}
.panel-section h3{font-size:15px}
html[data-theme] .section-heading>span,html[data-theme] .library-heading>span{font-size:12px;background:var(--ui-input);color:var(--ui-muted);padding:4px 9px;border-radius:20px}
html[data-theme] .workspace{padding:16px 28px 14px;background-color:var(--ui-bg);background-image:radial-gradient(#858ca023 .7px,transparent .7px);background-size:18px 18px}
.workspace-toolbar{padding:9px 12px;border:1px solid var(--ui-line);border-radius:13px;background:var(--ui-panel);box-shadow:0 5px 20px #0000000a;margin-bottom:14px;min-height:58px}
.workspace-toolbar button{background:transparent;border-color:transparent;min-height:36px}
.workspace-toolbar .guide-toggle{font-size:14px}
.toolbar-divider{background:var(--ui-line)}
.zoom-buttons output{font-size:13px;color:var(--ui-muted)}
.spread-info{margin:0 0 10px;gap:8px;justify-content:center}
html[data-theme] .spread-info button{border:0;background:transparent;font-size:12px;color:var(--ui-muted);padding:5px 12px;min-height:30px;border-radius:20px}
html[data-theme] .spread-info button:hover{background:var(--ui-active);color:var(--ui-accent)}
.canvas-scroll{padding:16px 10px 22px}
html[data-theme] #cover-canvas{outline:1px solid #a2a8b280;outline-offset:5px;box-shadow:0 15px 50px #0005;background:#fff}
html[data-theme] .canvas-footer,html[data-theme] .status,html[data-theme] .gesture-help,html[data-theme] .check-strip p,html[data-theme] .check-strip summary{font-size:12px;color:var(--ui-muted)}
.canvas-footer{padding-top:14px;line-height:1.6}
.gesture-help{max-width:760px;margin:0 auto;line-height:1.6;padding:4px 0 8px}
.status{padding:8px 0 0;min-height:28px;border-top:1px solid var(--ui-line);margin-top:8px}
html[data-theme] .template-card{border-radius:12px;border:1px solid var(--ui-line);background:var(--ui-input)}
html[data-theme] .template-card #template-art{padding:24px 18px;background:var(--ui-bg)}
.template-description{padding:16px}.template-description strong{font-size:16px}
html[data-theme] .template-description>span,html[data-theme] .template-help,html[data-theme] .library-intro{font-size:13px;color:var(--ui-muted);line-height:1.65}
html[data-theme] .template-description>b{color:var(--ui-accent);border-color:var(--ui-line);font-size:14px;padding-top:14px}
html[data-theme] .upload-photo,html[data-theme] #edit-on-canvas{background:var(--ui-active);border:1px solid var(--ui-line);color:var(--ui-accent);min-height:46px}
.asset-kinds{background:var(--ui-bg);padding:4px;gap:3px;border-radius:11px}
html[data-theme] .asset-kinds button{background:transparent;border-color:transparent;font-size:13px;border-radius:8px;min-height:40px}
html[data-theme] .asset-kinds button[aria-pressed=true]{background:var(--ui-panel);color:var(--ui-accent);border-color:var(--ui-line);box-shadow:0 2px 5px #0002}
html[data-theme] .photo-topics button,html[data-theme] .shape-grid button{background:var(--ui-input);border-color:var(--ui-line);color:var(--ui-muted);border-radius:10px;font-size:13px}
html[data-theme] .photo-topics button:hover,html[data-theme] .photo-topics button[aria-pressed=true],html[data-theme] .shape-grid button:hover{background:var(--ui-active);border-color:var(--ui-accent);color:var(--ui-accent);box-shadow:none}
.photo-topics{gap:8px}.photo-topics button{min-height:42px}.photo-topics button>span{font-size:16px}
html[data-theme] .topic-heading strong{font-size:14px;color:var(--ui-text)}.topic-heading>span{font-size:12px;color:var(--ui-muted)}
.photo-results{gap:18px 12px}.photo-results button{height:128px;border-radius:10px}
html[data-theme] .photo-results button{background:var(--ui-bg)}
html[data-theme] .asset-caption{font-size:13px;color:var(--ui-text);margin-top:9px}
html[data-theme] .photo-results a{font-size:12px;color:var(--ui-muted)}
html[data-theme] #photo-status,html[data-theme] .asset-rights,html[data-theme] .photo-license,html[data-theme] .photo-empty-note{font-size:12px;color:var(--ui-muted)}
html[data-theme] .shape-filter button{font-size:13px;padding:6px 12px;min-height:34px;background:var(--ui-input);color:var(--ui-muted)}
html[data-theme] .shape-filter button[aria-pressed=true]{background:var(--ui-active);color:var(--ui-accent)}
.shape-grid{gap:10px}.shape-grid button{padding:18px 5px 12px}.shape-grid svg{width:32px;height:32px}
html[data-theme] .shape-grid button span{font-size:12px;letter-spacing:0;color:var(--ui-muted)}
html[data-theme] #shape-search{font-size:16px;background:var(--ui-input);border-color:var(--ui-line)}
.selection-section .field-pair{gap:12px}.selection-section .field-pair button{font-size:13px;min-height:40px}
html[data-theme] .selection-label{color:var(--ui-accent);font-size:13px;margin-bottom:16px}
html[data-theme] .font-preview{background:var(--ui-bg);color:var(--ui-text);border-color:var(--ui-line);padding:16px;border-radius:10px;font-size:24px;line-height:1.6}
html[data-theme] .font-status,html[data-theme] .font-credit,html[data-theme] .stack-hint{font-size:12px;color:var(--ui-muted);line-height:1.6}
.precise-controls summary{font-size:14px!important;padding:4px 0}
html[data-theme] .delete-button{font-size:13px;color:#dc8793;background:transparent;border-color:var(--ui-line)}
html[data-theme] .layers button{border-radius:9px;background:transparent;color:var(--ui-text);padding:12px 10px;min-height:58px}
html[data-theme] .layers button[aria-pressed=true]{background:var(--ui-active);border-color:var(--ui-accent)}
.layer-icon{display:grid;place-items:center;background:var(--ui-input);border-radius:6px;width:30px;height:32px;color:var(--ui-muted)}
.layer-text{font-size:14px}.layers small,.layer-help{font-size:12px}
html[data-theme] dialog{border:1px solid var(--ui-line);border-radius:18px;box-shadow:0 32px 100px #0007}
dialog::backdrop{background:#0b0c14b8;backdrop-filter:blur(4px)}
html[data-theme] .ai-tools button{background:var(--ui-input);border-color:var(--ui-line);border-radius:12px;padding:15px}
html[data-theme] .ai-tools strong{color:var(--ui-text)}
@media(min-width:681px) and (max-width:1100px){.editor-layout{grid-template-columns:330px minmax(0,1fr)}.setup-panel{padding-left:68px}html[data-theme] .panel-tabs{width:68px}.panel-section{padding:20px 16px}.editor-header{padding-inline:16px;gap:16px}.brand small{display:none}.document-title{padding-left:12px}.document-title input{width:17vw}.header-actions button{padding-inline:10px}html[data-theme] .workspace{padding-inline:18px}.photo-results button{height:110px}}
@media(max-width:680px){
 .editor-header{height:auto;min-height:124px;flex-wrap:wrap;padding:12px;gap:10px}.brand small{display:none}.brand-symbol{width:32px;height:32px}.document-title{padding-left:12px}.document-title input{width:100%;font-size:14px}.document-title span{font-size:12px}
 .header-actions{width:100%;display:flex;gap:5px;overflow-x:auto}.header-actions button{padding:8px 6px;font-size:12px;min-height:40px;flex:0 0 auto}#open-shortcuts{margin-right:auto}
 .editor-layout{display:flex;height:auto;min-height:0}.setup-panel{padding:72px 0 0;border:0}
 html[data-theme] .panel-tabs{position:absolute;top:0;left:0;bottom:auto;width:100%;height:72px;padding:5px 6px;display:flex;flex-direction:row;overflow-x:auto;gap:4px;border-bottom:1px solid var(--ui-line)}
 html[data-theme] .panel-tabs button{min-width:62px;flex:1 0 62px;height:60px;min-height:60px;font-size:12px;padding:7px 0}.panel-tabs b{margin-bottom:4px}
 .panel-section{padding:18px 16px;max-height:300px}.panel-section.selection-section{max-height:360px}.panel-section h2{font-size:16px;margin-bottom:14px}
 html[data-theme] .workspace{padding:12px;min-height:440px;height:calc(100dvh - 170px)}.workspace-toolbar{padding:6px 8px;min-height:48px;margin-bottom:8px}.canvas-scroll{padding:12px 6px;min-height:160px}
 .spread-info{margin-bottom:0}.spread-info button{font-size:12px}.canvas-footer{font-size:12px}.gesture-help{display:none}
 .photo-results{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 8px}.photo-results button{height:100px}.photo-topics{grid-template-columns:repeat(3,minmax(0,1fr))}.shape-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .template-card{max-width:230px}.template-description{padding:12px}.template-card #template-art{padding:12px!important}
}
@media(prefers-reduced-motion:reduce){html[data-theme] button{transition:none}}

@media(max-width:680px){.workspace-toolbar{flex-wrap:wrap;gap:6px}.history-buttons,.zoom-buttons{gap:3px;flex-shrink:0}.workspace-toolbar button{padding:6px 8px;min-width:32px;white-space:nowrap}.guide-toggle{white-space:nowrap;flex-shrink:0}.toolbar-divider{margin-inline:4px}#canvas-stage{margin-block:0!important}}

html[data-theme] .spine-footer-button{width:100%;min-height:44px;margin-top:14px;padding:10px 12px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-active);color:var(--ui-accent);font-size:14px}

/* Card faces are separate sheets, with no spine legend or book-only gestures. */
body[data-design-kind="card"] .legend span:has(.fold) {display:none}
.spread-info [aria-pressed="true"] {color:#d9f26f;border-color:currentColor}
#last-export-download {display:block;margin:12px 0;color:#508df5;text-decoration:underline}
#card-start {margin-top:14px}
#card-start .apply-button {width:100%;margin-top:14px}
#preview-art section {margin-bottom:16px}

#card-template-gallery{margin-top:24px}#card-template-gallery h3{font-size:15px;margin:0 0 8px}
.card-template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px}
html[data-theme] .card-template-choice{display:flex;flex-direction:column;text-align:left;gap:7px;padding:8px;min-width:0;border:1px solid var(--ui-line);background:var(--ui-input);color:var(--ui-text);border-radius:10px}
.card-template-choice:focus-visible{outline:2px solid var(--ui-accent);outline-offset:3px}
.card-template-preview{display:block;width:100%;aspect-ratio:100/148;overflow:hidden;border-radius:4px}.card-template-preview svg{display:block;width:100%;height:100%}
.card-template-choice strong{font-size:13px}.card-template-caption{font-size:11px;line-height:1.5;color:var(--ui-muted)}
.card-template-filters{display:grid;grid-template-columns:minmax(0,1fr) 100px;gap:8px;margin:14px 0}
.card-template-filters input,.card-template-filters select{min-width:0;width:100%}
.template-pagination{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:14px 0;font-size:12px}
.template-pagination button{padding:8px 12px}
#card-batch-dialog{width:min(820px,calc(100vw - 24px));max-height:90dvh;overflow:auto;padding:24px}
#card-batch-dialog h2{margin-top:0}#card-batch-dialog>label{display:flex;align-items:center;gap:8px;margin:14px 0}
#card-batch-dialog input[type=checkbox]{width:18px;height:18px;flex:0 0 18px;margin-right:8px}
.batch-choice-columns{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:18px}
.batch-choice-columns h3{font-size:15px}.batch-select-actions{display:flex;gap:8px;margin-bottom:8px}.batch-select-actions button{font-size:12px;padding:7px 10px}
.batch-choice-list{max-height:240px;overflow:auto;border:1px solid var(--ui-line);border-radius:8px;padding:8px}
.batch-choice-list label{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;text-align:left;min-height:38px;font-size:13px;padding:5px}
#card-batch-dialog>label{flex-direction:row;justify-content:flex-start;text-align:left}
#card-batch-dialog .dialog-actions{position:sticky;bottom:-24px;padding:12px 0;background:var(--ui-panel);display:flex;justify-content:flex-end;gap:8px}
#batch-status{white-space:pre-line}#card-batch-download{display:block;margin:12px 0;color:var(--ui-accent);text-decoration:underline}#card-batch-download[hidden]{display:none}
.card-product-context{display:flex;flex-wrap:wrap;gap:8px 18px;padding:10px 12px;font-size:12px;line-height:1.5;margin-bottom:10px;border:1px solid var(--ui-line);border-radius:8px}.card-product-context a{color:var(--ui-accent)}
.shape-filter{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}.shape-filter button{font-size:12px;padding:7px 9px;min-height:36px;flex:0 0 auto}.shape-grid button{min-height:90px}.shape-grid button span{font-size:12px;line-height:1.4}
.card-template-controls{position:sticky;top:0;z-index:3;background:var(--ui-panel);padding:6px 0;border-bottom:1px solid var(--ui-line);margin-bottom:12px}.card-template-controls .apply-button{margin-top:0!important}.card-template-controls .template-help{margin:0 0 8px}
html[data-theme] .add-card-back{display:block;margin:12px 0;padding:9px 16px;background:var(--ui-active);color:var(--ui-accent)}.add-card-back[hidden]{display:none!important}
@media(max-width:680px){.batch-choice-columns{grid-template-columns:1fr;gap:12px}.batch-choice-list{max-height:180px}#card-batch-dialog{padding:16px}}
