/*
 * Studio on the SignalWealth app theme: same frame as the CRM (sidebar + top bar), theme tokens instead
 * of the old navy/gold palette. Loaded after sw-theme.css and crm-ui.css.
 */
:root, :root[data-theme="dark"] {
  --navy: var(--sw-text);
  --slate: var(--sw-text-2);
  --mid: var(--sw-text-3);
  --gold: var(--sw-accent);
  --gold-light: var(--sw-accent);
  --bg: var(--sw-bg);
  --ivory: var(--sw-accent-soft);
  --line: var(--sw-border);
  --red: var(--sw-err);
  --green: var(--sw-ok);
  --serif: var(--sw-font-display);
  --sans: var(--sw-font-ui);
  --label: var(--sw-font-ui);
}
body { font-size: 14px; color: var(--sw-text); background: var(--sw-bg); }

/* ── Frame ── */
.sw-shell { display: flex; min-height: 100vh; }
.sw-shell > .sidebar {
  position: sticky; top: 0; height: 100vh; width: 248px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--sw-surface); border-right: 1px solid var(--sw-border);
}
.sw-shell > .sidebar .sidebar-nav { flex: 1; display: block; }
.sw-shell > .sidebar .nav-item { text-decoration: none; display: flex; align-items: center; }
.sw-shell > .sidebar .nav-section { text-transform: uppercase; }
.sw-shell > .sidebar .brand-logo { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sw-shell > .sidebar .sidebar-user { display: flex; align-items: center; }
.sw-shell > .sidebar .user-avatar { border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.sw-shell > .sidebar .user-info { min-width: 0; }
.sw-shell > .sidebar .user-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-logo.has-img { background: transparent; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sw-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sw-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px;
  min-height: 64px; padding: 10px 28px; background: var(--sw-surface); border-bottom: 1px solid var(--sw-border);
}
.sw-title { display: flex; flex-direction: column; }
.sw-title h1 { font-family: var(--sw-font-display); font-weight: 600; font-size: 19px; letter-spacing: -.01em; color: var(--sw-text); line-height: 1.2; }
.sw-title span { font-size: 12px; color: var(--sw-text-3); }
.sw-back { display: none; font-size: 14px; color: var(--sw-accent); text-decoration: none; font-weight: 500; }
.sw-topbar .modes { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--sw-border); border-radius: var(--sw-radius); background: var(--sw-bg); }
.sw-topbar .modes button {
  height: 34px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--sw-text-2);
  font-family: var(--sw-font-ui); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none;
}
.sw-topbar .modes button:hover { color: var(--sw-text); border: 0; }
.sw-topbar .modes button.on { background: var(--sw-surface); color: var(--sw-text); box-shadow: var(--sw-shadow-sm); }
:root[data-theme="dark"] .sw-topbar .modes button.on { background: var(--sw-surface-2); }
.sw-topbar-end { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ── Controls ── */
button {
  font-family: var(--sw-font-ui); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none;
  height: 38px; padding: 0 14px; border-radius: var(--sw-radius); border: 1px solid var(--sw-border-strong);
  background: var(--sw-surface); color: var(--sw-text);
}
button:hover { border-color: var(--sw-text-3); }
button.gold { background: var(--sw-btn); border-color: transparent; color: var(--sw-on-accent); }
button.gold:hover { background: var(--sw-btn); filter: brightness(1.08); }
button.danger { color: var(--sw-err); }
.sw-theme-btn { height: 38px; padding: 0; }
input, select, textarea {
  font-family: var(--sw-font-ui); font-size: 14px; color: var(--sw-text); background: var(--sw-surface);
  border: 1px solid var(--sw-border-strong); border-radius: var(--sw-radius); padding: 9px 12px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sw-accent-dim); box-shadow: var(--sw-focus); }
input:disabled, textarea:disabled { background: var(--sw-surface-2); color: var(--sw-text-2); }
label { font-family: var(--sw-font-ui); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--sw-text-2); }
a { color: var(--sw-accent); }
code { background: var(--sw-surface-2); border-radius: 5px; }

