/* ============================================================
   WIZARD ADS — Settings surface (Account · Members & roles · Billing)
   A centered modal that opens over any module. Inherits all tokens
   from styles.css / platform.css. Tier-aware: collapses its left
   rail into a top tab-bar on compact.
   ============================================================ */

.set-scrim{ position:fixed; inset:0; z-index:400; background:rgba(4,5,9,.62);
  backdrop-filter:blur(5px); -webkit-backdrop-filter:blur(5px);
  display:grid; place-items:center; padding:clamp(14px,3vw,48px);
  animation:ovFade .2s var(--out); }

.set-modal{ width:min(1060px, 100%); height:min(720px, 90vh);
  display:grid; grid-template-columns:236px 1fr; overflow:hidden;
  background:var(--glass-3); border:1px solid var(--line-strong); border-radius:22px;
  box-shadow:var(--shadow-float); backdrop-filter:var(--blur-lg); -webkit-backdrop-filter:var(--blur-lg); }
@media (prefers-reduced-motion: no-preference){
  .set-modal{ animation:setPop .26s var(--spring); }
}
@keyframes setPop{ from{ transform:translateY(14px) scale(.985); } to{ transform:none; } }

/* ---- left rail ---- */
.set-nav{ display:flex; flex-direction:column; padding:18px 14px; gap:4px;
  background:linear-gradient(180deg,rgba(255,255,255,.03),transparent);
  border-right:1px solid var(--line-soft); min-height:0; }
.set-ws{ display:flex; align-items:center; gap:11px; padding:6px 8px 16px; }
.set-ws .wlogo{ width:38px; height:38px; border-radius:11px; display:grid; place-items:center;
  font-weight:var(--fw-black); font-size:var(--fs-body); color:#fff; flex:0 0 38px;
  box-shadow:0 4px 14px -6px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.25); }
