:root{
  --zf-radius:18px;
  --zf-radius-sm:14px;
  --zf-border:rgba(0,0,0,.08);
  --zf-bg:#fff;
  --zf-sub:rgba(0,0,0,.62);
  --zf-muted:rgba(0,0,0,.45);
  --zf-shadow:0 18px 54px rgba(0,0,0,.24);
  --zf-focus:0 0 0 3px rgba(0,102,204,.16);
  --zf-pad:16px;
  --zf-head-h:52px;
  --zf-foot-h:72px;
}

/* shell */
.zfmodal{position:fixed;inset:0;z-index:99999}
.zfmodal[hidden]{display:none}
.zfmodal__back{position:absolute;inset:0;background:rgba(0,0,0,.52)}

/* panel */
.zfmodal__panel{
  position:absolute;left:50%;top:50%;
  transform:translate(-50%,-50%);
  width:min(740px,92vw);
  max-height:min(84vh,820px);
  background:var(--zf-bg);
  border:1px solid var(--zf-border);
  border-radius:var(--zf-radius);
  box-shadow:var(--zf-shadow);
  overflow:hidden;
}

/* header (left close) */
.zfmodal__head{
  height:var(--zf-head-h);
  display:flex;align-items:center;justify-content:flex-start;
  padding:0 var(--zf-pad);
  border-bottom:1px solid var(--zf-border);
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(12px);
}
.zfmodal__close{
  width:70px;height:70px;border-radius:999px;
  border:1px solid var(--zf-border);
  background:rgba(255,255,255,.9);
  cursor:pointer;font-size:20px;line-height:1;color:#111;
  display:inline-flex;align-items:center;justify-content:center;
}
.zfmodal__close:hover{background:rgba(0,0,0,.04)}
.zfmodal__title{margin-left:10px;font-size:13px;font-weight:900;color:#111}

/* body */
.zfmodal__body{
  padding:var(--zf-pad);
  overflow:auto;
  max-height:calc(84vh - var(--zf-head-h) - var(--zf-foot-h));
}

/* footer (sticky, right action) */
.zfmodal__foot{
  position:sticky;bottom:0;z-index:3;
  height:var(--zf-foot-h);
  display:flex;align-items:center;justify-content:flex-end;gap:10px;
  padding:10px var(--zf-pad);
  border-top:1px solid var(--zf-border);
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(12px);
}

/* form baseline (scoped) */
.zfmodal input,.zfmodal textarea,.zfmodal select{
  font-size:16px;width:100%;
  background:rgba(0,0,0,.02);
  border:1px solid var(--zf-border);
  border-radius:12px;
  padding:11px 12px;
  color:#111;box-sizing:border-box;
}
.zfmodal textarea{resize:vertical;min-height:140px}
.zfmodal input:focus,.zfmodal textarea:focus,.zfmodal select:focus{
  outline:none;border-color:rgba(0,102,204,.55);
  box-shadow:var(--zf-focus);background:#fff;
}
.zfmodal input[type=file]{background:#fff;border:1px dashed rgba(0,0,0,.18);padding:10px;cursor:pointer}
.zfmodal input[type=checkbox]{width:auto}

/* range */
.zfmodal input[type=range]{-webkit-appearance:none;width:100%;background:transparent;height:28px;padding:0}
.zfmodal input[type=range]::-webkit-slider-runnable-track{height:4px;background:rgba(0,0,0,.22);border-radius:3px}
.zfmodal input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;height:18px;width:18px;background:#0066cc;border-radius:50%;margin-top:-7px}

/* buttons */
.zfmodal .zf-btn, .zfmodal button{
  border:none;border-radius:999px;
  padding:10px 14px;font-weight:900;cursor:pointer;font-size:14px;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
}
.zfmodal .zf-btn-primary{
  background:#0066cc;color:#fff;
}
.zfmodal .zf-btn-primary:hover{background:#0057b3}
.zfmodal .zf-btn-ghost{
  background:transparent;border:1px solid rgba(0,0,0,.18);color:#111;
}
.zfmodal .zf-btn-ghost:hover{background:rgba(0,0,0,.04)}
.zf-postnew textarea{
  width:100%;min-height:120px;
  padding:12px;border-radius:12px;
  border:1px solid rgba(0,0,0,.15);
}

.zf-basic-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin:10px 0;
}

.zf-check{display:flex;gap:6px;align-items:center}

.zf-advbtn{
  margin:6px 0;
  border:none;
  background:transparent;
  font-weight:700;
  cursor:pointer;
}

.zf-adv{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid rgba(0,0,0,.1);
}

.zf-adv__label{
  margin:8px 0 4px;
  font-size:12px;
  color:#666;
}
/* quote */
.zf-quote{max-width:680px;margin:0 auto;box-sizing:border-box}
.zf-qbase{border:1px solid var(--zf-border);border-radius:var(--zf-radius-sm);padding:12px;background:#fff}
.zf-qhead{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.zf-qhead img{width:36px;height:36px;border-radius:50%;object-fit:cover;flex:0 0 auto}
.zf-qname{font-size:13px;font-weight:900;line-height:1.2}
.zf-qid{font-size:12px;color:var(--zf-sub)}
.zf-qbody{font-size:14px;line-height:1.6;white-space:pre-wrap;word-break:break-word}
.zf-qtime{margin-top:8px;font-size:11px;color:var(--zf-muted)}

/* mobile: near full-screen */
@media(max-width:600px){
  .zfmodal__panel{
    width:96vw;
    max-height:calc(100vh - 20px);
    border-radius:20px;
  }
  .zfmodal__body{max-height:calc(100vh - 20px - var(--zf-head-h) - var(--zf-foot-h))}
}



.zf-media{margin:10px 0 4px}
.zf-media-label{font-size:13px;color:#555;margin:0 0 8px}
.zf-media-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
@media(max-width:600px){.zf-media-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

.zf-slot{
  position:relative;
  width:100%;
  aspect-ratio:1/1;
  border:1px solid rgba(0,0,0,.14);
  border-radius:14px;
  background:rgba(0,0,0,.02);
  overflow:hidden;
  cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}
.zf-slot:hover{background:rgba(0,0,0,.04)}
.zf-plus{font-size:28px;line-height:1;color:rgba(0,0,0,.45);font-weight:800;transform:translateY(-1px)}
.zf-thumb{width:100%;height:100%;object-fit:cover;display:block}
.zf-x{
  position:absolute;right:6px;top:6px;
  width:28px;height:28px;border-radius:999px;
  border:1px solid rgba(0,0,0,.14);
  background:rgba(255,255,255,.92);
  display:flex;align-items:center;justify-content:center;
  font-size:16px;line-height:1;color:#111;
}
.zf-x:hover{background:#fff}
.zf-badge{
  position:absolute;left:8px;bottom:8px;
  font-size:11px;font-weight:900;
  padding:4px 8px;border-radius:999px;
  background:rgba(0,0,0,.65);color:#fff;
}


.zf-conf-row{
  display:grid;
  grid-template-columns:7fr 3fr;
  gap:12px;
  align-items:end;
  margin:14px 0;
}

.zf-conf-slider{
  display:flex;
  flex-direction:column;
}

.zf-label{
  font-size:13px;
  color:#555;
  margin-bottom:6px;
}

/* checkbox側 */
.zf-noreply{
  height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid rgba(0,0,0,.15);
  border-radius:12px;
  background:rgba(0,0,0,.02);
  cursor:pointer;
  font-size:14px;
  user-select:none;
}

.zf-noreply:hover{
  background:rgba(0,0,0,.05);
}

.zf-noreply input{
  width:auto;
}
