:root{
  --main-color:#4F8BED;
}

html { margin-top: 0 !important; background: #f9f9f9; }
main { margin-top: 0 !important; padding-top: 1.5rem; background: #f9f9f9; }
footer, .kk-footer { display: none; }
.wp-site-blocks { padding-bottom: 0 !important; }
.wp-block-template-part { margin: 0 !important; padding: 0 !important; }
.wp-block-template-part .has-global-padding { padding: 0 !important; }
.wp-block-post-title { display: none; }
.nemodi-mcard-wrap { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; max-width: 980px !important; margin: 0 auto !important; }
.wp-block-post-content > .elementor { max-width: 900px; }

/* 좌측: 미리보기 및 저장하기 버튼*/
.nemodi-mcard-left { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; width: 350px; position: sticky; top: calc(97px + 3rem); }
.nemodi-preview-card { width: 100%; border-radius: 14px; overflow: hidden; background: #F4F5F7; border: 1px solid #e1e1e1; } 
.nemodi-preview-iframe { width: 100%; aspect-ratio: 9 / 16; border: 0; display: block; background: #fff; }
.nemodi-actions--left { margin-top: 14px; width: 100%; }
.nemodi-actions--left .nemodi-btn { width: 100%; line-height: 56px; background: var(--main-color); border-radius: 14px; border: 0; font-size: 18px; font-weight: 700; color: #fff; }
.nemodi-actions--left .nemodi-btn { box-shadow: 0 0 10px 2px rgba(0,0,0,0.05); }

/* 우측: 폼 */
.nemodi-mcard-right { flex: 1; min-width: 320px; }
.nemodi-mcard-form { padding: 0; border-radius: 14px; box-sizing: border-box; }
#nemodiMcardForm h3 { margin: 50px 0 20px; font-size: 16px; font-weight: 700; color: #111; } 
#nemodiMcardForm h3:first-child { margin-top: 40px;} 
#nemodiMcardForm .nemodi-field { display: flex; justify-content: flex-start; align-items: flex-start; gap: 7px; margin-bottom: 7px; }
#nemodiMcardForm .nemodi-field label { margin: 10px 0 0; width: 110px; flex-shrink: 0; font-size: 14px; color: #616161; }
#nemodiMcardForm .nemodi-field label .req { color: #ED4F4F; font-weight: 700; }
#nemodiMcardForm .nemodi-field input[type="text"], #nemodiMcardForm .nemodi-field textarea, #nemodiMcardForm .nemodi-field input[type="tel"],
#nemodiMcardForm .nemodi-field input[type="date"], #nemodiMcardForm .nemodi-field input[type="time"] { padding: 7px 20px; width: 100%; height: 44px; border: 1px solid #ddd; border-radius: 7px; font-size: 14px; outline: none; box-sizing: border-box; flex-grow: 1; color: #3e3e3e; }
#nemodiMcardForm .nemodi-field textarea { padding-top: 14px; padding-bottom: 14px; height: 140px; line-height: 135%; }
#nemodiMcardForm .nemodi-field input[type="text"]:focus, #nemodiMcardForm .nemodi-field textarea:focus, #nemodiMcardForm .nemodi-field input[type="tel"]:focus,
#nemodiMcardForm .nemodi-field input[type="date"]:focus, #nemodiMcardForm .nemodi-field input[type="time"]:focus { outline:none; box-shadow:0 0 5px 2px rgba(59,130,246,.12); }
#nemodiMcardForm .nemodi-field input::placeholder, #nemodiMcardForm .nemodi-field textarea::placeholder { color: #9e9e9e; }
#nemodiMcardForm .nemodi-color-combo { position: relative; width: 150px; }
#nemodiMcardForm .nemodi-color-combo .nemodi-color-text { padding-right: 64px !important; width: 100%; border: 1px solid #ddd; border-radius: 7px; } 
#nemodiMcardForm .nemodi-color-combo .nemodi-color-picker { 
  position: absolute; right: 1px; bottom: 1px; padding: 0; width: 42px; height: 42px; border-radius: 0 7px 7px 0; border: 0;
  border-top-left-radius: 0; border-bottom-left-radius: 0; cursor:pointer; background:transparent; overflow: hidden;
}
#nemodiMcardForm .nemodi-color-picker .nemodi-color-chip { width: 100%; height: 100%; border-left: 1px solid #ddd; background: #fff; display: block; }
#nemodiMcardForm .nemodi-file-input{ display:none; }

#nemodiMcardForm .nemodi-photo-box { 
  position: relative; width: 148px; height: 148px; border-radius: 7px; background: #fff; border: 1px solid #ddd;
  display: flex; justify-content: center; align-items: center; background-size: cover; background-position: center; background-repeat: no-repeat; cursor: pointer; 
}
#nemodiMcardForm .nemodi-photo-box:focus { outline:none; box-shadow:0 0 5px 2px rgba(59,130,246,.12); }
#nemodiMcardForm .nemodi-photo-box img { width: 18px; height: 14px; object-fit: contain; }
#nemodiMcardForm .nemodi-photo-box.has-image .nemodi-photo-icon { display: none; }

#nemodiMcardForm .nemodi-photo-remove { 
  position: absolute; top: 4px; right: 4px; padding: 0; width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(0,0,0,0.5); 
  color: #fff; font-size: 16px; line-height: 0; display: none; text-align: center;
}
#nemodiMcardForm .nemodi-photo-box.has-image .nemodi-photo-remove { display:block; }

#nemodiMcardForm .nemodi-help { position: relative; margin: 7px 0 0; padding-left: 19px; line-height: 135%; font-size: 13px; color: #656565; word-break: keep-all; }
#nemodiMcardForm .nemodi-help span { font-weight: 700; }
#nemodiMcardForm .nemodi-help:before { 
  position: absolute; top: 1px; left: 0; width: 14px; line-height: 12px; border: 1px solid #ED4F4F; border-radius: 50%; 
  display: block; content: "!"; text-align: center; font-size: 9px; font-weight: 900; color: #ED4F4F; box-sizing: border-box; 
}
#nemodiMcardForm .nemodi-mgTop-28 { margin-top: 28px; }

/* 커스텀 피커 레이어 */
.nm-cp-layer { position:fixed; inset:0; z-index:10000; display: none; pointer-events: none; }
.nm-cp-layer.is-open { display: block; pointer-events: auto; }
.nm-cp-panel { position:absolute; left:0; top:0; transform:none; width:260px; background:#fff; border-radius:5px; border: 1px solid #ddd; padding:12px; user-select:none; }
.nm-cp-sv { position:relative; overflow: hidden; }
#nmCpSV { display:block; width:100%; height:auto; border-radius:3px; }
.nm-cp-knob { position:absolute; width:12px; height:12px; border-radius:50%; border:1px solid #fff; box-shadow:0 1px 5px rgba(0,0,0,.5); transform:translate(-6px,-50%); pointer-events:none; }
.nm-cp-hue { position:relative; margin-top:10px; }
#nmCpHue { display:block; width:100%; height:12px; border-radius:3px; }
.nm-cp-hue-knob { position:absolute; top:50%; width:12px; height:12px; border-radius:50%; border:1px solid #fff; background: #fff; box-shadow:0 1px 5px rgba(0,0,0,.5); transform:translate(-6px,-50%); pointer-events:none; }
.nm-cp-row { display:flex; align-items:center; gap:5px; margin-top:10px; }
.nm-cp-hex { flex:1; padding:10px 12px; width: calc(100% - 50px); border:1px solid #ddd; border-radius:3px; font-size:14px; }
.nm-cp-close { width: 50px; line-height: 34px; border:1px solid #ddd; border-radius:3px; background:#fff; cursor:pointer; font-size: 13px; flex-shrink: 0; text-align: center; }

/* 토글 */
.nm-switch { position: absolute; left: 32px; display: flex; align-items: center; }
.nm-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.nm-switch-ui { width: 32px; height: 14px; border-radius: 7px; background: #E4E4E4; position: relative; transition: background .05s ease; cursor: pointer; }
.nm-switch-ui::after { position: absolute; top: -3px; left: 0; transition: transform .15s ease; width: 20px; height: 20px; border-radius: 50%; background: #BCBCBC; content: ""; box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, .2); }
.nm-switch input:checked + .nm-switch-ui { background: #D5E2F8; }
.nm-switch input:checked + .nm-switch-ui::after { background: var(--main-color); transform: translateX(12px); }

/* 아코디언 */
.nm-acc{ border-radius: 14px; background:#fff; box-shadow: 0 8px 30px rgba(0,0,0,.06); margin: 0 0 14px; overflow:hidden; }
.nm-acc-head { position: relative; width:100%; display:flex; align-items:center; justify-content:space-between; gap:10px; padding: 24px 26px 24px 77px; border:0; background:transparent; cursor:pointer; }
.nm-acc-title{ font-weight:700; font-size:16px; color: #111; }
.nm-acc-arrow { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: 0 0 22px; }
.nm-acc-arrow-img { width: 100%; height: 100%; display: block; transform: rotate(0deg); transition: transform .18s ease; }
.nm-acc[data-open="1"] .nm-acc-arrow-img { transform: rotate(180deg); }
.nm-acc-body{ padding: 0 32px 25px 32px; }
.nm-acc[data-open="0"] .nm-acc-body{ display:none; }

/* 갤러리 */
.nm-upload-row { flex-grow:1; }
.nm-upload-btn { width:100% !important; height:44px; border:1px solid #ddd; border-radius:7px; display:flex; align-items:center; justify-content:center; cursor:pointer; background:#fff; }
.nm-upload-btn-text-wrap { display: flex; justify-content: center; align-items: center; gap: 7px; }
.nm-upload-btn-text { font-size:14px; color:#919191; font-weight:500; }
.nm-upload-btn-text-wrap .nemodi-photo-icon { width: 18px; height: 100%; }
.nm-upload-thumbs { margin-top:20px; display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:7px; }
.nm-upload-thumb { position:relative; width:100%; padding-top:100%; border-radius:7px; overflow:hidden; background:#eee center/cover no-repeat; border:1px solid #e5e5e5; }
.nm-upload-thumb button { position:absolute; top:4px; right:4px; width:22px; height:22px; border:0; border-radius:999px; background:rgba(0,0,0,.55); color:#fff; cursor:pointer; font-size:14px; line-height:19px; }
.nm-upload-thumb .nm-upload-pending { position:absolute; left:0; right:0; bottom:0; padding:4px 6px; font-size:11px; color:#fff; background:rgba(0,0,0,.35); text-align:center; }

/* 위치 안내 */
.nm-input-with-btn { position: relative; }
.nm-input-with-btn input{ padding-right: 40px !important; width: 100%; cursor:pointer; }
.nm-addr-search { position: absolute; top: 0; right: 0; width: 40px; height: 100%; border: 0; background: none; }
.nm-address .nemodi-field textarea { height: 80px !important; }

/* 주소 검색 레이어 */
.nm-postcode-layer { position:fixed; inset:0; z-index:9999; }
.nm-postcode-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.55); }
.nm-postcode-panel { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:min(500px, calc(100vw - 24px)); height:min(70vh, 500px); background:#fff; border-radius:14px; overflow:hidden; box-shadow:0 20px 60px rgba(0,0,0,.25); display:flex; flex-direction:column; }
.nm-postcode-head { height:52px; display:flex; align-items:center; justify-content:center; border-bottom:1px solid #eee; position:relative; }
.nm-postcode-title { font-size:15px; color:#333; font-weight:600; }
.nm-postcode-x { position:absolute; right:10px; top:50%; transform:translateY(-50%); margin-top: -2px; width:32px; height:32px; border:0; background:transparent; font-size:24px; cursor:pointer; color:#777; font-family:"Pretendard"; }
.nm-postcode-wrap { flex:1; min-height:0; }

/* 마음 전하실 곳 */
hr.nemodi-space01 { margin: 30px 0; border-top: 1px solid #fdfdfd; }
.nm-money-box { flex-grow: 1; display: flex; flex-direction: column; gap: 7px; }
.nm-money-two { display: flex; gap: 7px; }
.nm-money-two input[type="text"] { width: 50%; }
.nm-money-box > input[type="text"] { width: 100%; }

@media all and (max-width: 900px){
  .wp-block-post-content { padding: 0 14px; }
}
