/* 화면에서 바로 고치는 편집기 */
.ie-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 10px 14px;
  background: #fffefb;
  border: 1px solid #ddd0c3;
  border-radius: 12px;
  box-shadow: 0 4px 16px #44351a14;
}
.ie-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ie-bar button {
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #efe7e0;
  color: #4a3d31;
  font-size: 14px;
}
.ie-bar button:disabled { opacity: .4; }
.ie-save { margin-left: auto; }
.ie-save span { font-size: 13px; color: #7e6b58; }
.ie-save span.unsaved { color: #b0561f; font-weight: 700; }
.ie-bar #save-btn { background: #75624f; color: #fff; font-weight: 700; padding: 6px 18px; }
.ie-bar #save-btn:disabled { background: #cbbfb3; color: #fff; opacity: 1; }
.ie-hint { margin: 10px 2px; font-size: 13.5px; line-height: 1.6; color: #6e6055; }
.ie-stage { display: flex; justify-content: center; }
.ie-stage iframe {
  width: min(100%, 430px);
  height: calc(100dvh - 128px - var(--sheet-h, 0px));
  min-height: 420px;
  border: 1px solid #d7cdc4;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 30px #44351a1a;
}
.ie-adv { margin-top: 26px; background: #fffefb; border: 1px solid #ddd0c3; border-radius: 12px; padding: 4px 18px 14px; }
.ie-adv > summary { padding: 14px 0; cursor: pointer; font-weight: 700; color: #6e6055; }
.ie-adv details { border-top: 1px solid #eee5dc; }
.ie-adv details summary { padding: 12px 0; cursor: pointer; }
.ie-adv label { display: block; margin: 10px 0; }
.ie-adv label span { display: block; margin-bottom: 5px; font-size: 13px; color: #75624f; }
.ie-adv input:not([type="checkbox"]), .ie-adv textarea { width: 100%; }

.ie-sheet {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  max-height: 52dvh;
  background: #fff;
  color: #39352f;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 30px #2d252233;
  font: 15px/1.5 system-ui, sans-serif;
}
.ie-sheet[hidden] { display: none; }
.ie-sheet > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #eee5dc; }
.ie-sheet > header button { min-height: 36px; padding: 4px 18px; background: #75624f; color: #fff; border-radius: 8px; font-size: 14px; }
.ie-sheet-body { padding: 12px 16px 18px; overflow-y: auto; }
.ie-field { display: block; margin: 10px 0; }
.ie-field > span { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 13px; color: #75624f; }
.ie-field input:not([type="range"]):not([type="color"]) { width: 100%; }
.ie-field input[type="range"] { width: 100%; padding: 0; accent-color: #987b62; }
.ie-field input[type="color"] { width: 100%; height: 42px; padding: 4px; }
.ie-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.ie-note { margin: 10px 0 0; font-size: 12.5px; line-height: 1.6; color: #8b7563; }
.ie-more { margin-top: 10px; }
.ie-more summary { cursor: pointer; font-size: 13px; color: #75624f; }
.ie-danger-btn, .ie-primary-btn { width: 100%; margin-top: 12px; min-height: 42px; }
.ie-danger-btn { background: #f6e4e1; color: #9a3b32; }
.ie-primary-btn { background: #75624f; color: #fff; }
.ie-share-card { width: min(280px, 100%); margin: 6px auto; overflow: hidden; border-radius: 4px; background: #fff; box-shadow: 0 2px 8px #46536340; border: 1px solid #e7e2dd; }
.ie-share-photo { position: relative; display: block; width: 100%; height: 240px; padding: 0; border: 0; border-radius: 0; background: #ddd; }
.ie-share-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ie-share-photo span { position: absolute; right: 8px; bottom: 8px; padding: 4px 10px; border-radius: 999px; background: #39352fcc; color: #fff; font-size: 12px; }
.ie-share-card > div { padding: 10px 12px 12px; }
.ie-share-card input { display: block; width: 100%; padding: 4px 6px; border: 1px dashed #c5b3a3; border-radius: 3px; background: transparent; }
.ie-share-card .t { font-weight: 700; font-size: 14px; }
.ie-share-card .d { margin: 4px 0 8px; color: #6d6d6d; font-size: 12.5px; }
.ie-share-card .b { padding: 6px; background: #f3f4f5; }
.ie-share-card .bt { text-align: center; font-size: 12.5px; }

.ie-bar .short { display: none; }
@media (max-width: 999px) {
  .ie-bar { padding: 8px 10px; gap: 6px 8px; justify-content: flex-start; }
  .ie-bar button { min-height: 36px; padding: 4px 9px; font-size: 13px; }
  .ie-bar .full { display: none; }
  .ie-bar .short { display: inline; }
  .ie-save { width: 100%; justify-content: space-between; margin-left: 0; }
  .ie-hint { font-size: 13px; }
  .ie-stage iframe { height: calc(100dvh - 190px - var(--sheet-h, 0px)); border-radius: 0; border-left: 0; border-right: 0; }
}
@media (min-width: 1000px) {
  .ie-sheet { left: auto; right: 28px; bottom: auto; top: 130px; transform: none; width: 340px; max-height: calc(100dvh - 170px); border-radius: 14px; box-shadow: 0 8px 34px #2d252244; }
}

@media (max-width: 900px) {
  /* 관리자 좌우 여백을 없애 미리보기 폭 = 손님 폰 화면 폭 */
  .ie-stage { margin: 0 -18px; }
  .ie-stage iframe { width: 100vw; max-width: none; border-left: 0; border-right: 0; border-radius: 0; }
}

.album-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 18px; }
.album-tools button { background: #75624f; color: #fff; }
.media-card .danger-link { background: transparent; color: #9a3b32; border: 1px solid #e3c9c5; }

.ie-check { display: flex; align-items: center; gap: 6px; margin: 10px 0; font-size: 14px; }
.ie-check input { width: auto; }
.ie-field select { width: 100%; min-height: 40px; padding: 6px 10px; }
.msg-row { background: #fff; border: 1px solid #e3d9d0; border-radius: 10px; padding: 12px 16px; margin: 10px 0; }
.msg-row p { margin: 6px 0; white-space: pre-wrap; }
