#sobatPhotoDialog{box-sizing:border-box;width:1100px;max-width:calc(100vw - 16px);max-height:94dvh;padding:0;border:1px solid #cbd5e1;border-radius:14px;background:#f1f5f9;color:#172b45;overflow:auto}
#sobatPhotoDialog::backdrop{background:#08192ccc}
#sobatPhotoDialog *{box-sizing:border-box}
#sobatPhotoDialog .sp-head{position:sticky;top:0;z-index:2;background:#fff;padding:14px 18px;border-bottom:1px solid #d3deea;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#sobatPhotoDialog h2{margin:0;font-size:20px;color:#163958}
#sobatPhotoDialog .sp-head button{margin-left:auto}
#sobatPhotoDialog .sp-tools{padding:14px 18px;display:flex;flex-wrap:wrap;gap:10px;align-items:end;background:#fff}
#sobatPhotoDialog label{display:flex;flex-direction:column;gap:4px;font-size:13px;font-weight:600}
#sobatPhotoDialog input,#sobatPhotoDialog select,#sobatPhotoDialog textarea{background:white;color:#172b45;border:1px solid #afbed0;border-radius:6px;padding:8px;font:inherit;max-width:100%}
#sobatPhotoDialog button{border:1px solid #acc0d1;border-radius:7px;padding:9px 12px;background:#fff;color:#163958;font:inherit;cursor:pointer;min-height:38px}
#sobatPhotoDialog button.sp-primary{background:#176e55;color:#fff;border-color:#176e55}
#sobatPhotoDialog button:disabled{opacity:.5;cursor:wait}
#sobatPhotoDialog button.sp-danger{color:#b42332}
#sobatPhotoDialog .sp-status{margin:0;padding:10px 18px;font-size:13px;white-space:pre-wrap}
#sobatPhotoDialog .sp-help{padding:0 18px 10px;font-size:12px;line-height:1.6;margin:0}
#sobatPhotoDialog .sp-pages{padding:0 12px 18px}
#sobatPhotoDialog .sp-sheet{background:#fff;padding:3.8%;margin:12px auto 22px;max-width:794px;border:1px solid #d6dee7;box-shadow:0 3px 14px #182d4010;aspect-ratio:210/297;display:flex;flex-direction:column;color:#172b45}
#sobatPhotoDialog .sp-sheet-title{font-size:18px;font-weight:700;overflow-wrap:anywhere;min-height:26px;max-height:55px;overflow:hidden}
#sobatPhotoDialog .sp-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:2.6%;flex:1;min-height:0;margin:12px 0}
#sobatPhotoDialog .sp-slot{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column;border:1px solid #cbd5e1;border-radius:12px;overflow:hidden;background:#f4f7fb}
#sobatPhotoDialog .sp-meta{background:#fff;padding:5px 7px;font-size:11px;min-height:43px;flex-shrink:0;cursor:pointer;white-space:pre-wrap;overflow-wrap:anywhere}
#sobatPhotoDialog .sp-meta small{display:block;font-size:10px;color:#51647a}
#sobatPhotoDialog .sp-image{flex:1;min-height:0;position:relative;display:flex;align-items:center;justify-content:center;color:#8393a5;font-size:13px;overflow:hidden}
#sobatPhotoDialog .sp-image img{position:absolute;width:100%;height:100%;object-fit:contain;cursor:pointer}
#sobatPhotoDialog .sp-foot{font-size:10px;color:#51647a;text-align:right}
#sobatPhotoDialog .sp-edit{padding:14px 18px;background:#fff;border-top:1px solid #cbd5e1}
#sobatPhotoDialog .sp-edit-fields{display:grid;grid-template-columns:2fr 1fr 1fr;gap:10px}
#sobatPhotoDialog .sp-edit textarea{width:100%;resize:vertical;min-height:64px}
#sobatPhotoDialog .sp-edit-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
#sobatPhotoDialog .sp-selected{outline:3px solid #168963;outline-offset:1px}
#sobatPhotoDialog [hidden]{display:none!important}
#sobatPhotoButton{background:#176e55!important;color:white!important;border:1px solid #0d5742!important}
@media(max-width:600px){#sobatPhotoDialog .sp-tools{padding:10px;gap:8px}#sobatPhotoDialog .sp-tools label{width:calc(50% - 8px)}#sobatPhotoDialog .sp-tools button{flex:1;font-size:12px}#sobatPhotoDialog .sp-head{padding:10px}#sobatPhotoDialog h2{font-size:17px}#sobatPhotoDialog .sp-edit-fields{grid-template-columns:1fr 1fr}#sobatPhotoDialog .sp-edit-fields label:first-child{grid-column:1/-1}#sobatPhotoDialog .sp-meta{font-size:9px;padding:3px;min-height:34px}#sobatPhotoDialog .sp-meta small{font-size:8px}#sobatPhotoDialog .sp-sheet-title{font-size:13px}#sobatPhotoDialog .sp-image{font-size:10px}#sobatPhotoDialog .sp-foot{font-size:8px}#sobatPhotoDialog .sp-slot{border-radius:7px}#sobatPhotoDialog .sp-pages{padding:0 4px 10px}}
@media(max-width:600px){#sobatPhotoDialog .sp-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}#sobatPhotoDialog .sp-tools label{width:auto;min-width:0}#sobatPhotoDialog .sp-tools label:has(#spTitle){grid-column:1/-1}#sobatPhotoDialog .sp-tools button{width:100%;min-width:0;min-height:40px;white-space:normal;overflow-wrap:normal;word-break:normal;padding:9px 7px}#sobatPhotoDialog .sp-tools input,#sobatPhotoDialog .sp-tools select{width:100%;min-width:0}}
/* Fix25: stable light editing surface and aligned controls in both host themes. */
html body #sobatPhotoDialog{color-scheme:light!important;background:#f1f5f9!important;color:#172b45!important}
html body #sobatPhotoDialog *{-webkit-text-fill-color:currentColor!important;text-shadow:none!important}
html body #sobatPhotoDialog :is(h2,h3,label,p,strong,.sp-sheet-title,.sp-meta){color:#172b45!important;opacity:1!important}
html body #sobatPhotoDialog :is(.sp-meta small,.sp-foot,.sp-image){color:#51647a!important;opacity:1!important}
html body #sobatPhotoDialog :is(input,select,textarea,option){background:#fff!important;color:#172b45!important;border-color:#afbed0!important}
html body #sobatPhotoDialog :is(input,textarea)::placeholder{color:#60748a!important;opacity:1!important}
html body #sobatPhotoDialog button{background:#fff!important;color:#163958!important;border-color:#acc0d1!important}
html body #sobatPhotoDialog button.sp-primary{background:#176e55!important;color:#fff!important;border-color:#176e55!important}
html body #sobatPhotoDialog button.sp-danger{color:#aa2132!important}
html body #sobatPhotoDialog .sp-tools{align-items:end;gap:10px}
html body #sobatPhotoDialog .sp-tools :is(input,select,button){height:42px!important;min-height:42px!important;max-height:42px!important;line-height:20px!important;margin:0!important;font-size:13px!important}
html body #sobatPhotoDialog .sp-tools button{display:flex;align-items:center;justify-content:center;padding:9px 12px!important}
html body #sobatPhotoDialog .sp-tools label{gap:6px;font-size:12px;line-height:18px}
html body #sobatPhotoDialog .sp-tools label:has(#spAlbums){width:235px;min-width:0}
html body #sobatPhotoDialog #spNew{width:235px;flex:none}
html body #sobatPhotoDialog :is(button,input,select,textarea):focus-visible{outline:3px solid #2582a5!important;outline-offset:2px}
@media(max-width:600px){html body #sobatPhotoDialog .sp-tools{gap:10px 8px}html body #sobatPhotoDialog .sp-tools label:has(#spAlbums),html body #sobatPhotoDialog #spNew{width:100%;min-width:0}html body #sobatPhotoDialog #spNew{align-self:end}html body #sobatPhotoDialog .sp-tools button{padding:9px 7px!important;font-size:12px!important}html body #sobatPhotoDialog .sp-status{padding:12px 10px 6px;line-height:1.6}html body #sobatPhotoDialog .sp-help{padding:0 10px 12px;line-height:1.65}}
@media(min-width:601px){html body #sobatPhotoDialog .sp-tools{display:grid;grid-template-columns:repeat(12,minmax(0,1fr))}html body #sobatPhotoDialog .sp-tools label:has(#spAlbums),html body #sobatPhotoDialog #spNew{grid-column:span 3;width:100%!important;min-width:0}html body #sobatPhotoDialog .sp-tools label:has(#spTitle){grid-column:span 6;min-width:0}html body #sobatPhotoDialog .sp-tools :is(input,select){width:100%;min-width:0}html body #sobatPhotoDialog .sp-tools>button:not(#spNew){grid-column:span 3;width:100%;min-width:0}html body #sobatPhotoDialog .sp-tools:has(#spDownload:not([hidden]))>button:not(#spNew){grid-column:span 2}}

html body #sobatPhotoDialog .sp-photo-sources{margin:0 18px 12px;padding:14px;background:#e9f3fa;border:1px solid #8daec4;border-radius:10px;color:#163958}
html body #sobatPhotoDialog .sp-photo-sources[hidden]{display:none!important}
html body #sobatPhotoDialog .sp-photo-sources>div{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
html body #sobatPhotoDialog .sp-photo-sources button{min-height:42px;padding:10px 14px;border:1px solid #acc0d1;border-radius:7px}
@media(max-width:600px){html body #sobatPhotoDialog .sp-photo-sources{margin:0 10px 10px}html body #sobatPhotoDialog .sp-photo-sources button{flex:1 1 150px}}

/* Revisi 479: identity and creator appear once, in the first-page header. */
html body #sobatPhotoDialog .sp-report-fields{background:#fff;border:1px solid #afbed0;border-radius:9px;margin:0 18px 12px;padding:12px;color:#17334c}
html body #sobatPhotoDialog .sp-report-fields summary{cursor:pointer;font-size:13px;font-weight:700}
html body #sobatPhotoDialog .sp-report-fields>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:12px 0}
html body #sobatPhotoDialog .sp-report-fields label{min-width:0}
html body #sobatPhotoDialog .sp-report-fields input{width:100%;min-width:0}
html body #sobatPhotoDialog .sp-report-fields p{font-size:12px;margin-bottom:0}
#sobatPhotoDialog .sp-report-header{display:grid;grid-template-columns:minmax(0,1fr) 38%;gap:14px;margin-bottom:8px;flex-shrink:0}
#sobatPhotoDialog .sp-report-identity{font:12px/1.5 Arial,sans-serif;overflow-wrap:anywhere;color:#17334c}
#sobatPhotoDialog .sp-report-identity>div:first-child{font-weight:bold}
#sobatPhotoDialog .sp-report-header .sp-sheet-title{font-size:15px;margin-top:10px}
#sobatPhotoDialog .sp-report-header .awp-footer-preview{width:100%;margin:0;font-size:10px}
@media(max-width:600px){html body #sobatPhotoDialog .sp-report-fields{margin:0 10px 10px}html body #sobatPhotoDialog .sp-report-fields>div{grid-template-columns:1fr}#sobatPhotoDialog .sp-report-header{gap:8px}#sobatPhotoDialog .sp-report-identity{font-size:8px}#sobatPhotoDialog .sp-report-header .sp-sheet-title{font-size:10px}#sobatPhotoDialog .sp-report-header .awp-footer-preview{font-size:8px}}

/* Revisi 497: compact first-page header and photo spacing. */
#sobatPhotoDialog .sp-report-header{align-items:start;margin-bottom:4px;grid-template-columns:minmax(0,1fr) 32%}
#sobatPhotoDialog .sp-report-header .awp-footer-preview{font-size:8px;line-height:1.2}
#sobatPhotoDialog .sp-report-header .awp-footer-preview img{height:27px;max-width:95%;margin:3px auto}
#sobatPhotoDialog .sp-report-header .af-name{padding-bottom:1px;margin-bottom:1px}
#sobatPhotoDialog .sp-grid{margin-top:3px}

/* Revisi 498: readable header controls across themes. */
html body #sobatPhotoDialog #spHeaderCard>summary{color:#12334c!important;background:#dcefe5!important;font-weight:700;opacity:1!important}
html body #sobatPhotoDialog #spHeaderCard>summary::marker{color:#12334c!important}

/* Revisi 499: scaled signature overlays text without changing header layout. */
html body #sobatPhotoDialog .sp-report-header .awp-footer-preview img{height:27px;min-height:27px;flex-shrink:0;overflow:visible;z-index:3;transform-origin:center}

/* Revisi 500: clear section headings and actions next to preview. */
html body #sobatPhotoDialog #spHeaderCard>summary,html body #sobatPhotoDialog #spAuthor summary{padding:11px 12px!important;border-radius:6px;opacity:1!important;text-shadow:none!important}
html body #sobatPhotoDialog #spHeaderCard>summary *,html body #sobatPhotoDialog #spAuthor summary *{color:#fff!important}
html body #sobatPhotoDialog #spHeaderCard>summary::marker,html body #sobatPhotoDialog #spAuthor summary::marker{color:#fff!important}
html body #sobatPhotoDialog .sp-document-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 18px}
html body #sobatPhotoDialog .sp-document-actions button{width:100%;min-height:42px;padding:10px 8px!important;box-sizing:border-box}
html body #sobatPhotoDialog .sp-document-actions button[hidden]{display:none!important}
html body #sobatPhotoDialog #spStatus{margin:0 18px;padding:0}
html body #sobatPhotoDialog #spStatus:empty{display:none}
@media(max-width:600px){html body #sobatPhotoDialog .sp-document-actions{margin:10px}}

/* Revisi 514: compact menu anchored to Add photo. */
html body #sobatPhotoDialog .sp-add-wrap{position:relative;min-width:0}
html body #sobatPhotoDialog .sp-add-wrap>#spAdd{width:100%!important;margin:0!important}
html body #sobatPhotoDialog .sp-add-wrap>#spPhotoSources{position:absolute!important;top:calc(100% + 5px)!important;left:0!important;z-index:50!important;width:200px!important;max-width:calc(100vw - 60px)!important;margin:0!important;padding:6px!important;border-radius:9px!important;background:#f7fbff!important;border:1px solid #8caec4!important;box-shadow:0 6px 18px #0004!important}
html body #sobatPhotoDialog .sp-add-wrap>#spPhotoSources[hidden]{display:none!important}
html body #sobatPhotoDialog .sp-add-wrap>#spPhotoSources>div{display:flex!important;flex-direction:column!important;gap:5px!important;margin:0!important}
html body #sobatPhotoDialog .sp-add-wrap>#spPhotoSources button{flex:none!important;width:100%!important;min-height:34px!important;margin:0!important;padding:8px 10px!important;font-size:12px!important;text-align:left!important;line-height:1.3!important;white-space:nowrap!important}
html body #sobatPhotoDialog #spTakePhoto{background:#176b58!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
html body #sobatPhotoDialog #spGallery{background:#245578!important;color:#fff!important;-webkit-text-fill-color:#fff!important}

/* R541: Galeri uses a genuine user-tapped file input, not showPicker()/click(). */
html body #sobatPhotoDialog .sp-gallery-picker{position:relative;display:flex;align-items:center;justify-content:center;flex:1 1 150px;min-height:42px;padding:10px 14px;border:1px solid #acc0d1;border-radius:7px;background:#245578!important;color:#fff!important;-webkit-text-fill-color:#fff!important;font:inherit;font-weight:600;cursor:pointer;overflow:hidden;text-align:center}
html body #sobatPhotoDialog .sp-gallery-picker input[type=file]{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:100px}

/* R543: match gallery label to the working camera button, without changing native file picker. */
html body #sobatPhotoDialog .sp-add-wrap>#spPhotoSources .sp-gallery-picker{box-sizing:border-box!important;display:flex!important;flex:0 0 36px!important;width:100%!important;height:36px!important;min-height:36px!important;max-height:36px!important;margin:0!important;padding:8px 10px!important;justify-content:flex-start!important;align-items:center!important;font-size:12px!important;font-weight:600!important;line-height:1.3!important;text-align:left!important;border-radius:7px!important}
html body #sobatPhotoDialog .sp-add-wrap>#spPhotoSources .sp-gallery-picker input[type=file]{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;opacity:0!important;cursor:pointer!important}

/* R547: align the enlarged stamp over the creator name in the page preview. */
html body #sobatPhotoDialog .sp-report-header .awp-footer-preview img{margin-bottom:-13px!important;position:relative;z-index:5!important;pointer-events:none}
html body #sobatPhotoDialog .sp-report-header .awp-footer-preview .af-name{position:relative;z-index:1}

/* R548: opaque signature pixels render above underlying name text. */
html body #sobatPhotoDialog .awp-footer-preview img{mix-blend-mode:normal!important;z-index:10!important}
html body #sobatPhotoDialog .awp-footer-preview .af-name{z-index:1!important}

.sp-header-label-grid{display:grid;grid-template-columns:max-content auto minmax(0,1fr);column-gap:6px;row-gap:3px}.sp-header-label-grid>span{min-width:0;overflow-wrap:anywhere}
#sobatPhotoDialog .sp-report-identity>.sp-header-label-grid{font-weight:normal}#sobatPhotoDialog .sp-header-label-grid>span:nth-child(-n+3){font-weight:bold}