/* ── Review list + editor ── */
.wrap { min-height: calc(100vh - 64px); grid-template-columns: 360px 1fr; }
.wrap > aside { background: var(--sw-surface); border-right: 1px solid var(--sw-border); padding: 20px; }
.tabs button { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 999px; }
.tabs button.on { background: var(--sw-accent-soft); color: var(--sw-accent); border-color: transparent; }
.item { border: 1px solid var(--sw-border); border-radius: 12px; background: var(--sw-surface); padding: 14px; }
.item:hover { border-color: var(--sw-border-strong); background: var(--sw-surface); }
.item.on { border-color: var(--sw-accent); background: var(--sw-surface); box-shadow: var(--sw-focus); }
.item__meta { font-family: var(--sw-font-ui); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--sw-text-3); }
.item__title { font-family: var(--sw-font-ui); font-size: 15px; font-weight: 600; color: var(--sw-text); }
.item__sub { font-size: 13px; color: var(--sw-text-2); }
.chip { font-family: var(--sw-font-ui); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; border-radius: 999px; padding: 2px 8px;
  background: var(--sw-surface-2); color: var(--sw-text-2); }
.chip.warn { background: var(--sw-warn-soft); color: var(--sw-warn); }
.chip.fail { background: var(--sw-err-soft); color: var(--sw-err); }
.empty, .autostat, .hint, .url { color: var(--sw-text-2); }
main { padding: 28px 36px 80px; }
.pill { font-family: var(--sw-font-ui); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; border-radius: 999px;
  background: var(--sw-warn-soft); color: var(--sw-warn); }
.pill.approved, .pill.published { background: var(--sw-ok-soft); color: var(--sw-ok); }
.pill.rejected, .pill.failed { background: var(--sw-err-soft); color: var(--sw-err); }
.pill.scheduled, .pill.planned { background: var(--sw-surface-2); color: var(--sw-text-2); }
.flags, .flags.fail, .postbox, .scriptbox, .notes-box {
  border: 1px solid var(--sw-border); border-left-width: 1px; border-radius: var(--sw-radius-lg); background: var(--sw-surface);
}
.flags { background: var(--sw-warn-soft); border-color: transparent; }
.flags.fail { background: var(--sw-err-soft); border-color: transparent; }
.flags h4, .flags.fail h4, .postbox h4, .scriptbox h4, .notes-box h4, details.more summary {
  font-family: var(--sw-font-ui); font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--sw-text);
}
.flags h4 { color: var(--sw-warn); } .flags.fail h4 { color: var(--sw-err); }
.flags li, .notes-box li, .plats, .plats label, .posts div, .spin, td, .pend { color: var(--sw-text); }
.phone { border-radius: 16px; }
.actions { background: color-mix(in srgb, var(--sw-bg) 92%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--sw-border); }
.drop { background: var(--sw-surface); border: 2px dashed var(--sw-border-strong); border-radius: var(--sw-radius-lg); color: var(--sw-text-2); }
.drop.over { border-color: var(--sw-accent); background: var(--sw-accent-soft); }
.drop b { font-family: var(--sw-font-display); color: var(--sw-text); }
.bar { background: var(--sw-surface-2); } .bar i { background: var(--sw-btn); }
table { background: var(--sw-surface); border: 1px solid var(--sw-border); border-radius: var(--sw-radius-lg); border-collapse: separate; border-spacing: 0; overflow: hidden; }
th { font-family: var(--sw-font-ui); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--sw-text-3); border-bottom: 1px solid var(--sw-border); }
td { border-bottom: 1px solid var(--sw-border); }
td button, .spin button, .pend button, .acct button { height: 30px; padding: 0 10px; font-size: 12px; }
h2.sec { font-family: var(--sw-font-display); font-weight: 600; color: var(--sw-text); }
.pend { border: 1px dashed var(--sw-border-strong); border-radius: var(--sw-radius); }
.pend.bad { border-color: color-mix(in srgb, var(--sw-err) 45%, transparent); }
.acct b { color: var(--sw-text); }
#toast { background: var(--sw-text); color: var(--sw-surface); border-radius: var(--sw-radius); box-shadow: var(--sw-shadow-lg); }
#toast.err { background: var(--sw-err); color: #FFFFFF; }
#blocked { background: var(--sw-surface); border: 1px solid var(--sw-border); border-top: 3px solid var(--sw-accent); border-radius: var(--sw-radius-lg); }
#blocked h2 { font-family: var(--sw-font-display); color: var(--sw-text); }