.set-ws .wmeta{ min-width:0; }
.set-ws .wn{ font-size:var(--fs-body); font-weight:var(--fw-black); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.set-ws .ws-foot{ display:flex; align-items:center; gap:6px; margin-top:4px; }

.set-tab{ display:flex; align-items:center; gap:11px; height:42px; padding:0 12px; border-radius:11px;
  color:var(--ink-2); font-size:var(--fs-body); font-weight:var(--fw-med); text-align:left; width:100%;
  transition:.15s var(--out); }
.set-tab svg{ flex:0 0 auto; opacity:.85; }
.set-tab:hover{ background:var(--hover); color:var(--ink); }
.set-tab.on{ background:var(--acc-soft); color:#fff; box-shadow:inset 0 0 0 1px var(--acc-line); }
.set-tab.on svg{ color:var(--acc-2); opacity:1; }
.set-nav-sp{ flex:1; }
.set-tab.danger{ color:var(--ink-2); }
.set-tab.danger:hover{ background:rgba(255,107,125,.12); color:var(--bad); }

/* ---- right pane ---- */
.set-main{ display:flex; flex-direction:column; min-width:0; min-height:0; }
.set-head{ flex:0 0 auto; display:flex; align-items:flex-start; gap:14px; padding:24px 26px 18px;
  border-bottom:1px solid var(--line-soft); }
.set-head .ht{ font-size:var(--fs-xl); font-weight:var(--fw-black); letter-spacing:-.01em; }
.set-head .hs{ font-size:var(--fs-base); color:var(--ink-3); font-weight:var(--fw-reg); margin-top:3px; max-width:52ch; line-height:1.45; }
.set-close{ margin-left:auto; width:36px; height:36px; border-radius:11px; display:grid; place-items:center;
  color:var(--ink-2); transition:.16s var(--out); flex:0 0 auto; }
.set-close:hover{ background:var(--hover); color:var(--ink); }
.set-body{ flex:1; overflow-y:auto; padding:22px 26px 30px; min-height:0; }

/* ---- generic section ---- */
.set-sec{ margin-bottom:26px; }
.set-sec:last-child{ margin-bottom:0; }
.set-sec-h{ display:flex; align-items:center; gap:10px; margin-bottom:13px; }
.set-sec-h .lbl{ font-size:var(--fs-label); font-weight:var(--fw-black); letter-spacing:.08em; text-transform:uppercase; color:var(--ink-3); }
.set-sec-h .ln{ flex:1; height:1px; background:var(--line); }
.set-sec-h .ct{ font-size:var(--fs-label); font-weight:var(--fw-bold); color:var(--ink-4); }

/* ---- form fields (account) ---- */
.set-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.set-fld{ display:flex; flex-direction:column; gap:7px; }
.set-fld label{ font-size:var(--fs-sub); font-weight:var(--fw-bold); color:var(--ink-2); }
.set-input{ height:44px; border-radius:11px; background:var(--well); border:1px solid var(--line);
  display:flex; align-items:center; gap:9px; padding:0 13px; transition:.16s var(--out); }
.set-input:focus-within{ border-color:var(--acc-line); box-shadow:0 0 0 3px var(--acc-soft); }
.set-input svg{ color:var(--ink-3); flex:0 0 auto; }
.set-input input{ flex:1; background:none; border:none; outline:none; font-size:var(--fs-body); font-weight:var(--fw-reg); color:var(--ink); min-width:0; }
.set-input input::placeholder{ color:var(--ink-4); }
.set-input.ro{ opacity:.62; }

.set-avatar-row{ display:flex; align-items:center; gap:16px; }
.set-avatar-row .hint{ font-size:var(--fs-sub); color:var(--ink-3); line-height:1.5; font-weight:var(--fw-reg); }
.btn-ghost{ height:36px; padding:0 14px; border-radius:10px; background:var(--panel-2); border:1px solid var(--line);
  font-size:var(--fs-base); font-weight:var(--fw-bold); color:var(--ink); transition:.16s var(--out); display:inline-flex; align-items:center; gap:7px; }
.btn-ghost:hover{ background:var(--hover-2); border-color:var(--line-strong); }
.btn-acc{ height:40px; padding:0 18px; border-radius:11px; background:var(--ai-grad); color:#fff;
  font-size:var(--fs-base); font-weight:var(--fw-black); display:inline-flex; align-items:center; gap:8px;
  box-shadow:0 10px 26px -10px var(--ai-glow); transition:.2s var(--spring); }
.btn-acc:hover{ transform:translateY(-1px); box-shadow:0 14px 32px -8px var(--ai-glow); }
.btn-acc:disabled{ opacity:.4; pointer-events:none; box-shadow:none; }

/* ---- toggle ---- */
.set-toggle-row{ display:flex; align-items:center; gap:14px; padding:13px 0; border-bottom:1px solid var(--line-soft); }
.set-toggle-row:last-child{ border-bottom:none; }
.set-toggle-row .tr-meta{ flex:1; min-width:0; }
.set-toggle-row .tr-t{ font-size:var(--fs-body); font-weight:var(--fw-bold); }
.set-toggle-row .tr-s{ font-size:var(--fs-sub); color:var(--ink-3); font-weight:var(--fw-reg); margin-top:2px; }
.tgl{ width:42px; height:24px; border-radius:13px; background:rgba(255,255,255,.1); border:1px solid var(--line);
  position:relative; flex:0 0 auto; transition:.2s var(--out); cursor:pointer; }
.tgl::after{ content:''; position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%;
  background:var(--ink-2); transition:.22s var(--spring); }
.tgl.on{ background:var(--acc); border-color:var(--acc); }
.tgl.on::after{ transform:translateX(18px); background:#fff; }

/* ============================================================  MEMBERS  */
.mbr-tools{ display:flex; align-items:center; gap:10px; margin-bottom:18px; }
.mbr-search{ flex:1; display:flex; align-items:center; gap:9px; height:42px; padding:0 13px;
  background:var(--well); border:1px solid var(--line); border-radius:11px; color:var(--ink-3); transition:.18s var(--out); }
.mbr-search:focus-within{ border-color:var(--acc-line); box-shadow:0 0 0 3px var(--acc-soft); }
.mbr-search input{ flex:1; background:none; border:none; outline:none; font-size:var(--fs-base); font-weight:var(--fw-reg); color:var(--ink); min-width:0; }
.mbr-search input::placeholder{ color:var(--ink-4); }

.mbr-row{ display:flex; align-items:center; gap:13px; padding:12px 4px; border-bottom:1px solid var(--line-soft); }
.mbr-row:last-child{ border-bottom:none; }
.mbr-id{ min-width:0; flex:1; }
.mbr-id .nm{ font-size:var(--fs-body); font-weight:var(--fw-bold); display:flex; align-items:center; gap:8px; }
.mbr-id .nm .you{ font-size:var(--fs-micro); font-weight:var(--fw-black); letter-spacing:.04em; text-transform:uppercase; color:var(--ink-3);
  border:1px solid var(--line); border-radius:5px; padding:1px 5px; }
.mbr-id .em{ font-size:var(--fs-sub); color:var(--ink-3); font-weight:var(--fw-reg); margin-top:2px; }
.mbr-status{ font-size:var(--fs-sub); font-weight:var(--fw-med); color:var(--ink-3); display:flex; align-items:center; gap:6px; width:78px; }
.mbr-status .d{ width:7px; height:7px; border-radius:50%; background:var(--ink-4); }
.mbr-status.on .d{ background:var(--good); box-shadow:0 0 7px rgba(70,217,160,.7); }

/* role select */
.role-sel{ position:relative; }
.role-sel-btn{ display:inline-flex; align-items:center; gap:7px; height:30px; padding:0 9px; border-radius:8px;
  font-size:var(--fs-label); font-weight:var(--fw-black); letter-spacing:.03em; text-transform:uppercase; border:1px solid; cursor:pointer;
  transition:.15s var(--out); }
.role-sel-btn .rd{ width:5px; height:5px; border-radius:50%; }
.role-sel-btn:hover{ filter:brightness(1.12); }
.role-sel-btn.ro{ cursor:default; }
.role-menu{ position:absolute; top:calc(100% + 6px); right:0; width:224px; padding:6px; z-index:30;
  background:var(--glass-3); border:1px solid var(--line-strong); border-radius:13px; box-shadow:var(--shadow-pop);
  backdrop-filter:var(--blur-lg); -webkit-backdrop-filter:var(--blur-lg); animation:pop .16s var(--spring); }
.role-opt{ display:flex; align-items:flex-start; gap:9px; padding:9px 10px; border-radius:9px; cursor:pointer; transition:.14s var(--out); }
.role-opt:hover{ background:var(--hover); }
.role-opt .ro-rd{ width:8px; height:8px; border-radius:50%; margin-top:4px; flex:0 0 8px; }
.role-opt .ro-meta .ro-n{ font-size:var(--fs-base); font-weight:var(--fw-bold); display:flex; align-items:center; gap:7px; }
.role-opt .ro-meta .ro-d{ font-size:var(--fs-label); color:var(--ink-3); font-weight:var(--fw-reg); margin-top:1px; line-height:1.35; }
.role-opt .ro-check{ margin-left:auto; color:var(--acc-2); }

.mbr-x{ width:32px; height:32px; border-radius:9px; display:grid; place-items:center; color:var(--ink-4);
  transition:.15s var(--out); flex:0 0 auto; }
.mbr-x:hover{ background:rgba(255,107,125,.12); color:var(--bad); }
.mbr-x:disabled{ opacity:.25; pointer-events:none; }

/* invite */
.invite-bar{ display:flex; align-items:center; gap:10px; padding:12px; border-radius:13px; margin-bottom:6px;
  background:linear-gradient(135deg,rgba(22,192,216,.1),rgba(46,211,198,.05)); border:1px solid var(--acc-line); }
.invite-bar .set-input{ flex:1; background:rgba(0,0,0,.35); }
.pending-row{ display:flex; align-items:center; gap:12px; padding:11px 4px; border-bottom:1px solid var(--line-soft); }
.pending-row:last-child{ border-bottom:none; }
.pending-row .pava{ width:34px; height:34px; border-radius:50%; display:grid; place-items:center;
  border:1.5px dashed var(--line-strong); color:var(--ink-3); flex:0 0 34px; }
.pending-row .pe{ flex:1; min-width:0; font-size:var(--fs-base); font-weight:var(--fw-med); }
.pending-row .pe .ps{ font-size:var(--fs-sub); color:var(--ink-4); font-weight:var(--fw-reg); margin-top:2px; }
.pending-tag{ font-size:var(--fs-eyebrow); font-weight:var(--fw-black); letter-spacing:.04em; text-transform:uppercase; color:var(--warn);
  background:rgba(255,180,84,.13); border:1px solid rgba(255,180,84,.3); border-radius:6px; padding:3px 8px; }

/* role legend / gate notice */
.gate-note{ display:flex; align-items:center; gap:10px; padding:11px 14px; border-radius:12px; margin-bottom:18px;
  background:rgba(255,180,84,.08); border:1px solid rgba(255,180,84,.22); font-size:var(--fs-base); font-weight:var(--fw-med); color:var(--ink-2); }
.gate-note svg{ color:var(--warn); flex:0 0 auto; }

/* ============================================================  BILLING  */
.bill-hero{ display:flex; align-items:stretch; gap:18px; padding:20px; border-radius:16px; margin-bottom:24px;
  background:linear-gradient(135deg,rgba(22,192,216,.14),rgba(46,211,198,.06)); border:1px solid var(--acc-line); }
.bill-hero .bh-left{ flex:0 0 auto; min-width:150px; }
.bill-hero .bh-plan{ font-size:var(--fs-stat-1); font-weight:var(--fw-black); letter-spacing:-.01em; }
.bill-hero .bh-price{ font-size:var(--fs-base); color:var(--ink-2); font-weight:var(--fw-med); margin-top:4px; }
.bill-hero .bh-price b{ color:var(--ink); font-size:var(--fs-panel); }
.bill-hero .bh-tag{ display:inline-flex; align-items:center; gap:6px; margin-top:12px; font-size:var(--fs-eyebrow); font-weight:var(--fw-black);
  letter-spacing:.05em; text-transform:uppercase; padding:4px 9px; border-radius:7px; background:var(--ai-grad); color:#fff;
  box-shadow:0 3px 12px -3px var(--ai-glow); }
.bill-hero .bh-meters{ flex:1; display:grid; grid-template-columns:repeat(3,1fr); gap:18px; align-content:center;
  border-left:1px solid var(--line); padding-left:20px; }
.bh-meter .mt{ font-size:var(--fs-label); font-weight:var(--fw-bold); color:var(--ink-3); text-transform:uppercase; letter-spacing:.04em; }
.bh-meter .mv{ font-size:var(--fs-lg); font-weight:var(--fw-black); margin-top:5px; }
.bh-meter .mv span{ font-size:var(--fs-sub); color:var(--ink-4); font-weight:var(--fw-bold); }
.bh-meter .mbar{ height:6px; border-radius:4px; background:rgba(0,0,0,.32); margin-top:8px; overflow:hidden; }
.bh-meter .mbar i{ display:block; height:100%; border-radius:4px; background:var(--ai-grad); box-shadow:0 0 10px var(--ai-glow); }

.plan-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.plan-card{ position:relative; display:flex; flex-direction:column; padding:16px 15px 17px; border-radius:15px;
  background:var(--panel-2); border:1px solid var(--line); transition:.2s var(--out); }
.plan-card:hover{ border-color:var(--line-strong); transform:translateY(-2px); }
.plan-card.cur{ border-color:var(--acc-line); box-shadow:inset 0 0 0 1px var(--acc-line), 0 12px 30px -16px var(--acc-glow); }
.plan-card .pc-name{ font-size:var(--fs-body); font-weight:var(--fw-black); }
.plan-card .pc-price{ font-size:var(--fs-stat-1); font-weight:var(--fw-black); letter-spacing:-.02em; margin-top:8px; }
.plan-card .pc-price span{ font-size:var(--fs-sub); color:var(--ink-3); font-weight:var(--fw-med); }
.plan-card .pc-feat{ list-style:none; margin:14px 0 0; padding:0; display:flex; flex-direction:column; gap:9px; flex:1; }
.plan-card .pc-feat li{ display:flex; align-items:flex-start; gap:8px; font-size:var(--fs-sub); font-weight:var(--fw-med); color:var(--ink-2); line-height:1.35; }
.plan-card .pc-feat li svg{ color:var(--acc-2); flex:0 0 auto; margin-top:1px; }
.plan-card .pc-cta{ height:38px; border-radius:10px; margin-top:16px; font-size:var(--fs-base); font-weight:var(--fw-black); transition:.18s var(--out); }
.pc-cta.up{ background:var(--ai-grad); color:#fff; box-shadow:0 8px 22px -10px var(--ai-glow); }
.pc-cta.up:hover{ transform:translateY(-1px); }
.pc-cta.down{ background:var(--panel-2); border:1px solid var(--line); color:var(--ink-2); }
.pc-cta.down:hover{ background:var(--hover-2); color:var(--ink); }
.pc-cta.cur{ background:transparent; border:1px solid var(--acc-line); color:var(--acc-2); cursor:default; }
.plan-card .pc-badge{ position:absolute; top:-9px; right:13px; font-size:var(--fs-micro); font-weight:var(--fw-black); letter-spacing:.05em;
  text-transform:uppercase; padding:3px 8px; border-radius:6px; background:var(--acc); color:#fff; box-shadow:0 4px 12px -4px var(--acc-glow); }

/* invoices */
.inv-row{ display:flex; align-items:center; gap:14px; padding:12px 4px; border-bottom:1px solid var(--line-soft); }
.inv-row:last-child{ border-bottom:none; }
.inv-row .iv-ic{ width:34px; height:34px; border-radius:9px; display:grid; place-items:center; color:var(--ink-3);
  background:var(--panel-2); border:1px solid var(--line); flex:0 0 34px; }
.inv-row .iv-meta{ flex:1; min-width:0; }
.inv-row .iv-d{ font-size:var(--fs-base); font-weight:var(--fw-bold); }
.inv-row .iv-s{ font-size:var(--fs-sub); color:var(--ink-3); font-weight:var(--fw-reg); margin-top:2px; }
.inv-row .iv-amt{ font-size:var(--fs-base); font-weight:var(--fw-black); }
.inv-row .iv-dl{ width:32px; height:32px; border-radius:9px; display:grid; place-items:center; color:var(--ink-3);
  transition:.15s var(--out); }
.inv-row .iv-dl:hover{ background:var(--hover); color:var(--ink); }
.inv-paid{ font-size:var(--fs-eyebrow); font-weight:var(--fw-black); letter-spacing:.04em; text-transform:uppercase; color:var(--good);
  background:rgba(70,217,160,.12); border:1px solid rgba(70,217,160,.28); border-radius:6px; padding:3px 8px; }

.pay-row{ display:flex; align-items:center; gap:13px; padding:14px 16px; border-radius:13px;
  background:var(--panel-2); border:1px solid var(--line); }
.pay-row .pc-chip{ width:42px; height:30px; border-radius:7px; background:linear-gradient(135deg,#2a2f44,#171a28);
  border:1px solid var(--line-strong); display:grid; place-items:center; font-size:var(--fs-micro); font-weight:var(--fw-black); color:var(--ink-2); flex:0 0 42px; }
.pay-row .pc-meta{ flex:1; min-width:0; }
.pay-row .pc-n{ font-size:var(--fs-base); font-weight:var(--fw-bold); }
.pay-row .pc-s{ font-size:var(--fs-sub); color:var(--ink-3); font-weight:var(--fw-reg); margin-top:2px; }

/* ============================================================  COMPACT  */
html[data-compact] .set-modal{ grid-template-columns:1fr; grid-template-rows:auto 1fr; height:92vh; }
html[data-compact] .set-nav{ flex-direction:row; overflow-x:auto; padding:12px; gap:6px; border-right:none;
  border-bottom:1px solid var(--line-soft); align-items:center; }
html[data-compact] .set-ws{ display:none; }
html[data-compact] .set-tab{ width:auto; flex:0 0 auto; white-space:nowrap; height:38px; }
html[data-compact] .set-tab .st-lbl{ display:inline; }
html[data-compact] .set-nav-sp{ display:none; }
html[data-compact] .set-tab.danger{ order:99; }
html[data-compact] .set-grid2{ grid-template-columns:1fr; }
html[data-compact] .plan-grid{ grid-template-columns:1fr 1fr; }
html[data-compact] .bill-hero{ flex-direction:column; }
html[data-compact] .bill-hero .bh-meters{ border-left:none; border-top:1px solid var(--line); padding-left:0; padding-top:16px; }
@media (max-width:560px){
  .plan-grid{ grid-template-columns:1fr !important; }
  .mbr-status{ display:none; }
}

/* deep-link into the full Team & Access workspace */
.team-deeplink{ display:flex; align-items:center; gap:13px; width:100%; padding:14px 16px; border-radius:14px; margin-bottom:20px; text-align:left;
  background:linear-gradient(135deg,rgba(22,192,216,.12),rgba(46,211,198,.05)); border:1px solid var(--acc-line); transition:.18s var(--out); }
.team-deeplink:hover{ transform:translateY(-1px); box-shadow:0 12px 30px -14px var(--acc-glow); border-color:var(--acc); }
.team-deeplink .tdl-ic{ width:40px; height:40px; border-radius:11px; display:grid; place-items:center; flex:0 0 40px; color:#fff;
  background:var(--ai-grad); box-shadow:0 6px 18px -6px var(--ai-glow), inset 0 1px 0 rgba(255,255,255,.25); }
.team-deeplink .tdl-meta{ flex:1; min-width:0; }
.team-deeplink .tdl-t{ display:block; font-size:var(--fs-body); font-weight:var(--fw-black); }
.team-deeplink .tdl-s{ display:block; font-size:var(--fs-sub); color:var(--ink-3); font-weight:var(--fw-reg); margin-top:2px; }
.team-deeplink > svg{ color:var(--ink-3); flex:0 0 auto; }
.team-deeplink:hover > svg{ color:var(--acc-2); }
