:root {
  --bg: #080b12;
  --panel: #0e141f;
  --panel-2: #121a28;
  --line: #1e2a3d;
  --text: #e6edf7;
  --muted: #8494ad;
  --accent: #5eead4;
  --accent-2: #7c8cff;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 10% -10%, #142033 0%, var(--bg) 55%);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

/* sidebar */
.side { border-right: 1px solid var(--line); background: rgba(10, 15, 24, .85); padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; letter-spacing: .2px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 18px var(--accent); }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: var(--muted); margin-bottom: 4px; }
.nav a:hover { background: #141d2b; color: var(--text); }
.nav a.active { background: linear-gradient(90deg, rgba(94,234,212,.12), rgba(124,140,255,.10)); color: var(--text); box-shadow: inset 0 0 0 1px rgba(94,234,212,.18); }
.nav .ico { width: 18px; text-align: center; opacity: .9; }
.side-foot { position: absolute; bottom: 16px; left: 14px; right: 14px; color: var(--muted); font-size: 11px; }
.side-foot .key { font-family: ui-monospace, monospace; color: #9fb3c8; }

/* main */
.main { padding: 22px 26px 60px; max-width: 1280px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 12px; letter-spacing: .2px; }
.sub { color: var(--muted); font-size: 12.5px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: linear-gradient(180deg, rgba(18,26,40,.9), rgba(14,20,31,.92)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h2 { display: flex; justify-content: space-between; align-items: center; }
.card.narrow { max-width: 720px; }
.stat { font-size: 26px; font-weight: 700; letter-spacing: -.4px; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 500; }

/* forms */
label.field { display: block; margin-bottom: 10px; }
label.field > span { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .6px; }
input, select, textarea {
  width: 100%; background: #0a1018; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: rgba(94,234,212,.55); box-shadow: 0 0 0 3px rgba(94,234,212,.08); }
textarea { min-height: 74px; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  background: #131c2a; color: var(--text); padding: 9px 14px; border-radius: 9px; cursor: pointer;
}
.btn:hover { border-color: #2b3d59; background: #172234; }
.btn.primary { background: linear-gradient(135deg, #0f766e, #0e7490); border-color: #14b8a6; color: #eafffb; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.hint { color: var(--muted); font-size: 12px; }
.err { color: var(--bad); font-size: 12.5px; }
.ok { color: var(--ok); font-size: 12.5px; }

/* table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .7px; font-weight: 600; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; border: 1px solid transparent; }
.badge.ok { color: #a7f3d0; background: rgba(52,211,153,.10); border-color: rgba(52,211,153,.3); }
.badge.bad { color: #fecaca; background: rgba(248,113,113,.10); border-color: rgba(248,113,113,.3); }
.badge.warn { color: #fde68a; background: rgba(251,191,36,.10); border-color: rgba(251,191,36,.28); }
.badge.muted { color: var(--muted); background: #101827; border-color: var(--line); }
.badge.info { color: #c7d2fe; background: rgba(124,140,255,.12); border-color: rgba(124,140,255,.3); }

/* launch builder */
.creative { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #0b121c; }
.creative .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.chip-set { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; cursor: pointer; color: var(--muted); background: #0a1018; }
.chip input { width: auto; }
.chip.on { border-color: rgba(94,234,212,.5); color: var(--text); background: rgba(94,234,212,.07); }
.progress { height: 8px; border-radius: 999px; background: #0a1018; border: 1px solid var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s ease; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.checklist li:last-child { border-bottom: none; }
.checklist .tick { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font-size: 11px; }
.checklist li.done { color: var(--text); }
.checklist li.done .tick { background: rgba(52,211,153,.15); border-color: rgba(52,211,153,.45); color: var(--ok); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0a1018; }
.media-item .thumb { height: 96px; background: #0d1521 center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.media-item .meta { padding: 8px 10px; font-size: 11.5px; }
.media-item .meta div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast { position: fixed; right: 20px; bottom: 20px; background: #101a28; border: 1px solid var(--line); padding: 12px 16px; border-radius: 10px; box-shadow: 0 18px 40px rgba(0,0,0,.45); max-width: 420px; z-index: 30; }
.toast.bad { border-color: rgba(248,113,113,.5); }
.empty { color: var(--muted); text-align: center; padding: 26px 10px; font-size: 13px; }
.split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar { flex-wrap: wrap; }
  .main { min-width: 0; }
  .side { position: static; height: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; overflow: visible; }
  .brand { padding: 0 10px 0 0; white-space: nowrap; }
  .nav { display: flex; gap: 6px; flex-wrap: wrap; }
  .nav a { margin: 0; white-space: nowrap; }
  .side-foot { display: none; }
  .main { padding: 16px; }
  .split { grid-template-columns: 1fr; }
  .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------- thumbnail picker */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(6, 10, 18, .72); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 90; padding: 18px;
}
.modal {
  background: var(--panel, #121826); border: 1px solid rgba(255,255,255,.09); border-radius: 14px;
  width: min(1040px, 100%); max-height: 92vh; overflow: auto; padding: 16px 18px 18px;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.thumb.big { height: 190px; border-radius: 10px; background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px;
  border: 1px dashed rgba(255,255,255,.16); }
.frames { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.frames .frame { height: 74px; border-radius: 7px; cursor: pointer; border: 2px solid transparent; object-fit: cover; opacity: .78; }
.frames .frame:hover { opacity: 1; }
.frames .frame.on { border-color: var(--accent, #4f8cff); opacity: 1; }
.thumb-badge { position: absolute; bottom: 6px; left: 6px; font-size: 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.warn { color: #f0b429; }

.media-item .thumb { position: relative; }
/* ================================================================
   AdLaunch — Studio (AdLaunch launch builder / AdManage parity)
   ================================================================ */
.main:has(.studio) { max-width: 1560px; }
.studio {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: #0b111a; display: flex; flex-direction: column;
}
.studio-top {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #101827, #0c131d);
}
.st-field { flex: 1 1 190px; min-width: 165px; }
.st-field > span { display: block; font-size: 10px; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.studio-top select { padding: 8px 10px; font-size: 12.5px; }
.studio-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }

.studio-body { display: grid; grid-template-columns: minmax(330px, 408px) minmax(0, 1fr); align-items: stretch; }
.studio-left {
  border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 12px;
  background: #0a111a; max-height: calc(100vh - 250px); overflow: auto;
}
.studio-right { padding: 12px 14px 16px; min-width: 0; display: flex; flex-direction: column; }

.st-card { background: #0e1520; border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
.st-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.st-card-head h3 { margin: 0; font-size: 13.5px; font-weight: 650; letter-spacing: .1px; }
.st-head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-link { background: none; border: 0; color: #8ea6c4; font-size: 11.5px; cursor: pointer; padding: 2px 0; }
.st-link:hover { color: var(--accent); }
.st-sub { color: var(--muted); font-size: 11px; line-height: 1.55; margin: 2px 0 8px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px;
  padding: 0 7px; border-radius: 999px; background: #16202f; border: 1px solid var(--line);
  font-size: 10.5px; color: #9fb3c8; font-weight: 600;
}

.st-search { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.st-search input { padding: 7px 9px; font-size: 12px; }
.st-chip-static {
  white-space: nowrap; font-size: 10.5px; color: #9fd8ff; background: rgba(56, 189, 248, .09);
  border: 1px solid rgba(56, 189, 248, .25); border-radius: 999px; padding: 4px 9px;
}
.st-adsets { max-height: 236px; overflow: auto; padding-right: 2px; }
.st-group { margin-bottom: 8px; }
.st-group-head {
  display: flex; justify-content: space-between; font-size: 10.5px; color: #7f94ac;
  text-transform: uppercase; letter-spacing: .5px; padding: 4px 2px;
}
.st-set {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 7px 9px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; margin-bottom: 3px;
}
.st-set:hover { background: #131d2b; }
.st-set.on { background: rgba(94, 234, 212, .06); border-color: rgba(94, 234, 212, .32); }
.st-set input { width: auto; margin: 0; accent-color: #14b8a6; }
.st-set-name { font-size: 12.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-set-id { font-size: 10px; color: #6f8299; font-family: ui-monospace, monospace; }
.st-empty { color: var(--muted); font-size: 12px; padding: 14px 6px; text-align: center; }

.st-label { display: block; font-size: 11px; color: #93a7bf; margin: 10px 0 4px; }
.st-label > span { display: block; }
.st-label input, .st-label select, .st-area { margin-top: 5px; }
.st-area { min-height: 82px; font-size: 12.5px; line-height: 1.5; }
.st-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-copy-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.st-seg { display: flex; margin-top: 5px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.st-seg button { flex: 1; background: #0a1018; border: 0; padding: 8px 6px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.st-seg button.on { background: rgba(94, 234, 212, .12); color: #d7fffa; box-shadow: inset 0 0 0 1px rgba(94, 234, 212, .35); }
.st-naming { display: flex; gap: 6px; }
.st-naming input { font-family: ui-monospace, monospace; font-size: 11.5px; }
.st-preview-name { font-size: 11px; color: var(--muted); margin-top: 6px; }
.st-preview-name span { color: #b9d7ff; font-family: ui-monospace, monospace; }
.st-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.st-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; padding: 3px 8px;
  background: #101a28; border: 1px solid var(--line); border-radius: 6px; color: #b9c8da;
}
.st-chip b { color: #7fd1ff; font-weight: 600; }

.st-ads-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.st-ads-head h3 { margin: 0; font-size: 14px; }
.st-type-btn {
  background: #111b28; border: 1px solid var(--line); color: #cfe0f2; border-radius: 8px;
  padding: 6px 10px; font-size: 11.5px; cursor: pointer;
}
.st-icon { background: none; border: 1px solid var(--line); color: #a9bdd4; border-radius: 7px; width: 28px; height: 28px; cursor: pointer; }
.st-ads-wrap { flex: 1; min-height: 320px; }
.st-ads-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 10px; align-content: start; }
.st-ad {
  background: #0e1520; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column; transition: border-color .15s ease, transform .15s ease;
}
.st-ad:hover { border-color: #2c3f58; }
.st-ad.sel { border-color: rgba(94, 234, 212, .55); box-shadow: 0 0 0 1px rgba(94, 234, 212, .25); }
.st-adthumb {
  position: relative; aspect-ratio: 1 / 1; background: #0a1018 center/cover no-repeat;
  display: grid; place-items: center; border-bottom: 1px solid var(--line);
}
.st-adthumb.has .st-ph { display: none; }
.st-ph { display: grid; gap: 2px; place-items: center; color: #5c7189; font-size: 22px; }
.st-ph small { font-size: 10px; }
.st-sizetag {
  position: absolute; left: 7px; bottom: 7px; font-size: 9.5px; padding: 2px 6px; border-radius: 5px;
  background: rgba(6, 11, 18, .78); color: #cfe0f2; border: 1px solid rgba(255, 255, 255, .08);
}
.st-check {
  position: absolute; top: 7px; left: 7px;
}
.st-check, .st-set input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0;
  appearance: none; -webkit-appearance: none; display: grid; place-items: center;
  border: 1px solid rgba(214, 232, 248, .45); border-radius: 4px;
  background: rgba(6, 11, 18, .6); cursor: pointer; transition: background .12s, border-color .12s;
}
.st-check:hover, .st-set input[type="checkbox"]:hover { border-color: rgba(94, 234, 212, .8); }
.st-check:checked, .st-set input[type="checkbox"]:checked { background: #14b8a6; border-color: #14b8a6; }
.st-check:checked::after, .st-set input[type="checkbox"]:checked::after { content: "✓"; font-size: 11px; font-weight: 800; line-height: 1; color: #04211f; }
.st-thumb-edit {
  position: absolute; top: 7px; right: 7px; opacity: 0; transition: opacity .15s;
  background: rgba(6, 11, 18, .82); border: 1px solid rgba(255, 255, 255, .14); color: #dbe9f7;
  font-size: 10px; padding: 3px 7px; border-radius: 6px; cursor: pointer;
}
.st-ad:hover .st-thumb-edit { opacity: 1; }
.st-adname {
  border: 0; border-radius: 0; background: transparent; padding: 8px 9px 2px; font-size: 12px;
}
.st-adname:focus { box-shadow: none; border: 0; background: #0a1018; }
.st-admeta { display: flex; align-items: center; gap: 6px; padding: 0 9px 8px; font-size: 10px; color: #6f8299; }
.st-admeta b { font-size: 10.5px; color: #9fb3c8; font-weight: 500; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-admeta > span { margin-left: auto; }
.st-admenu { display: flex; gap: 2px; }
.st-admenu button { background: none; border: 0; color: #7b8ea6; cursor: pointer; font-size: 11px; padding: 2px 3px; }
.st-admenu button:hover { color: var(--text); }
.st-addtile {
  min-height: 184px; border: 1px dashed #2a3a50; border-radius: 10px; background: transparent;
  color: #7087a0; display: grid; place-items: center; gap: 4px; cursor: pointer; font-size: 11.5px;
}
.st-addtile span { font-size: 22px; }
.st-addtile:hover { border-color: rgba(94, 234, 212, .5); color: #cfe0f2; }

.st-tablewrap { grid-column: 1 / -1; }
.st-table th, .st-table td { padding: 6px 6px; font-size: 12px; }
.st-table input { padding: 6px 8px; font-size: 12px; }

.st-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-top: 1px solid var(--line); background: rgba(11, 17, 26, .96);
  backdrop-filter: blur(6px); flex-wrap: wrap;
}
.st-bar-left, .st-bar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-bar-right { margin-left: auto; }
.st-summary { font-size: 12px; color: #9fb3c8; }
.st-summary b { color: #eafffb; }
.st-progress { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: transparent; }
.st-progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }

/* ---------------------------------------------------------- media / naming modals */
.st-modal { width: min(1040px, 100%); }
.st-libbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.st-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; max-height: 46vh; overflow: auto; }
.st-lib {
  border: 1px solid var(--line); border-radius: 9px; background: #0c1420; padding: 0; overflow: hidden;
  text-align: left; cursor: pointer; display: flex; flex-direction: column;
}
.st-lib.on { border-color: rgba(94, 234, 212, .65); box-shadow: 0 0 0 1px rgba(94, 234, 212, .3); }
.st-lib-thumb { aspect-ratio: 1/1; background: #0a1018 center/cover no-repeat; display: grid; place-items: center; color: #6f8299; font-size: 11px; }
.st-lib-name { font-size: 11px; padding: 6px 8px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #cfe0f2; }
.st-lib-meta { font-size: 9.5px; padding: 1px 8px 7px; color: #6f8299; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.st-naming-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; }
.st-panel { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #0c1420; }
.st-panel-head { font-size: 11.5px; font-weight: 600; color: #a9bdd4; margin-bottom: 8px; }
.st-conv { display: flex; flex-wrap: wrap; gap: 5px; min-height: 38px; padding: 6px; background: #0a1018; border: 1px dashed var(--line); border-radius: 8px; }
.st-conv-chip { font-family: ui-monospace, monospace; font-size: 11px; padding: 3px 7px; border-radius: 5px; background: rgba(94, 234, 212, .09); color: #bff7ee; cursor: pointer; }
.st-tags { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin-top: 10px; }
.st-tag { font-family: ui-monospace, monospace; font-size: 10.5px; padding: 5px 7px; border-radius: 6px; background: #101a28; border: 1px solid var(--line); color: #b9c8da; cursor: pointer; }
.st-tag:hover { border-color: rgba(94, 234, 212, .45); }
.st-conv-preview { min-height: 46px; padding: 8px 10px; border-radius: 8px; background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .35); color: #b8f7d8; font-family: ui-monospace, monospace; font-size: 11.5px; }
.st-opt { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: #a9bdd4; padding: 6px 0; }
.st-opt input { width: auto; }
.st-token { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: #a9bdd4; margin-top: 8px; }
.st-token select { width: 96px; }

.st-adtype { width: min(720px, 100%); }
.st-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 10px; }
.st-type { text-align: left; border: 1px solid var(--line); background: #0c1420; border-radius: 9px; padding: 10px; cursor: pointer; }
.st-type b { display: block; font-size: 12px; color: #dbe9f7; }
.st-type span { font-size: 10.5px; color: var(--muted); }
.st-type.on { border-color: rgba(94, 234, 212, .55); background: rgba(94, 234, 212, .06); }
.st-type.off { opacity: .45; cursor: not-allowed; }

/* ---------------------------------------------------------- ad preview modal */
.st-preview-back { padding: 10px; }
.st-preview {
  width: min(1180px, 100%); height: min(780px, 94vh); display: grid; grid-template-columns: minmax(0, 1fr) 452px;
  background: #0b1119; border: 1px solid rgba(255, 255, 255, .09); border-radius: 14px; overflow: hidden;
}
.st-preview-left { background: #eef1f5; color: #1c1e21; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.st-mock-top { display: flex; justify-content: space-between; align-items: center; }
.st-mock-tabs { display: inline-flex; background: #dde3ea; border-radius: 8px; padding: 2px; }
.st-mock-tabs span { font-size: 11px; padding: 5px 10px; border-radius: 6px; color: #46535f; }
.st-mock-tabs span.on { background: #1c1e21; color: #fff; }
.st-feed { margin: 0 auto; width: min(360px, 100%); background: #fff; border-radius: 10px; box-shadow: 0 8px 26px rgba(20, 30, 45, .14); overflow: hidden; }
.st-feed-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px 6px; }
.st-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #2dd4bf, #6366f1); color: #04222a; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.st-feed-head b { font-size: 12px; display: block; }
.st-feed-head .st-verified { color: #1d9bf0; font-size: 10px; }
.st-feed-head small { font-size: 10px; color: #6b7785; }
.st-dots { margin-left: auto; color: #6b7785; }
.st-feed-text { padding: 2px 12px 9px; font-size: 11.5px; line-height: 1.5; }
.st-more { color: #6b7785; }
.st-feed-media { aspect-ratio: 1 / 1; background: #dfe6ee center/cover no-repeat; display: grid; place-items: center; color: #7b8794; font-size: 11px; }
.st-feed-link { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 9px 12px; background: #f2f4f7; }
.st-feed-link small { color: #6b7785; font-size: 9.5px; text-transform: uppercase; }
.st-feed-link b { display: block; font-size: 11.5px; }
.st-feed-link span { font-size: 10px; color: #5c6773; }
.st-cta { background: #e4e6eb; border: 0; border-radius: 5px; padding: 7px 10px; font-size: 10.5px; font-weight: 600; color: #1c1e21; white-space: nowrap; }
.st-feed-actions { display: flex; justify-content: space-around; border-top: 1px solid #e4e6eb; padding: 8px 6px; font-size: 10.5px; color: #46535f; }
.st-mock-foot { margin-top: auto; }
.st-mock-foot .hint { color: #6b7785; letter-spacing: .6px; font-size: 10px; }
.st-platforms { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.st-platforms span { width: 30px; height: 30px; border: 1px solid #cfd8e3; border-radius: 8px; display: grid; place-items: center; color: #46535f; font-size: 13px; background: #fff; }
.st-platforms span.on { border-color: #1d9bf0; box-shadow: 0 0 0 1px #1d9bf0 inset; }

.st-preview-right { border-left: 1px solid var(--line); overflow: auto; padding: 14px 16px 20px; background: #0b1119; }
.st-preview-head { display: flex; align-items: flex-start; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.st-preview-head b { font-size: 13px; display: block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-newbadge { font-size: 9px; letter-spacing: .8px; padding: 2px 6px; border-radius: 4px; background: rgba(124, 140, 255, .14); color: #c7d2fe; border: 1px solid rgba(124, 140, 255, .3); white-space: nowrap; }
.st-x { margin-left: auto; background: none; border: 0; color: #8ea6c4; cursor: pointer; font-size: 14px; }
.st-sec { margin-top: 14px; }
.st-sec-head { font-size: 10px; letter-spacing: .9px; color: #7f94ac; text-transform: uppercase; display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.st-source, .st-dest { background: #0e1724; border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.st-source { display: flex; gap: 8px; align-items: flex-start; }
.st-source b { font-size: 12px; }
.st-dest-row { display: flex; align-items: center; gap: 9px; }
.st-dest-row b { font-size: 12.5px; }
.st-dest-ico { width: 26px; height: 26px; border-radius: 7px; background: rgba(56, 189, 248, .1); border: 1px solid rgba(56, 189, 248, .25); color: #7fd1ff; display: grid; place-items: center; font-size: 12px; }
.st-dest-row .st-icon { margin-left: auto; }
.ok-dot { color: #34d399; }
.st-linkline { margin-top: 8px; padding: 6px 8px; border-radius: 6px; background: #0a1018; border: 1px solid var(--line); color: #8ea6c4; word-break: break-all; font-size: 10px; }
.st-asset { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: #0e1724; border-radius: 9px; padding: 8px; }
.st-asset-thumb { width: 44px; height: 44px; border-radius: 7px; background: #0a1018 center/cover no-repeat; border: 1px solid var(--line); flex: none; }
.st-asset b { font-size: 11.5px; display: block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-asset .st-icon { margin-left: auto; }
.st-var { background: #0e1724; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
.st-var b { display: block; font-size: 10px; color: #7f94ac; text-transform: uppercase; letter-spacing: .6px; }
.st-var span { font-size: 11.5px; color: #cfe0f2; }
.st-preview-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }

/* ---------------------------------------------------------- claude page */
.st-claude-hero {
  display: flex; gap: 14px; align-items: center; padding: 16px 18px; margin-bottom: 14px;
  border: 1px solid rgba(124, 140, 255, .28); border-radius: 14px;
  background: radial-gradient(120% 180% at 0% 0%, rgba(124, 140, 255, .16), transparent 60%), #0b111a;
}
.st-claude-badge {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 12px;
  background: linear-gradient(135deg, #6366f1, #22d3ee); color: #051018; flex: none;
}
.st-claude-hero h2 { margin: 0 0 4px; font-size: 17px; }
.st-urlbox { display: flex; align-items: center; gap: 8px; background: #0a1018; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; margin-top: 8px; }
.st-urlbox code { flex: 1; font-size: 11px; color: #9fe8ff; word-break: break-all; }
.st-cmdbox { margin-top: 12px; background: #0a1018; border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.st-cmdbox pre { margin: 6px 0 8px; font-size: 10.5px; color: #b9d7ff; white-space: pre-wrap; word-break: break-all; }
.st-pre { background: #0a1018; border: 1px solid var(--line); border-radius: 9px; padding: 10px; font-size: 11px; color: #9fe8ff; min-height: 120px; white-space: pre-wrap; margin-top: 10px; }
.st-steps { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: #a9bdd4; line-height: 1.85; }

@media (max-width: 1180px) {
  .st-preview { grid-template-columns: minmax(0, 1fr) 400px; }
}
@media (max-width: 980px) {
  .studio-body { grid-template-columns: minmax(0, 1fr); }
  .studio-left { border-right: 0; border-bottom: 1px solid var(--line); max-height: none; }
  .st-preview { grid-template-columns: minmax(0, 1fr); height: 94vh; overflow: auto; }
  .st-preview-left { display: none; }
  .st-naming-grid { grid-template-columns: minmax(0, 1fr); }
  .st-two { grid-template-columns: minmax(0, 1fr); }
  .studio-top { align-items: stretch; }
  .st-field { flex: 1 1 100%; }
  .st-bar-right { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* ================================================================
   Studio v2 — inline editable builder (Meta Ads style)
   ================================================================ */
.st-kbd { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.st-setchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.st-setchip { display: inline-flex; align-items: center; gap: 4px; background: #131c2a; border: 1px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 10px; font-size: 12px; max-width: 100%; }
.st-setchip-label, .st-setchip-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-x { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 11px; padding: 2px 5px; border-radius: 6px; line-height: 1; }
.st-x:hover { color: var(--bad); background: rgba(248, 113, 113, .12); }

.st-setlist { max-height: 208px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #0b111a; }
.st-setitem { display: flex; gap: 8px; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid rgba(30, 42, 61, .55); padding: 7px 9px; cursor: pointer; color: var(--text); }
.st-setitem:last-child { border-bottom: 0; }
.st-setitem:hover { background: #131c2a; }
.st-setitem.on { background: rgba(94, 234, 212, .07); }
.st-tick { width: 16px; height: 16px; border: 1px solid var(--line); border-radius: 4px; display: grid; place-items: center; font-size: 10px; color: var(--accent); flex: none; margin-top: 2px; }
.st-setitem.on .st-tick { background: rgba(94, 234, 212, .16); border-color: var(--accent); }
.st-setitem-body { display: flex; flex-direction: column; min-width: 0; }
.st-setitem-body b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-setitem-body small { color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-setfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.st-select { background: #131c2a; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.st-select:hover { border-color: var(--accent); }
.st-modehint { margin-top: 6px; font-size: 10.5px; }

.st-blocktabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; padding-bottom: 9px; border-bottom: 1px dashed var(--line); }
.st-btab { background: #101827; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 12px; cursor: pointer; display: flex; flex-direction: column; line-height: 1.3; color: var(--text); }
.st-btab small { font-size: 10px; color: var(--muted); max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-btab.on { border-color: var(--accent); background: rgba(94, 234, 212, .09); }
.st-btab-add, .st-btab-del { justify-content: center; color: var(--muted); }
.st-btab-add:hover { color: var(--accent); border-color: var(--accent); }

.st-f { margin-bottom: 13px; }
.st-fhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 5px; }
.st-fhead label { font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.st-count { font-size: 10.5px; color: var(--muted); }
.st-frow { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 5px; }
.st-inputrow { display: flex; gap: 6px; margin-top: 4px; }
.st-input { flex: 1; min-width: 0; background: #0b111a; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 12.5px; color: var(--text); }
.st-input:hover { border-color: #2b3c55; }
.st-input:focus, .st-area:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(94, 234, 212, .1); }
.st-mini { background: #131c2a; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12px; max-width: 158px; color: var(--text); }

.st-varlist { display: flex; flex-direction: column; gap: 5px; margin-top: 7px; }
.st-varlist .st-var { display: flex; align-items: center; gap: 8px; background: #0b111a; border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; cursor: pointer; text-align: left; color: var(--text); width: 100%; }
.st-varlist .st-var.on { border-color: var(--accent); background: rgba(94, 234, 212, .07); }
.st-var-n { width: 18px; height: 18px; border-radius: 50%; background: #16202f; display: grid; place-items: center; font-size: 10px; color: var(--muted); flex: none; }
.st-var-t { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.st-var-t em { color: var(--muted); }
.st-addvar { background: transparent; border: 1px dashed var(--line); border-radius: 9px; padding: 6px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.st-addvar:hover { color: var(--accent); border-color: var(--accent); }

.st-launchrow { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; }
.st-switch { width: 44px; height: 24px; border-radius: 999px; border: 1px solid var(--line); background: #131c2a; position: relative; cursor: pointer; padding: 0; flex: none; }
.st-switch i { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #5b6b82; transition: .16s ease; }
.st-switch.on { background: rgba(94, 234, 212, .22); border-color: var(--accent); }
.st-switch.on i { left: 22px; background: var(--accent); }

.st-block { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; background: #0a0f18; overflow: hidden; }
.st-block.on { border-color: rgba(94, 234, 212, .32); }
.st-block-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #0e141f; flex-wrap: wrap; }
.st-block-name { background: transparent; border: 0; color: var(--text); font-weight: 600; cursor: pointer; padding: 0; font-size: 12.5px; }
.st-block-head .hint { font-size: 10.5px; }
.st-block-head .st-head-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.st-ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 10px; padding: 10px; }
.st-ad { border: 1px solid var(--line); border-radius: 10px; background: #0e141f; overflow: hidden; }
.st-ad.empty { border-style: dashed; }
.st-ad-thumb { position: relative; aspect-ratio: 1 / 1; background: #131c2a center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 22px; }
.st-ad-src { position: absolute; left: 6px; bottom: 6px; font-size: 9px; text-transform: uppercase; letter-spacing: .7px; background: rgba(8, 11, 18, .78); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--muted); }
.st-ad-body { padding: 7px 8px 8px; }
.st-adname { width: 100%; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 3px 5px; font-size: 12.5px; font-weight: 600; resize: none; overflow: hidden; color: var(--text); }
.st-adname:hover { border-color: var(--line); }
.st-adname:focus { outline: none; border-color: var(--accent); background: #0b111a; }
.st-admeta { display: flex; gap: 4px; font-size: 10px; color: var(--muted); margin: 3px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-adacts { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.st-ads.as-table { grid-template-columns: 1fr; }
.st-ads.as-table .st-ad { display: grid; grid-template-columns: 84px 1fr; align-items: stretch; }
.st-ads.as-table .st-ad-thumb { aspect-ratio: auto; min-height: 84px; }

.st-pop { position: fixed; z-index: 90; width: 292px; background: #0e141f; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); overflow: hidden; }
.st-pop-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 12px; }
.st-pop-list { max-height: 248px; overflow: auto; padding: 4px; }
.st-popitem { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 8px; padding: 6px 8px; cursor: pointer; color: var(--text); }
.st-popitem:hover { background: #16202f; }
.st-popitem.on { background: rgba(94, 234, 212, .1); }
.st-popitem code { font-size: 11.5px; color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.st-popitem small { font-size: 10.5px; color: var(--muted); }
.st-pop-foot { padding: 6px 10px; border-top: 1px solid var(--line); font-size: 10px; }

.pv-ed { display: inline; border-radius: 5px; cursor: text; outline: 1px dashed transparent; padding: 0 2px; margin: 0 -2px; }
.pv-ed:hover { background: rgba(94, 234, 212, .09); outline-color: rgba(94, 234, 212, .45); }
.pv-input { width: 100%; background: #0b111a; border: 1px solid var(--accent); border-radius: 6px; padding: 3px 6px; font-size: inherit; font-family: inherit; color: var(--text); resize: vertical; }
.st-preview-right { display: flex; flex-direction: column; min-height: 0; }
.st-pvscroll { overflow: auto; flex: 1; min-height: 0; padding-right: 2px; }
.st-pvfoot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 0 0; border-top: 1px solid var(--line); margin-top: 8px; }
.st-pvchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.st-pvchip { border: 1px solid var(--line); background: #0b111a; border-radius: 8px; padding: 3px 8px; font-size: 11px; }
.st-pvchip b { color: var(--muted); font-weight: 600; margin-right: 5px; }
.st-pvchip .pv-ed { font-size: 11px; }
.st-vargroup { margin-bottom: 10px; }
.st-vargroup > b { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 4px; }
.st-pvvar { display: flex; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12px; margin-bottom: 4px; cursor: pointer; background: #0b111a; }
.st-pvvar:hover { border-color: #2b3c55; }
.st-pvvar.on { border-color: var(--accent); background: rgba(94, 234, 212, .08); }
.st-pvvar span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.st-pvvar-on { color: var(--accent); font-size: 10px; white-space: nowrap; flex: none; }
.st-details summary { cursor: pointer; font-size: 10.5px; letter-spacing: .6px; color: var(--muted); text-transform: uppercase; }
.st-dl { display: grid; grid-template-columns: 104px 1fr; gap: 4px 10px; margin: 8px 0 0; font-size: 11.5px; }
.st-dl dt { color: var(--muted); }
.st-dl dd { margin: 0; word-break: break-all; }
.st-dest-body { min-width: 0; flex: 1; }
.st-feed-linktext { min-width: 0; flex: 1; }
.st-pv-title { min-width: 0; }
.st-pv-title b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-name { font-size: 13px; }
.st-preview-back.shared { background: #080b12; }

@media (max-width: 900px) {
  .st-ads { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .st-pop { width: min(92vw, 320px); }
  .st-preview-right { max-height: none; }
}


/* ---- studio v2 fixes: creative rail uses the full column width ---- */
.st2 .st-ads-wrap { display: block; }
.st2 .st-block { width: 100%; }
.st2 .st-ads { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.st2 .st-ad-thumb { aspect-ratio: 1 / 1; min-height: 180px; }
.st2 .st-ad-thumb .st-ad-src { z-index: 1; }
.st2 .st-block-head .hint { white-space: nowrap; }
@media (max-width: 900px) {
  .st2 .st-ads { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

.st2 .st-bar { box-sizing: border-box; width: 100%; }
.st2 .st-bar-right { padding-right: 2px; }
.st2 .st-ad-src { left: 8px; bottom: 8px; top: auto; right: auto; padding: 2px 7px; border-radius: 4px; }
.st2 .st-admeta span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.st2 .st-block-name { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
