.mg-survey{scroll-margin-top:70px;box-sizing:border-box;max-width:100%;min-width:0;padding:24px;margin:20px 0;border:1px solid #adb5bd;border-radius:14px;background:#fff;color:#212529;overflow-wrap:anywhere}
.mg-survey h2{font-size:1.3rem;margin:12px 0}.mg-survey h3{font-size:1.1rem}.mg-survey p{line-height:1.6}
.mg-survey fieldset{min-width:0;border:0;padding:0;margin:16px 0}.mg-survey legend{font-size:1rem;font-weight:700;width:auto}
.mg-survey-field{margin-bottom:16px}.mg-survey-field>label{display:block;margin-bottom:6px}
.mg-survey-field input{box-sizing:border-box;width:100%;min-width:0;max-width:100%;font:inherit;font-size:1rem;min-height:48px;padding:10px 12px;border:1px solid #767676;border-radius:8px;background:#fff;color:#212529}
.mg-survey-option{display:flex;align-items:center;gap:12px;border-bottom:1px solid #d6d9dd}.mg-survey-option input{flex:0 0 20px;width:20px;height:20px;accent-color:#c65400}.mg-survey-option label{flex:1;min-width:0;padding:14px 0;margin:0;cursor:pointer;line-height:1.4}
.mg-survey input:focus-visible,.mg-survey button:focus-visible{outline:3px solid #e87923;outline-offset:3px}
.mg-survey-submit{min-height:48px;padding:10px 24px;border:1px solid #a34400;border-radius:8px;background:#b94d00;color:#fff;font:inherit;font-weight:700;cursor:pointer}
.mg-survey-badge{display:inline-block;padding:4px 12px;border-radius:20px;background:#fff0df;color:#8b3a00;font-size:.85rem;font-weight:700}
.mg-survey-note{font-size:.9rem;color:#58616c}.mg-survey-error{padding:12px;border:1px solid #b32323;color:#a31515;border-radius:8px}
.mg-survey-results{margin-top:24px}.mg-survey-result{margin:14px 0}.mg-survey-result strong{display:inline-block;margin-left:10px}.mg-survey progress{display:block;width:100%;height:12px;margin-top:6px;accent-color:#e87923}
body.dark-mode .mg-survey{background:#202731;border-color:#495463;color:#eef1f5}body.dark-mode .mg-survey-field input{background:#151b23;border-color:#74808f;color:#eef1f5}body.dark-mode .mg-survey-note{color:#b6c0cc}body.dark-mode .mg-survey-option{border-color:#48525e}body.dark-mode .mg-survey-error{color:#ffadad}body.dark-mode .mg-survey-badge{background:#493019;color:#ffd3a3}
@media(max-width:575px){.mg-survey{padding:16px}.mg-survey-submit{width:100%}}
.mg-survey-photo{display:block;width:auto;max-width:100%;max-height:420px;object-fit:contain;border-radius:10px;margin:12px 0;background:#eee}
.mg-survey-photo-field{margin-top:8px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}.mg-survey-photo-field .mg-survey-photo{max-height:200px;flex-basis:auto}.mg-photo-status{width:100%;font-size:.85rem}
.mg-photo-pick,.mg-survey-photo-field button,#mg-photo-editor button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 14px;border:1px solid #bd702d;border-radius:8px;background:#fff3e6;color:#713800;cursor:pointer;font:inherit}
.mg-photo-pick{position:relative;overflow:hidden}.mg-photo-pick:focus-within{outline:3px solid #e87923}.mg-photo-pick input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.mg-survey [hidden],#mg-photo-editor [hidden]{display:none!important}
#mg-photo-editor{box-sizing:border-box;width:min(860px,96vw);max-width:96vw;max-height:94dvh;padding:20px;border:1px solid #aaa;border-radius:16px;background:#fff;color:#222;overflow:auto}
#mg-photo-editor:modal{overscroll-behavior:contain}#mg-photo-editor::backdrop{background:#000b;overflow:hidden;overscroll-behavior:contain}
#mg-photo-editor h1{font-size:1.4rem;margin:0 0 12px}#mg-photo-editor p{font-size:.9rem;line-height:1.5}
.mg-photo-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:12px}.mg-photo-tools label{display:flex;align-items:center;gap:5px;margin:0}.mg-photo-tools select{color:#222;background:#fff;min-height:44px}.mg-photo-tools input[type=range]{width:100px}
#mg-photo-editor button[aria-pressed=true],#mg-photo-editor #mg-photo-apply{background:#b94d00;color:#fff}#mg-photo-editor button:disabled{opacity:.5}
.mg-photo-stage{display:flex;justify-content:center;background:#d9dce0;border-radius:8px;overflow:hidden}#mg-photo-canvas{display:block;max-width:100%;max-height:48dvh;width:auto;height:auto;touch-action:none;user-select:none;-webkit-user-select:none;cursor:crosshair}
.mg-photo-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}#mg-photo-message{min-height:1.5em}#mg-photo-editor :focus-visible{outline:3px solid #df862e;outline-offset:2px}
body.dark-mode #mg-photo-editor{background:#202731;color:#eef1f5;border-color:#526071}body.dark-mode .mg-photo-pick,body.dark-mode .mg-survey-photo-field button,body.dark-mode #mg-photo-editor button{background:#493019;color:#ffd3a3}body.dark-mode #mg-photo-editor button[aria-pressed=true],body.dark-mode #mg-photo-editor #mg-photo-apply{background:#bd590c;color:white}
@media(max-width:575px){#mg-photo-editor{padding:12px}.mg-photo-tools{gap:6px}#mg-photo-editor button{padding:6px 10px}.mg-survey-photo{max-height:340px}}
/* Equal photo frames; keep the entire edited image visible. */
.mg-survey-option-body{flex:1;min-width:0;padding:12px 0}.mg-survey-option-body>label{display:block;padding:0 0 8px}
.mg-survey-photo-zoom{display:block;position:relative;width:320px;max-width:100%;aspect-ratio:4/3;padding:0;margin:8px 0 14px;border:1px solid #bbc2cb;border-radius:10px;background:#eef0f3;overflow:hidden;cursor:zoom-in}
.mg-survey-photo-zoom .mg-survey-photo{width:100%;height:100%;max-height:none;margin:0;border-radius:0;object-fit:contain;background:transparent}
.mg-survey-photo-zoom>span{position:absolute;bottom:8px;right:8px;padding:4px 9px;border-radius:20px;background:#171c24d9;color:#fff;font-size:12px;pointer-events:none}
body.dark-mode .mg-survey-photo-zoom{background:#141a22;border-color:#495463}
#mg-survey-photo-viewer{box-sizing:border-box;max-width:96vw;width:min(1000px,96vw);max-height:94dvh;padding:16px;border:1px solid #747c88;border-radius:14px;background:#fff;color:#212529;overflow:auto}
#mg-survey-photo-viewer:modal{overscroll-behavior:contain}#mg-survey-photo-viewer::backdrop{background:#000c;overflow:hidden;overscroll-behavior:contain}
#mg-survey-photo-viewer h1{font-size:18px;margin:0 100px 12px 0}#mg-survey-photo-viewer form{float:right;margin:0}
#mg-survey-photo-viewer button{min-height:44px;padding:8px 14px;border:1px solid #bd702d;border-radius:8px;background:#fff3e6;color:#713800;cursor:pointer}
#mg-survey-photo-viewer button:focus-visible{outline:3px solid #e87923;outline-offset:2px}
#mg-survey-photo-large{display:block;clear:both;max-width:100%;max-height:78dvh;width:auto;height:auto;object-fit:contain;margin:auto}
body.dark-mode #mg-survey-photo-viewer{background:#202731;color:#eef1f5}
.mg-survey-deadline-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.mg-survey-deadline-row input{flex:1;min-width:200px;width:auto;color-scheme:light}
#mg-survey-date-open{min-height:48px;padding:10px 16px;border:1px solid #a64b08;border-radius:8px;background:#fff3e6;color:#713800;font:inherit;cursor:pointer;white-space:nowrap}
body.dark-mode .mg-survey-deadline-row input{color-scheme:dark}body.dark-mode #mg-survey-date-open{background:#493019;color:#ffd3a3;border-color:#bd702d}

.mg-survey-type-options{display:flex;flex-wrap:wrap;gap:12px 24px}.mg-survey-type-options label{display:flex;align-items:center;gap:8px;min-height:44px;cursor:pointer}.mg-survey-type input[type=radio],.mg-survey-option input[type=checkbox]{accent-color:#e87923;width:20px;height:20px;flex-shrink:0;position:static;opacity:1}

/* Mosaic size control: native keyboard/touch range, adjacent to Undo. */
.mg-photo-actions{flex-wrap:wrap;align-items:center}
.mg-photo-size-control{display:flex;align-items:center;gap:7px;flex:1 1 280px;min-width:0;margin:0 auto 0 0;font-size:13px;white-space:nowrap}
.mg-photo-size-control span{font-size:11px}
.mg-photo-size-control output{min-width:2ch;font-variant-numeric:tabular-nums}
#mg-photo-size{min-width:60px;width:120px;max-width:100%;height:44px;flex:1;margin:0;padding:0;accent-color:#b94d00}
body.dark-mode #mg-photo-size{color-scheme:dark;accent-color:#ff9b48}
#mg-photo-size:focus-visible{outline:3px solid #df862e;outline-offset:2px}
@supports not (accent-color:auto){
 #mg-photo-size{-webkit-appearance:none;appearance:none;background:transparent}
 #mg-photo-size::-webkit-slider-runnable-track{height:6px;background:#8a8f98;border-radius:4px}
 #mg-photo-size::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;margin-top:-7px;border-radius:50%;background:#b94d00}
 #mg-photo-size::-moz-range-track{height:6px;background:#8a8f98;border-radius:4px}
 #mg-photo-size::-moz-range-thumb{width:20px;height:20px;border:0;border-radius:50%;background:#b94d00}
}
@media(max-width:575px){.mg-photo-size-control{flex-basis:100%}}

/* 원형 모자이크 브러시: 저장 캔버스와 분리된 위치 안내 */
.mg-photo-stage{position:relative}
#mg-photo-canvas{cursor:none}
#mg-photo-editor .mg-mosaic-brush-cursor{position:absolute;pointer-events:none;box-sizing:border-box;border:2px solid #ff922b;box-shadow:0 0 0 1px #fff,0 0 0 3px #242424;border-radius:50%;transform:translate(-50%,-50%);z-index:1}
#mg-photo-editor .mg-mosaic-brush-cursor[hidden]{display:none}
