:root { color-scheme: dark; --bg:#0b1512; --panel:#14221d; --line:#314a40; --green:#43d49e; --gold:#e0b958; --text:#f4f7f5; --muted:#9db1a9; --danger:#ff877f; }
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; background:var(--bg); color:var(--text); font-family:"Noto Sans KR",system-ui,sans-serif; letter-spacing:0; }
button,a,input { font:inherit; letter-spacing:0; }
button,a { -webkit-tap-highlight-color:transparent; }
.admin-header { min-height:76px; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:14px 24px; border-bottom:1px solid var(--line); background:#10201a; }
.admin-header small { color:var(--gold); font-size:11px; font-weight:800; }
.admin-header h1 { margin:2px 0 0; font-size:22px; }
.admin-header nav { display:flex; gap:8px; }
.admin-header button,.admin-header a { min-height:40px; border:1px solid #527164; background:#192f27; color:#fff; padding:9px 13px; text-decoration:none; cursor:pointer; }
.new-alert { padding:12px 24px; background:#f4ce67; color:#18362c; font-weight:900; animation:alertPulse 1.2s ease-in-out infinite; }
.admin-layout { display:grid; grid-template-columns:310px minmax(0,1fr); min-height:calc(100vh - 77px); }
.queue-panel { border-right:1px solid var(--line); background:#101d18; min-width:0; }
.queue-head { display:flex; justify-content:space-between; gap:12px; padding:17px; border-bottom:1px solid var(--line); }
.queue-head b,.queue-head span { display:block; }
.queue-head span { margin-top:3px; color:var(--muted); font-size:12px; }
.queue-head i { display:grid; place-items:center; min-width:34px; height:34px; border-radius:50%; background:#94453f; color:#fff; font-style:normal; font-weight:900; }
.queue-list { display:grid; gap:1px; max-height:calc(100vh - 150px); overflow:auto; }
.queue-item { width:100%; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:15px 17px; border:0; border-bottom:1px solid #263b32; background:#14231d; color:#fff; text-align:left; cursor:pointer; }
.queue-item:hover,.queue-item.active { background:#203b31; }
.queue-item b,.queue-item span,.queue-item small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.queue-item b { font-size:16px; }
.queue-item span,.queue-item small { margin-top:3px; color:var(--muted); font-size:11px; }
.queue-item em { align-self:start; padding:4px 7px; border:1px solid #567366; color:#b9d2c7; font-size:10px; font-style:normal; }
.queue-item.pending em { border-color:#d3a442; color:#f1cf77; }
.workspace { min-width:0; padding:20px; }
.workspace-empty { min-height:60vh; display:grid; place-content:center; text-align:center; color:var(--muted); }
.workspace-empty strong { color:#fff; font-size:22px; }
.workspace-empty span { margin-top:8px; }
.editor-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; padding-bottom:14px; border-bottom:1px solid var(--line); }
.editor-head small { color:var(--gold); font-weight:900; }
.editor-head h2 { margin:3px 0; font-size:28px; }
.editor-head p { margin:0; color:var(--muted); font-size:12px; }
.editor-head a { padding:10px 13px; background:#25483b; border:1px solid #5b806f; color:#fff; text-decoration:none; }
.editor-body { display:grid; grid-template-columns:minmax(360px,.9fr) minmax(410px,1.1fr); gap:18px; }
.crop-workspace,.order-workspace { min-width:0; }
.crop-stage { height:min(55vh,560px); min-height:360px; display:grid; place-items:center; background:#08100d; border:1px solid var(--line); overflow:hidden; touch-action:none; }
.crop-frame { position:relative; width:min(88%,500px); aspect-ratio:1; overflow:hidden; background:#fff; box-shadow:0 0 0 2px var(--gold),0 12px 34px rgba(0,0,0,.45); }
.crop-frame img { position:absolute; left:50%; top:50%; max-width:none; transform-origin:center; user-select:none; pointer-events:none; }
.crop-grid { position:absolute; inset:0; pointer-events:none; background:linear-gradient(to right,transparent 33.1%,rgba(255,255,255,.55) 33.3%,transparent 33.5%,transparent 66.4%,rgba(255,255,255,.55) 66.6%,transparent 66.8%),linear-gradient(to bottom,transparent 33.1%,rgba(255,255,255,.55) 33.3%,transparent 33.5%,transparent 66.4%,rgba(255,255,255,.55) 66.6%,transparent 66.8%); }
.crop-toolbar { display:grid; grid-template-columns:auto auto auto minmax(180px,1fr) auto auto auto; gap:8px; align-items:center; margin-top:10px; }
.crop-toolbar button { min-height:42px; border:1px solid #4d6d60; background:#172b23; color:#fff; padding:8px 11px; cursor:pointer; }
.crop-toolbar .replace-photo { border-color:#79a5d8; background:#234568; font-weight:900; }
.crop-toolbar .replace-photo:disabled { opacity:.5; cursor:wait; }
.crop-toolbar .confirm-photo { border-color:var(--green); background:#17684d; font-weight:900; }
.crop-toolbar .confirm-photo.confirmed { border-color:var(--gold); background:#76581a; }
.crop-toolbar label { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:12px; }
.crop-toolbar input { min-width:100px; accent-color:var(--green); }
.crop-help { margin:9px 0 0; color:var(--muted); font-size:12px; }
.order-head { display:flex; align-items:end; justify-content:space-between; gap:12px; margin-bottom:10px; }
.order-head b,.order-head span { display:block; }
.order-head span { margin-top:3px; color:var(--muted); font-size:11px; }
.order-head strong { color:var(--gold); }
.photo-order-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
.order-photo { position:relative; min-width:0; border:2px solid transparent; background:#1a2a24; padding:0; color:#fff; cursor:pointer; }
.order-photo.active { border-color:var(--gold); }
.order-photo.confirmed::after { content:'확정'; position:absolute; right:3px; top:3px; background:#0a7351; padding:2px 4px; font-size:9px; font-weight:900; }
.order-photo-frame { position:relative; width:100%; aspect-ratio:1; overflow:hidden; background:#fff; }
.order-photo img { position:absolute; left:50%; top:50%; display:block; max-width:none; }
.order-photo footer { display:grid; grid-template-columns:1fr auto auto; align-items:center; gap:2px; padding:4px; }
.order-photo footer b { font-size:11px; }
.order-photo footer button { width:24px; height:24px; border:0; background:#2c463b; color:#fff; cursor:pointer; }
.editor-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.editor-actions button { min-height:48px; border:1px solid #59766a; background:#21382f; color:#fff; padding:10px 18px; cursor:pointer; }
.final-output-actions { display:grid; gap:8px; min-width:min(100%,360px); }
.editor-actions .finalize-button { border-color:var(--gold); background:#86651d; font-weight:900; }
.editor-actions .export-jpg-button { border-color:var(--green); background:#17684d; font-weight:900; }
.editor-actions .finalize-button:disabled,.editor-actions .export-jpg-button:disabled { opacity:.35; cursor:not-allowed; }
.editor-progress { margin-top:14px; }
.editor-progress div { display:flex; justify-content:space-between; color:var(--muted); font-size:12px; }
.editor-progress progress { width:100%; height:12px; accent-color:var(--green); }
.editor-message { min-height:24px; color:var(--green); font-weight:700; }
@keyframes alertPulse { 50% { background:#fff0b4; } }
@media(max-width:1050px){ .admin-layout{grid-template-columns:250px minmax(0,1fr)} .editor-body{grid-template-columns:1fr} .crop-stage{height:480px} }
@media(max-width:720px){ .admin-header{padding:12px;align-items:flex-start}.admin-header h1{font-size:17px}.admin-header nav{display:grid}.admin-layout{display:block}.queue-panel{border-right:0;border-bottom:1px solid var(--line)}.queue-list{display:flex;max-height:none;overflow:auto}.queue-item{min-width:190px}.workspace{padding:12px}.editor-head h2{font-size:22px}.crop-stage{height:auto;min-height:0;aspect-ratio:1}.crop-toolbar{grid-template-columns:repeat(3,1fr)}.crop-toolbar label{grid-column:1/-1}.photo-order-grid{grid-template-columns:repeat(4,1fr)}.editor-actions{display:grid}.editor-actions button,.final-output-actions{width:100%} }
@media(prefers-reduced-motion:reduce){.new-alert{animation:none}}

.session-dialog{width:min(92vw,460px);padding:0;border:1px solid #55776b;border-radius:8px;background:#122a22;color:#f5f6f1;box-shadow:0 24px 80px rgba(0,0,0,.55)}
.session-dialog::backdrop{background:rgba(4,12,9,.78)}
.session-form{display:grid;gap:14px;padding:28px}
.session-form small{color:#d8b557;font-size:11px;font-weight:900}
.session-form h2{margin:0;font-size:25px;letter-spacing:0}
.session-form>p{margin:0;color:#b8c8c1;font-size:14px;line-height:1.6}
.session-form label{display:grid;gap:7px;color:#dfe8e4;font-size:13px;font-weight:800}
.session-form input{width:100%;height:48px;box-sizing:border-box;border:1px solid #628579;border-radius:5px;padding:0 13px;background:#fff;color:#17241f;font:inherit}
.session-form button{height:50px;border:0;border-radius:5px;background:#1a7557;color:#fff;font:inherit;font-weight:900;cursor:pointer}
.session-form button:disabled{opacity:.55;cursor:wait}
#adminSessionMessage{min-height:22px;color:#ffb0a8}
.editor-head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.editor-head-actions .cloud-delete-button{min-height:42px;border:1px solid #b85c54;background:#6f2926;color:#fff;padding:10px 13px;font-weight:900;cursor:pointer}
.editor-head-actions .cloud-delete-button:hover,.editor-head-actions .cloud-delete-button:focus-visible{background:#8d332f}
.delete-dialog{width:min(92vw,520px);padding:0;border:1px solid #a8554f;border-radius:8px;background:#211513;color:#f8f3ef;box-shadow:0 24px 80px rgba(0,0,0,.62)}
.delete-dialog::backdrop{background:rgba(7,4,4,.82)}
.delete-form{display:grid;gap:14px;padding:28px}
.delete-form small{color:#ff9b91;font-size:11px;font-weight:900}
.delete-form h2{margin:0;font-size:25px}
.delete-form p{margin:0;color:#d8c4c0;line-height:1.65}
.delete-form p strong{color:#fff}
.delete-form #deleteSubmissionMeta{color:#ffb0a8;font-size:13px;font-weight:800}
.delete-form .local-copy-note{padding:10px 12px;border:1px solid #69534e;background:#2a211e;color:#d8cfca;font-size:12px}
.delete-form label{display:flex;align-items:flex-start;gap:9px;padding:12px;border:1px solid #84504b;background:#331f1d;color:#fff;font-size:13px;font-weight:800}
.delete-form label input{flex:0 0 auto;width:19px;height:19px;margin:0;accent-color:#c9463e}
.delete-form>div{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.delete-form button{min-height:48px;border:1px solid #705d58;background:#332824;color:#fff;font-weight:900;cursor:pointer}
.delete-form button.danger{border-color:#e36b62;background:#8d332f}
.delete-form button.danger:disabled{opacity:.36;cursor:not-allowed}
#cloudDeleteStatus{min-height:22px;color:#ffb0a8;font-size:13px;font-weight:800}
@media(max-width:720px){.editor-head{align-items:flex-start;flex-wrap:wrap}.editor-head-actions{width:100%;justify-content:stretch}.editor-head-actions>*{flex:1;text-align:center}}
