@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&display=swap');
:root{--green:#1166e8;--dark:#14345a;--muted:#7187a1;--line:#dceaf7}*{box-sizing:border-box}body{margin:0;background:#edf8ff;color:var(--dark);font:13px 'Be Vietnam Pro',Arial,sans-serif}button,input,select{font:inherit}button{cursor:pointer;transition:.18s}button:hover{filter:brightness(.95);transform:translateY(-1px)}button:disabled{opacity:.4;cursor:not-allowed;transform:none}button:focus-visible,a:focus-visible{outline:3px solid #41cda1;outline-offset:3px}header{height:88px;background:white;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 4%}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--dark);font-size:24px;font-weight:800;letter-spacing:-1px}.brand-light{font-weight:400;margin-left:5px}.brand small{display:block;font-size:8px;letter-spacing:2px;margin-top:5px;color:#7d9489}.logo{height:43px;width:43px;border-radius:12px;background:linear-gradient(140deg,#2084ff,#084bcc);color:white;font-size:30px;text-align:center}.header-end{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:11px}.local-dot,.live-dot{width:6px;height:6px;border-radius:50%;background:#227af5;display:inline-block}.ghost{background:transparent;border:0;color:var(--dark);padding:10px 12px}.header-end button{margin-left:15px;border-left:1px solid var(--line)}main{max-width:1600px;margin:auto;padding:34px 4% 0}.intro{display:flex;justify-content:space-between;align-items:center;margin-bottom:30px}.eyebrow{font-size:9px;letter-spacing:2.5px;font-weight:700;color:var(--green);margin-bottom:10px}h1{font-size:31px;letter-spacing:-1.1px;margin:0;font-weight:700}h1 em{font-style:normal;color:var(--green)}.intro p{margin:10px 0 0;color:var(--muted);font-size:12px}.demo{border:1px solid #b6d9ff;border-radius:8px;padding:11px 16px;background:#e5f3ff;color:#2269bb}.workspace{display:grid;grid-template-columns:260px minmax(320px,1fr) 256px;gap:20px;align-items:start}.panel{background:white;border:1px solid var(--line);border-radius:13px;padding:21px}.panel-title{display:flex;align-items:center;gap:9px;margin-bottom:22px}h2{font-size:13px;margin:0;font-weight:700}.step{color:var(--green);background:#e7f2ff;border-radius:6px;font-size:10px;padding:5px;font-weight:700}label{display:block;font-weight:500;font-size:11px;margin:18px 0 9px}label span{color:var(--muted);font-weight:400}.paper-options{display:flex;gap:6px}.paper-options button{flex:1;border:1px solid var(--line);border-radius:7px;background:white;font-size:11px;font-weight:600;padding:12px 1px}.paper-options small{display:block;font-size:8px;font-weight:400;margin-top:5px;color:var(--muted)}.paper-options button.active,.segmented button.active{color:var(--green);background:#e7f2ff;border-color:#1874ec}.segmented{display:flex;background:#f3f6f4;padding:3px;border-radius:7px;gap:3px}.segmented button{flex:1;border:1px solid transparent;border-radius:5px;background:transparent;padding:8px 4px;font-size:11px;color:#73827a}.segmented button.active{background:white;box-shadow:0 1px 3px #1836260d;border-color:#e0eae3}.fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}[hidden]{display:none!important}input[type=number],select{width:100%;background:white;border:1px solid #d4e6f7;border-radius:6px;padding:10px;color:var(--dark);outline-color:#1eae7e}select{font-size:11px}.divider{height:1px;background:var(--line);margin:22px 0}.note{font-size:10px;line-height:1.8;color:#799082;background:#f5f8f5;border-radius:6px;padding:10px;margin-top:13px}.checkbox{display:flex;align-items:center;gap:7px;font-size:10px;color:var(--muted)}input[type=checkbox],input[type=range]{accent-color:var(--green)}.preview-area{background:#e5f3ff;border:1px solid #d4e6f7;border-radius:13px;overflow:hidden}.preview-toolbar{height:53px;border-bottom:1px solid #d4e6f7;display:flex;align-items:center;justify-content:space-between;padding:0 20px;font-size:11px}.preview-toolbar .live-dot{margin-right:6px}.badge{font-size:9px;background:#f0f5f1;border:1px solid #e1eae4;color:#6c8375;border-radius:5px;padding:4px 7px;margin-left:8px}#zoomLabel{font-size:9px;color:var(--muted)}.preview-stage{height:577px;display:flex;align-items:center;justify-content:center;position:relative;background-image:radial-gradient(#b8d8f4 .7px,transparent .7px);background-size:14px 14px;padding:35px 25px}.ruler-top{position:absolute;top:14px;color:#93a59a;font-size:9px;letter-spacing:1px}#paperWrap{position:relative;max-width:100%;max-height:100%;background:white;box-shadow:0 10px 25px #274b3920;line-height:0}#preview{display:block;width:100%;height:100%;cursor:pointer}#empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;line-height:1.6;text-align:center;padding:15px}#empty h3{font-size:13px;margin:18px 0 4px}#empty p{color:#8b9b91;font-size:10px;margin:4px 0 22px}#empty small{color:#a0aca4;font-size:8px;margin-top:15px}.empty-icon{font-size:50px;color:#bed4c5;position:relative}.empty-icon span{position:absolute;right:-3px;bottom:7px;background:#edf6ee;border-radius:50%;font-size:18px;width:25px}.primary{background:linear-gradient(120deg,#2084ff,#084bcc);border:0;border-radius:7px;color:white;font-weight:600;padding:12px 16px;font-size:11px;box-shadow:0 4px 8px #1676ef25}.full{width:100%;margin-top:10px}.outline{border:1px solid #d9e5dd;background:white;color:var(--dark);border-radius:7px;padding:11px 15px;font-size:11px}.page-nav{height:51px;display:flex;align-items:center;gap:14px;padding:0 18px;font-size:10px;border-top:1px solid #d4e6f7}.page-nav button{background:transparent;border:0;color:#527a63;padding:5px}.page-note{margin-left:auto;color:#81968a;font-size:9px}.summary{background:#f6f9f6;padding:15px;border-radius:8px;margin-top:5px}.summary div{display:flex;justify-content:space-between;align-items:center;margin:0 0 17px;font-size:10px;color:#85968b}.summary div:last-child{margin:0}.summary b{color:var(--dark);font-size:12px}.summary div:last-child b{font-size:10px}.format-note{font-size:9px;color:#93a298;line-height:1.7;margin:10px 0 17px}.print-tip{margin-top:24px;padding-top:20px;border-top:1px solid var(--line);font-size:10px}.print-tip b{font-weight:600}.print-tip p{color:#8d9b92;font-size:10px;line-height:1.9}.privacy{display:flex;gap:10px;align-items:center;margin-top:27px;background:#e8f4ff;padding:12px;border-radius:7px;color:#7e9684}.privacy span{font-size:23px;color:#2782e9}.privacy p{font-size:9px;line-height:1.9;margin:0}.privacy b{font-weight:500;color:#4675a4}.library{margin-top:22px;padding:21px}.library-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.library-top .panel-title{margin:0}.text-button{background:none;border:0;color:#8b9a90;font-size:10px;margin-right:12px}.small{padding:9px 14px}#dropzone{border:1px dashed #b1d5ff;background:#f5fbff;border-radius:8px;display:flex;align-items:center;justify-content:center;gap:14px;padding:25px;cursor:pointer;color:#346da6}#dropzone span{font-size:23px}#dropzone b{font-size:11px;font-weight:500}#dropzone small{font-size:10px;color:#95a69a}#dropzone.drag{background:#ddf5e9;border-color:var(--green)}#photoList{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px;margin-top:16px}.photo-card{display:flex;gap:12px;border:1px solid var(--line);border-radius:9px;padding:12px}.photo-card img{width:66px;height:88px;object-fit:cover;background:#e6eee8;border-radius:4px;cursor:pointer}.photo-meta{min-width:0;flex:1}.photo-name{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:8px}.photo-controls{display:flex;gap:5px}.photo-controls select{padding:5px;width:100px;font-size:10px}.photo-controls input{padding:5px;width:48px;font-size:11px}.photo-actions{display:flex;justify-content:space-between;margin-top:10px}.photo-actions button{border:0;background:none;color:var(--green);font-size:10px;padding:0}.photo-actions .remove{color:#9ca59f}footer{display:flex;justify-content:space-between;padding:25px 0;color:#97a69c;font-size:9px}footer span:first-child{letter-spacing:2px;font-size:8px}dialog{border:1px solid var(--line);border-radius:16px;padding:24px;color:var(--dark);max-width:94vw;width:540px;box-shadow:0 20px 90px #173c3250}dialog::backdrop{background:#103c3277;backdrop-filter:blur(4px)}.modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.modal-header small{font-size:9px;letter-spacing:2px;color:var(--green)}.modal-header h2{font-size:17px;margin-top:6px}.modal-header button{background:#f1f6f2;border:0;border-radius:50%;width:30px;height:30px;font-size:20px;color:#71917f}.crop-bg{background:#e6eee8;border-radius:8px;overflow:hidden;line-height:0}#cropCanvas{width:100%;touch-action:none;cursor:grab}.crop-help{font-size:10px;color:#82958a;text-align:center;line-height:1.7}#cropZoom{width:100%}.modal-actions{display:flex;gap:8px;margin-top:20px}.modal-actions .primary{margin-left:auto}#helpDialog{font-size:12px;line-height:1.9}#helpDialog li{margin-bottom:12px}#helpDialog p{color:#72877a;font-size:11px}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:#133f32;color:white;padding:14px 22px;border-radius:9px;box-shadow:0 5px 30px #183e3430;opacity:0;pointer-events:none;transition:.2s;z-index:100}#toast.show{opacity:1}.error{color:#b65340;font-size:10px;margin-top:6px}@media(min-width:1500px){.preview-stage{height:640px}}@media(max-width:1100px){.workspace{grid-template-columns:230px minmax(300px,1fr)}.export{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:0 24px}.export .panel-title,.export .privacy{grid-column:1/-1}.export .summary{grid-row:2/6}.export .print-tip{grid-column:1/-1}.preview-stage{height:600px}}@media(max-width:700px){header{height:72px;padding:0 20px}.brand{font-size:20px}.header-end{font-size:0}.header-end button{font-size:11px;margin:0}.intro{align-items:start;gap:15px}h1{font-size:25px}.intro .demo{font-size:10px;padding:10px;min-width:100px}main{padding:25px 16px 0}.workspace{grid-template-columns:1fr}.settings{display:grid;grid-template-columns:1fr 1fr;gap:8px 15px}.settings>*{grid-column:1/-1}.settings .divider{margin:8px 0}.preview-area{grid-row:1}.preview-stage{height:530px}.export{grid-column:auto;display:block}#zoomLabel{display:none}.library-top{gap:10px}.library-top h2{font-size:12px}.library-top .badge{display:none}#dropzone{flex-wrap:wrap;gap:10px}footer span:last-child{display:none}footer{gap:20px;font-size:8px}.page-note{font-size:8px}.preview-toolbar{padding:0 12px}}

/* PRINT PRO — giao diện xanh dương theo mẫu */
body{background:radial-gradient(ellipse at 80% 0,#c5f0ff 0,transparent 48%),linear-gradient(130deg,#f4fbff,#e8f7ff 55%,#dff4ff)}header{background:#ffffffd9;backdrop-filter:blur(16px)}.brand{font-size:23px;letter-spacing:-.5px;color:#0c54bf}.brand-light{font-size:16px;color:#387cc4;font-weight:600}.brand small{color:#6b92b9}.primary,.demo,.outline,#help{border-radius:999px}.primary{background:linear-gradient(110deg,#2087ff,#074bce);box-shadow:0 7px 18px #1676ef24}.demo{background:linear-gradient(110deg,#2087ff,#074bce);color:white;border:0;padding:13px 20px}.outline{border-color:#bcd8fa;color:#165dc0;background:#f7fbff}.logo{background:linear-gradient(130deg,#2389ff,#0646cb)}.paper-options button.active{background:#e9f3ff;border-color:#207af0}.segmented button.active{color:#fff;background:linear-gradient(110deg,#2087ff,#074bce);border-radius:99px}.segmented{border-radius:99px;background:#edf5ff}.step{background:#e7f2ff;color:#156ade}.preview-stage{background-color:#e8f5ff}.preview-area{border-color:#cce3f8}.panel{border-color:#d6e8f8;box-shadow:0 6px 26px #2273c407}.note{color:#637f9d;background:#f0f7fe}.privacy{background:#e8f4ff}.print-tip b{color:#245c9c}#toast{background:#104db3}.editor-sizes{display:grid;grid-template-columns:1.5fr 1fr 1fr;gap:12px}.editor-sizes label{margin-top:0}.editor-sizes input{padding:10px;width:100%}.crop-bg{background:#e5f2ff}#editor{max-height:95vh;overflow:auto}#photoList img{height:auto;max-height:110px;object-fit:contain;align-self:flex-start}.header-end .local-dot{background:#207af0}input[type=range]{accent-color:#1477ed}@media(max-width:700px){.brand{font-size:18px}.brand-light{font-size:12px}.editor-sizes{gap:6px}.brand small{font-size:6px}}

.source-info{font-size:8px;color:#7893b0;margin:-3px 0 8px;line-height:1.5}.settings .note{font-size:9px;line-height:1.7;padding:9px;margin-top:10px}.preview-toolbar .badge{color:#3b75ab;background:#edf6ff;border-color:#d3e7fa}

/* Khung chỉnh ảnh không bị tên tệp dài đẩy tràn ngang */
dialog{width:min(600px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow-x:hidden;overflow-y:auto;min-width:0;margin:auto;padding:20px}dialog .modal-header{gap:12px;min-width:0}dialog .modal-header>div{min-width:0;flex:1}dialog .modal-header h2{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.5}dialog .modal-header button{flex:0 0 32px}dialog .editor-sizes{min-width:0;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) minmax(0,1fr)}dialog .editor-sizes>div{min-width:0}dialog input,dialog select{min-width:0;max-width:100%}.crop-bg{width:100%;min-width:0;overflow:hidden}#cropCanvas{display:block;width:100%;height:auto;max-width:100%;touch-action:none}.crop-modes{margin:12px 0}.crop-help{overflow-wrap:anywhere}.modal-actions{flex-wrap:wrap}.alignment-bar{display:flex;align-items:center;gap:12px;padding:12px 18px;background:#f5fbff;border-bottom:1px solid #d4e6f7;font-size:11px}.alignment-bar .segmented{max-width:310px;flex:1}.alignment-bar small{margin-left:auto;font-size:9px;color:#6b8ba8}input[readonly]{background:#eff5fc;color:#55799d}#freeCropActions{padding:0 0 12px}#freeCropActions .checkbox{margin-top:8px}@media(max-width:700px){dialog{padding:14px}.alignment-bar{gap:8px;flex-wrap:wrap;padding:10px}.alignment-bar>span{width:100%}.alignment-bar .segmented{max-width:none}.modal-actions button{padding:10px}.crop-help{font-size:9px}#editor .modal-header h2{font-size:14px}}

#editor #cropCanvas{width:min(100%,max(180px,calc((100dvh - 400px)*1.0909)));height:auto;margin:0 auto}#editor .modal-actions{position:sticky;bottom:-20px;background:#fff;padding-top:10px;padding-bottom:8px;z-index:2}#editor .modal-header{position:relative}#editor .crop-bg{background:#e5f1fc}

/* Print workspace — compact controls and continuous photo rail */
main{max-width:1700px;padding:26px 3% 0}.intro{margin-bottom:24px}.intro h1{font-size:29px}.intro p{font-size:11px}.eyebrow{letter-spacing:2px}.workspace{grid-template-columns:280px minmax(350px,1fr) 244px;grid-template-areas:'settings preview export' 'library preview export';grid-template-rows:auto 1fr;gap:16px;align-items:start}.settings{grid-area:settings;padding:18px}.library{grid-area:library;margin:0;padding:16px;min-width:0}.preview-area{grid-area:preview;position:sticky;top:16px;min-width:0}.export{grid-area:export;position:sticky;top:16px;padding:20px}.settings .panel-title{margin-bottom:15px}.settings label{margin-top:12px}.settings .divider{margin:15px 0}.settings .note{font-size:9px;margin-bottom:0}.library-top{gap:6px;flex-wrap:wrap;margin-bottom:12px}.library-top>div:last-child{width:100%;display:flex;justify-content:space-between;margin-top:7px}.library-top .panel-title{gap:6px}.library-top .badge{margin-left:0}.library-top .small{font-size:10px;padding:8px 13px}.library #dropzone{padding:12px 8px;gap:5px;flex-wrap:wrap}.library #dropzone span{font-size:17px}.library #dropzone b{font-size:10px}.library #dropzone small{font-size:8px;width:100%;text-align:center}#photoList{grid-template-columns:minmax(0,1fr);max-height:470px;overflow-y:auto;overflow-x:hidden;margin-top:12px;gap:8px;padding-right:3px}.photo-card{gap:10px;padding:10px;background:#fbfdff}.photo-card img{width:56px;max-height:78px}.photo-controls select{flex:1;min-width:0;width:95px}.photo-actions button{font-size:9px}.photo-name{font-size:10px}.preview-stage{height:660px}.alignment-bar{padding:11px 15px}.alignment-bar>span{display:none}.preview-toolbar{height:46px}.print-tip{font-size:10px}.export .summary{padding:14px}.brightness-control{border-top:1px solid #e2edf9;margin-top:12px;padding-top:10px}.slider-label{display:flex;align-items:center;justify-content:space-between}.slider-label label{margin:0;font-size:11px}.slider-label span{float:none;margin-left:6px;color:#1975e3}.slider-label button{margin:0;font-size:10px;color:#7292b5}#brightness{width:100%;margin:10px 0 0}.range-captions{display:flex;justify-content:space-between;font-size:8px;color:#8ba1b8}.lock-note{font-size:10px;text-align:center;color:#4f7caa;margin:8px 0}#editor #cropCanvas{width:min(100%,max(150px,calc((100dvh - 510px)*1.0909)));height:auto}#editor .crop-help{margin:8px 0}#editor .editor-sizes label{font-size:10px}#editor .modal-actions{margin-top:10px}#editor .brightness-control+ .modal-actions{padding-top:8px}.brightness-control input{accent-color:#1975e3}footer{padding:20px 0}.header-end{color:#7b91a7}#editor .lock-note{background:#eaf4ff;border-radius:6px;padding:8px}.export .full{padding:13px}#photoList::-webkit-scrollbar{width:4px}#photoList::-webkit-scrollbar-thumb{background:#c4daf0;border-radius:8px}
@media(max-width:1150px){.workspace{grid-template-columns:260px minmax(320px,1fr);grid-template-areas:'settings preview' 'library preview' 'export export'}.export{position:static;display:flex;flex-wrap:wrap;gap:12px;align-items:center}.export .panel-title{width:100%;margin:0}.export .summary{flex:1;min-width:200px}.export .summary div{margin-bottom:9px}.export>label,.export .format-note{display:none}.export #formats{width:170px}.export>.full{width:auto;min-width:140px}.export .print-tip{width:100%;padding-top:10px;margin:0}.export .print-tip p{margin-bottom:0}.preview-stage{height:700px}}
@media(max-width:760px){header{padding:0 16px}.header-end{font-size:0}main{padding:20px 12px}.intro{align-items:center}.intro h1{font-size:23px}.intro p{font-size:10px}.intro .demo{font-size:9px;min-width:auto}.workspace{grid-template-columns:minmax(0,1fr);grid-template-areas:'settings' 'library' 'preview' 'export';gap:14px}.settings{display:block}.library-top>div:last-child{width:auto;margin:0}.library-top{justify-content:space-between}.library #dropzone small{width:auto}#photoList{max-height:260px}.preview-area{position:static}.preview-stage{height:520px}.export{display:block}.export .panel-title{margin-bottom:15px}.export>label,.export .format-note{display:block}.export #formats,.export>.full{width:100%}.export .print-tip{margin-top:18px}.alignment-bar>span{display:block;width:auto}.alignment-bar .segmented{flex:1}.editor-sizes{gap:7px}.header-end #help{font-size:10px}#editor{padding:14px}#editor #cropCanvas{width:min(100%,max(130px,calc((100dvh - 510px)*1.0909)))}.range-captions{font-size:8px}}

/* Balanced side panels, horizontal photo library */
.workspace{grid-template-columns:280px minmax(350px,1fr) 280px;grid-template-areas:'settings preview export' 'library library library';grid-template-rows:auto auto;align-items:stretch}.settings,.export{align-self:stretch;height:auto;position:static;min-width:0;padding:20px}.preview-area{position:static;align-self:stretch}.preview-stage{height:560px}.export{display:flex;flex-direction:column;gap:0}.export .panel-title{margin-bottom:15px}.export .print-tip{margin-top:auto;padding-top:20px}.export .summary{flex:none}.export #formats{width:100%}.export>.full{width:100%}.library{grid-column:1/-1;padding:20px}.library-top{flex-wrap:nowrap;margin-bottom:16px}.library-top>div:last-child{width:auto;display:flex;align-items:center;margin-top:0}.library-top .panel-title{gap:9px}.library #dropzone{padding:17px;gap:12px;flex-wrap:nowrap}.library #dropzone small{width:auto;font-size:10px}.library #dropzone b{font-size:11px}#photoList{grid-template-columns:repeat(auto-fill,minmax(255px,1fr));max-height:350px;gap:12px;padding-right:5px;margin-top:16px}.photo-card{padding:12px;gap:12px}.photo-card img{width:65px;max-height:90px}.photo-controls select{width:100px}.photo-name{font-size:11px}.photo-actions button{font-size:10px}.library-top .small{font-size:11px;padding:10px 16px}
@media(max-width:1200px){.workspace{grid-template-columns:240px minmax(300px,1fr) 240px}.preview-stage{height:555px}.settings,.export{padding:16px}.preview-toolbar{padding:0 12px}.alignment-bar small{display:none}.alignment-bar{padding:10px}.intro h1{font-size:26px}}
@media(max-width:1000px){.workspace{grid-template-columns:1fr 1fr;grid-template-areas:'settings export' 'preview preview' 'library library'}.settings,.export{align-self:stretch}.preview-stage{height:560px}.export>label,.export .format-note{display:block}.export .print-tip{margin-top:auto}.export #formats{width:100%}.export>.full{width:100%}.export .summary{min-width:0}.export .panel-title{margin-bottom:15px}}
@media(max-width:600px){.workspace{grid-template-columns:1fr;grid-template-areas:'settings' 'preview' 'library' 'export'}.settings,.export{padding:18px}.preview-stage{height:480px}.library{padding:16px}.library-top{gap:8px;flex-wrap:wrap}.library-top>div:last-child{width:auto}.library #dropzone{gap:7px;flex-wrap:wrap}.library #dropzone small{font-size:9px}#photoList{grid-template-columns:minmax(0,1fr);max-height:350px}.export .print-tip{margin-top:20px}.alignment-bar small{display:block}.alignment-bar>span{display:none}}

.rotation-control{border-top:1px solid #e2edf9;margin-top:12px;padding-top:10px}#rotationRange{width:100%;accent-color:#1975e3;margin-top:10px}.angle-input{display:flex;align-items:center;gap:5px;font-size:11px}.angle-input input{width:76px;padding:6px;border:1px solid #d4e4f6;border-radius:6px;text-align:center}.angle-input button{font-size:9px;margin-left:6px}#editor #cropCanvas{width:min(100%,max(130px,calc((100dvh - 590px)*1.0909)))}