@media (max-width: 900px) {
  .sw-shell { flex-direction: column; }
  .sw-shell > .sidebar { display: none; }
  .sw-back { display: inline-flex; }
  .sw-topbar { padding: 10px 16px; position: static; }
  .sw-topbar .modes { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .sw-topbar .modes button { white-space: nowrap; flex-shrink: 0; }
  .wrap { grid-template-columns: 1fr; }
  main { padding: 20px 16px 80px; }
}

/* ── Platform tiles (Oct 24, 2026): "Post to" as one tile per connected account instead of tick boxes.
   The real checkbox stays inside each tile (visually hidden, still focusable), so forms and keyboard work as before.
   :is(#bs-plats,#e-plats) lifts these above the Studio's #bs / label rules. --pc = the platform's color. ── */
:is(#bs-plats,#e-plats).ptiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,215px),1fr));gap:10px;margin-top:4px;}
:is(#bs-plats,#e-plats) .ptiles__bar{grid-column:1/-1;display:flex;align-items:center;gap:12px;font-size:12.5px;color:var(--sw-text-3);}
:is(#bs-plats,#e-plats) .ptiles__bar .sp{flex:1;}
:is(#bs-plats,#e-plats) .ptiles__bar button{height:auto;background:none;border:0;padding:2px 0;font:600 12.5px var(--sw-font-ui,inherit);letter-spacing:0;text-transform:none;color:var(--sw-accent);cursor:pointer;}
:is(#bs-plats,#e-plats) .ptiles__bar button:hover{text-decoration:underline;}
:is(#bs-plats,#e-plats) .ptile{position:relative;display:flex;gap:11px;align-items:flex-start;margin:0;padding:12px 38px 12px 12px;min-height:66px;
  border:1.5px solid var(--sw-border);border-radius:var(--sw-radius,10px);background:var(--sw-surface);cursor:pointer;
  font:500 14px/1.35 var(--sw-font-ui,inherit);letter-spacing:0;text-transform:none;color:var(--sw-text);white-space:normal;
  transition:border-color .12s,background-color .12s,box-shadow .12s;}
:is(#bs-plats,#e-plats) .ptile:hover{border-color:var(--sw-border-strong);}
:is(#bs-plats,#e-plats) .ptile.is-on{border-color:var(--pc);background:color-mix(in srgb,var(--pc) 7%,var(--sw-surface));}
:is(#bs-plats,#e-plats) .ptile:focus-within{box-shadow:0 0 0 3px color-mix(in srgb,var(--pc) 30%,transparent);}
:is(#bs-plats,#e-plats) .ptile input{position:absolute;opacity:0;width:1px;height:1px;margin:0;padding:0;border:0;pointer-events:none;}
:is(#bs-plats,#e-plats) .ptile span{float:none;font-weight:inherit;letter-spacing:0;text-transform:none;}
:is(#bs-plats,#e-plats) .ptile__ico{flex:none;width:34px;height:34px;border-radius:9px;background:var(--pc);display:grid;place-items:center;}
:is(#bs-plats,#e-plats) .ptile__ico svg{width:19px;height:19px;fill:#fff;}
:is(#bs-plats,#e-plats) .ptile__txt{min-width:0;display:flex;flex-direction:column;}
:is(#bs-plats,#e-plats) .ptile__name{font-weight:600;font-size:14px;color:var(--sw-text);}
:is(#bs-plats,#e-plats) .ptile__acct{font-size:12.5px;color:var(--sw-text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
:is(#bs-plats,#e-plats) .ptile__warn{font-size:12px;font-weight:600;color:var(--sw-warn);margin-top:2px;}
:is(#bs-plats,#e-plats) .ptile__chk{position:absolute;top:11px;right:11px;width:20px;height:20px;border-radius:50%;border:1.5px solid var(--sw-border-strong);
  display:grid;place-items:center;background:var(--sw-surface);}
:is(#bs-plats,#e-plats) .ptile__chk svg{width:12px;height:12px;fill:none;stroke:#fff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;opacity:0;}
:is(#bs-plats,#e-plats) .ptile.is-on .ptile__chk{background:var(--pc);border-color:var(--pc);}
:is(#bs-plats,#e-plats) .ptile.is-on .ptile__chk svg{opacity:1;}
:is(#bs-plats,#e-plats) .ptile--off{border-style:dashed;cursor:default;background:transparent;}
:is(#bs-plats,#e-plats) .ptile--off .ptile__ico{filter:grayscale(1);opacity:.45;}
:is(#bs-plats,#e-plats) .ptile--off .ptile__name{color:var(--sw-text-3);}
:is(#bs-plats,#e-plats) .ptile--off .ptile__chk{display:none;}
:is(#bs-plats,#e-plats) .ptile--off a{color:var(--sw-accent);font-size:12.5px;font-weight:600;text-decoration:none;}
:is(#bs-plats,#e-plats) .ptile--off .ptile__acct{white-space:normal;}
:is(#bs-plats,#e-plats) .ptile--off a:hover{text-decoration:underline;}
@media (max-width:520px){:is(#bs-plats,#e-plats).ptiles{grid-template-columns:minmax(0,1fr);gap:8px;}:is(#bs-plats,#e-plats) .ptile{min-height:0;padding:10px 38px 10px 10px;}}
