:root{
  --ink:#0D1512; --ink-soft:#182420; --ink-line:#1E2E28;
  --emerald:#10B981; --emerald-deep:#059669;
  --text-light:#F1EEE7; --text-dim:#93A39B; --danger:#E15B4D;
}
*{ box-sizing:border-box; }
[hidden]{ display:none !important; }
html,body{ margin:0; padding:0; }
body{
  background:var(--ink); color:var(--text-light); font-family:'Inter',sans-serif;
  min-height:100vh; padding-bottom:40px;
}

.topbar{
  display:flex; align-items:center; gap:12px; padding:16px 20px;
  border-bottom:1px solid var(--ink-line);
}
.back-btn{
  width:34px; height:34px; border-radius:10px; background:var(--ink-soft);
  border:1px solid var(--ink-line); color:var(--text-light);
  display:flex; align-items:center; justify-content:center; text-decoration:none; flex-shrink:0;
}
.back-btn svg{ width:18px; height:18px; }
.topbar-brand{
  display:flex; align-items:center; gap:10px;
  font-family:'Space Grotesk',sans-serif; font-size:17px; font-weight:700; letter-spacing:0.02em;
}
.topbar-icon{
  width:30px; height:30px; border-radius:9px; background:linear-gradient(135deg,#f09433,#dc2743 55%,#bc1888);
  display:flex; align-items:center; justify-content:center; flex-shrink:0; color:#fff;
}
.topbar-icon svg{ width:17px; height:17px; }

.hint-bar{
  display:flex; align-items:center; gap:8px; color:var(--text-dim); font-size:12.5px;
  padding:12px 20px; border-bottom:1px solid var(--ink-line);
}
.hint-icon{ display:flex; flex-shrink:0; }
.hint-icon svg{ width:15px; height:15px; }

.content{ max-width:480px; margin:0 auto; padding:20px; }

.prop-block{
  background:var(--ink-soft); border:1px solid var(--ink-line); border-radius:16px;
  padding:16px; margin-bottom:14px;
}
.section-label{ font-size:12px; font-weight:600; letter-spacing:0.03em; color:var(--text-dim); text-transform:uppercase; margin-bottom:10px; }

textarea{
  width:100%; background:var(--ink); border:1px solid var(--ink-line); color:var(--text-light);
  font-family:'Inter',sans-serif; font-size:15px; padding:12px 14px; border-radius:12px;
  outline:none; resize:vertical; min-height:76px; transition:border-color 0.15s ease;
}
textarea:focus{ border-color:var(--emerald); }
textarea::placeholder{ color:var(--text-dim); }

.toggle-row{ display:flex; gap:8px; flex-wrap:wrap; }
.toggle-chip{
  display:flex; align-items:center; gap:7px;
  background:var(--ink); border:1px solid var(--ink-line); color:var(--text-dim);
  font-family:'Inter',sans-serif; font-size:13px; font-weight:500;
  padding:9px 13px; border-radius:20px; cursor:pointer; transition:border-color 0.15s ease, color 0.15s ease;
}
.toggle-chip.active{ border-color:var(--emerald); color:var(--text-light); }
.chip-dot{ width:8px; height:8px; border-radius:50%; flex-shrink:0; background:#3A4A44; transition:background 0.15s ease; }
.toggle-chip.active .dot-dark{ background:#000; box-shadow:0 0 0 1px #566; }
.toggle-chip.active .dot-hd{ background:var(--emerald); }
.toggle-chip.active .dot-nobg{
  background-image:
    linear-gradient(45deg, #444 25%, transparent 25%), linear-gradient(-45deg, #444 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #444 75%), linear-gradient(-45deg, transparent 75%, #444 75%);
  background-size:5px 5px; background-position:0 0, 0 2.5px, 2.5px -2.5px, -2.5px 0; background-color:#999;
}

.preview-wrap{ margin-bottom:16px; }
.preview-label{ font-size:11px; font-weight:600; letter-spacing:0.06em; color:var(--text-dim); text-align:center; margin-bottom:10px; }
.stage-outer{
  position:relative; display:flex; align-items:center; justify-content:center; padding:16px;
  background:
    linear-gradient(45deg, #1a2420 25%, transparent 25%), linear-gradient(-45deg, #1a2420 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1a2420 75%), linear-gradient(-45deg, transparent 75%, #1a2420 75%);
  background-size:24px 24px; background-position:0 0, 0 12px, 12px -12px, -12px 0; background-color:var(--ink);
  border-radius:16px; border:1px solid var(--ink-line);
}
#canvas{ width:100%; max-width:300px; height:auto; display:block; border-radius:6px; }
.empty-hint{
  position:absolute; inset:16px; display:flex; align-items:center; justify-content:center;
  color:var(--text-dim); font-size:13px; text-align:center; padding:20px; pointer-events:none;
}
.empty-hint.hidden{ display:none; }

.ghost-btn{
  width:100%; background:transparent; color:var(--text-dim); border:1px solid var(--ink-line);
  font-family:'Inter',sans-serif; font-size:13.5px; font-weight:500; padding:12px 14px; border-radius:12px;
  cursor:pointer; margin-top:10px;
}
.ghost-btn:active{ background:var(--ink-soft); }
.ghost-btn:disabled, .btn-download-main:disabled{ opacity:0.45; pointer-events:none; }

.btn-download-main{
  width:100%; background:var(--emerald-deep); color:#fff; border:none;
  font-family:'Inter',sans-serif; font-size:15px; font-weight:600;
  padding:14px 14px; border-radius:14px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:8px;
  transition:transform 0.1s ease;
}
.btn-download-main:active{ transform:scale(0.98); }
.btn-download-main svg{ width:19px; height:19px; }

.quota-note{ text-align:center; font-size:12px; color:var(--text-dim); margin-bottom:10px; min-height:16px; }
.quota-note.low{ color:var(--danger); }

.toast{
  position:fixed; left:50%; bottom:24px; transform:translateX(-50%) translateY(12px);
  background:var(--ink-soft); border:1px solid var(--ink-line); color:var(--text-light);
  padding:11px 18px; border-radius:12px; font-size:13.5px;
  display:flex; align-items:center; gap:8px; opacity:0; pointer-events:none;
  transition:opacity 0.2s ease, transform 0.2s ease; box-shadow:0 12px 28px -10px rgba(0,0,0,0.5);
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.toast svg{ width:17px; height:17px; color:#5FD98A; flex-shrink:0; }

/* ---- IG Post ---- */
.drop-btn{
  width:100%; display:flex; align-items:center; justify-content:center; gap:12px; min-height:76px;
  background:var(--ink); border:1.5px dashed var(--ink-line); border-radius:12px; color:var(--text-dim);
  font-family:'Inter',sans-serif; font-size:14px; padding:10px; cursor:pointer;
}
.drop-btn:active{ background:var(--ink-soft); }
.drop-btn img{ width:56px; height:56px; object-fit:cover; border-radius:8px; flex-shrink:0; }
.drop-btn.has{ border-style:solid; color:var(--text-light); }
.drop-text{ overflow-wrap:anywhere; text-align:left; }
.avatar-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:10px; }
.avatar-note{ font-size:12px; color:var(--text-dim); }
.small-btn{
  background:var(--ink); border:1px solid var(--ink-line); color:var(--text-light);
  font-family:'Inter',sans-serif; font-size:12.5px; font-weight:500; padding:8px 12px; border-radius:10px; cursor:pointer;
}
.small-btn:active{ background:var(--ink-soft); }
.small-btn.danger{ color:var(--danger); }
.user-field{
  display:flex; align-items:center; background:var(--ink); border:1px solid var(--ink-line);
  border-radius:12px; padding:0 14px; margin-bottom:10px; transition:border-color 0.15s ease;
}
.user-field:focus-within{ border-color:var(--emerald); }
.user-field .at{ color:var(--text-dim); font-size:15px; margin-right:2px; }
.user-field input{
  flex:1; min-width:0; background:transparent; border:none; outline:none; color:var(--text-light);
  font-family:'Inter',sans-serif; font-size:15px; padding:12px 0;
}
input::placeholder{ color:var(--text-dim); }
.section-label-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.section-label-row .section-label{ margin-bottom:0; }
.section-label .sub{ text-transform:none; letter-spacing:0; font-weight:400; opacity:0.8; }
.num-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.num-grid label{ display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--text-dim); }
.num-grid input{
  background:var(--ink); border:1px solid var(--ink-line); color:var(--text-light); border-radius:12px;
  font-family:'Inter',sans-serif; font-size:15px; padding:11px 14px; outline:none; width:100%;
}
.num-grid input:focus{ border-color:var(--emerald); }
.toggle-chip:disabled{ opacity:0.4; pointer-events:none; }
.stage-outer{ min-height:120px; }
