/* JustListedKit Studio */
[hidden] { display: none !important; }
.studio { background: var(--bg, #eef0f3); color: #14161b; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px; height: 58px; background: #0e1116; color: #fff; flex: none;
}
.brand { font-weight: 800; font-size: 18px; color: #fff; text-decoration: none; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.brand-mark { color: var(--brand, #2ece94); }
.tpl-picker { display: flex; gap: 4px; background: #1b2027; padding: 4px; border-radius: 10px; }
.tpl-btn { border: 0; background: transparent; color: #aab2bd; font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 7px; cursor: pointer; display: flex; flex-direction: column; line-height: 1.15; align-items: center; }
.tpl-btn small { font-weight: 400; font-size: 10px; opacity: .7; }
.tpl-btn.active { background: #fff; color: #0e1116; }
.tpl-btn .lock { font-size: 10px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lic-pill { background: rgba(46,206,148,.15); color: #2ece94; font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 20px; }

.workspace { flex: 1; display: grid; grid-template-columns: 400px 1fr; min-height: 0; }

/* form */
.form-panel { overflow-y: auto; background: #fff; border-right: 1px solid #e4e7ec; padding: 8px 22px 60px; }
.group { padding: 20px 0; border-bottom: 1px solid #eef0f3; }
.group:last-child { border-bottom: 0; }
.group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #8a919d; margin: 0 0 14px; font-weight: 700; }
.group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.group-head h3 { margin: 0; }
.fld { display: block; margin-bottom: 13px; }
.fld > span { display: block; font-size: 13px; font-weight: 600; color: #3b424e; margin-bottom: 5px; }
.fld > span em { font-weight: 400; color: #9aa1ac; font-style: normal; }
.fld input[type=text], .fld textarea {
  width: 100%; box-sizing: border-box; border: 1px solid #d7dbe1; border-radius: 9px;
  padding: 10px 12px; font-size: 14px; font-family: inherit; background: #fbfbfc; color: #14161b;
}
.fld input:focus, .fld textarea:focus { outline: none; border-color: var(--brand, #0e5c43); background: #fff; box-shadow: 0 0 0 3px rgba(14,92,67,.1); }
.fld input[type=file] { font-size: 13px; width: 100%; }
.fld textarea { resize: vertical; line-height: 1.45; }
.hint { color: #9aa1ac; font-size: 12px; display: block; margin-top: 4px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.row-4 .fld > span { font-size: 12px; }

.seg { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.seg button { border: 1px solid #d7dbe1; background: #fbfbfc; border-radius: 8px; padding: 9px 4px; font-size: 12px; font-weight: 600; color: #3b424e; cursor: pointer; }
.seg button.active { background: var(--brand, #0e5c43); border-color: var(--brand, #0e5c43); color: #fff; }

.color-row { display: flex; align-items: center; gap: 10px; }
input[type=color] { width: 42px; height: 34px; border: 1px solid #d7dbe1; border-radius: 8px; background: #fff; padding: 3px; cursor: pointer; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #d7dbe1; cursor: pointer; }
.swatch.active { box-shadow: 0 0 0 2px var(--brand, #0e5c43); }

.saved { display: flex; flex-direction: column; gap: 8px; }
.saved .muted { color: #9aa1ac; font-size: 13px; margin: 0; }
.saved-item { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid #e4e7ec; border-radius: 9px; }
.saved-item img { width: 46px; height: 40px; object-fit: cover; border-radius: 6px; background: #eef0f3; }
.saved-item .si-main { flex: 1; min-width: 0; }
.saved-item .si-main b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-item .si-main span { font-size: 12px; color: #9aa1ac; }
.saved-item button { border: 0; background: none; cursor: pointer; font-size: 13px; color: #6b7280; padding: 4px 6px; }
.saved-item button:hover { color: #14161b; }

/* preview */
.preview-panel { display: flex; flex-direction: column; min-height: 0; padding: 16px 22px 20px; }
.format-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex: none; }
.format-tabs button { border: 1px solid #d7dbe1; background: #fff; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; color: #3b424e; cursor: pointer; }
.format-tabs button.active { background: #14161b; border-color: #14161b; color: #fff; }
.stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.canvas-wrap { position: relative; max-height: 100%; box-shadow: 0 12px 40px rgba(20,22,27,.16); border-radius: 4px; overflow: hidden; }
#preview { display: block; max-height: calc(100vh - 250px); max-width: 100%; width: auto; height: auto; }
.lock-overlay { position: absolute; inset: 0; background: rgba(14,17,22,.72); color: #fff; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.lock-overlay strong { font-size: 18px; display: block; margin-bottom: 6px; }
.lock-overlay p { font-size: 14px; opacity: .85; margin: 0 0 16px; max-width: 260px; }

.exports { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; flex: none; }
.export-note { text-align: center; color: #9aa1ac; font-size: 12px; margin: 8px 0 0; }

/* buttons */
.btn { border: 1px solid #d7dbe1; background: #fff; color: #14161b; font-weight: 600; font-size: 14px; padding: 10px 18px; border-radius: 9px; cursor: pointer; font-family: inherit; }
.btn:hover { border-color: #b9bfc8; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-primary { background: var(--brand, #0e5c43); border-color: var(--brand, #0e5c43); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--brand, #0e5c43); }
.btn-ghost { background: transparent; border-color: #3a424d; color: #fff; }
.btn-ghost:hover { background: #1b2027; }
.btn-big { width: 100%; padding: 15px; font-size: 16px; margin-top: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(14,17,22,.6); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-card { background: #fff; border-radius: 18px; padding: 34px; max-width: 420px; width: 100%; position: relative; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal-x { position: absolute; top: 16px; right: 16px; border: 0; background: none; font-size: 18px; color: #9aa1ac; cursor: pointer; }
.modal-card h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.02em; }
.modal-sub { color: #6b7280; margin: 0 0 18px; }
.perks { list-style: none; padding: 0; margin: 0 0 8px; }
.perks li { padding: 8px 0 8px 28px; position: relative; font-size: 15px; border-bottom: 1px solid #f0f2f5; }
.perks li::before { content: "✓"; position: absolute; left: 0; color: var(--brand, #0e5c43); font-weight: 800; }
.activate { margin-top: 20px; border-top: 1px solid #eef0f3; padding-top: 18px; }
.activate p { font-size: 13px; color: #6b7280; margin: 0 0 8px; }
.activate input { width: 100%; box-sizing: border-box; border: 1px solid #d7dbe1; border-radius: 9px; padding: 11px 12px; font-size: 14px; margin-bottom: 8px; }
.activate .btn { width: 100%; }
.err { color: #d1435b !important; }

@media (max-width: 900px) {
  .studio { height: auto; overflow: auto; }
  .workspace { grid-template-columns: 1fr; }
  .form-panel { border-right: 0; }
  #preview { max-height: 70vh; }
  .tpl-picker { display: none; }
}
