/* Whitelabel portal console — the .cx console styles, themed by brand --p-* vars. */
.cx { container-type: inline-size; --cx-surface:var(--p-panel); --cx-band:var(--p-panel); --cx-well:var(--p-void); --cx-raised:var(--p-panel); --cx-line:var(--p-line); --cx-line2:var(--p-line);
      --cx-text:var(--p-ink); --cx-text2:var(--p-dim); --cx-muted:var(--p-faint); --cx-accent:var(--p-accent); --cx-accent2:var(--p-accent-2); --cx-accent-soft:var(--p-accent-glow);
      --cx-ok:var(--p-ok); --cx-ok-soft:#173226; --cx-warn:#f2c14e; --cx-warn-soft:#3a2f14; --cx-crit:var(--p-danger); --cx-crit-soft:#3d1c22; --cx-info:var(--p-accent-2);
      --cx-mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace; --fc-spring: cubic-bezier(.2,.9,.3,1.25); --fc-ease: cubic-bezier(.2,.7,.2,1);
  background: var(--p-void); color: var(--p-ink); font-family: var(--p-sans);
      background: var(--cx-surface); border: 1px solid var(--cx-line); border-radius: 14px; overflow: hidden; color: var(--cx-text);
      box-shadow: 0 30px 60px -40px rgba(0,0,0,.9), 0 0 0 1px rgba(0,0,0,.4); font-family: "Open Sans", Arial, sans-serif; font-size: 14.5px; line-height: 1.55; }
.cx .aether-rich p:last-child { margin-bottom: 0; }
.cx-lbl { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--cx-muted); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
/* header */
.cx-head { display: flex; align-items: center; gap: 16px; padding: 16px 28px; background: var(--cx-band); border-bottom: 1px solid var(--cx-line); flex-wrap: wrap; }
.cx-product { min-width: 0; flex: 1 1 160px; }
.cx-product b { display: block; font-family: Poppins, sans-serif; font-weight: 600; font-size: 15px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.cx-product span { font-size: 12px; color: var(--cx-muted); }
.cx-status { display: inline-flex; align-items: center; gap: 8px; font-family: Poppins, sans-serif; font-weight: 600; font-size: 12.5px; padding: 6px 12px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.cx-status.is-progress { color: var(--cx-info); border-color: rgba(92,205,245,.35); background: rgba(92,205,245,.08); }
.cx-status.is-waiting { color: var(--cx-warn); border-color: rgba(242,193,78,.4); background: var(--cx-warn-soft); }
.cx-status.is-ready, .cx-status.is-done { color: var(--cx-ok); border-color: rgba(79,211,154,.4); background: var(--cx-ok-soft); }
.cx-status.is-error { color: var(--cx-crit); border-color: rgba(255,107,107,.4); background: var(--cx-crit-soft); }
.cx-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.cx-dot--spin { width: 11px; height: 11px; background: none; border: 2px solid currentColor; border-right-color: transparent; animation: cxSpin .9s linear infinite; }
@keyframes cxSpin { to { transform: rotate(360deg); } }
@keyframes cxBlink { 50% { opacity: .25; } }
.cx-tools { display: flex; gap: 6px; margin-left: auto; }
.cx-pill { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--cx-line2); background: var(--cx-surface); color: var(--cx-text2); font-size: 12px; cursor: pointer; transition: border-color .15s, color .15s; }
.cx-pill:hover { border-color: var(--cx-accent); color: #fff; }
.cx-pill.is-attn { border-color: var(--cx-warn); color: var(--cx-warn); animation: cxPulse 1.6s ease-in-out infinite; }
@keyframes cxPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(242,193,78,0); } 50% { box-shadow: 0 0 0 4px rgba(242,193,78,.14); } }
/* stepper */
.cx-steps { display: flex; padding: 0 28px; background: var(--cx-band); border-bottom: 1px solid var(--cx-line); overflow-x: auto; scrollbar-width: none; }
.cx-step { flex: 1 0 auto; display: flex; align-items: center; gap: 8px; padding: 12px 18px 12px 0; font-size: 12.5px; color: var(--cx-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.cx-step i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--cx-line2); display: inline-grid; place-items: center; font-style: normal; font-size: 10px; font-family: Poppins, sans-serif; font-weight: 600; flex: 0 0 18px; }
.cx-step i .fas { font-size: 9px; }
.cx-step.is-done { color: var(--cx-text2); } .cx-step.is-done i { background: var(--cx-ok); border-color: var(--cx-ok); color: #06140d; }
.cx-step.is-now { color: #fff; border-bottom-color: var(--cx-accent); } .cx-step.is-now i { border-color: var(--cx-accent); color: var(--cx-accent2); }
.cx-step.is-failed { border-bottom-color: var(--cx-crit); } .cx-step.is-failed i { border-color: var(--cx-crit); color: var(--cx-crit); }
/* body */
.cx-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.cx-body.has-aside { grid-template-columns: minmax(0, 1fr) 280px; }
.cx-main { padding: 30px 32px 28px; min-width: 0; }
.cx-aside { padding: 30px 26px; border-left: 1px solid var(--cx-line); background: var(--cx-well); font-size: 13px; color: var(--cx-text2); }
.cx-aside h4 { font-family: Poppins, sans-serif; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--cx-muted); font-weight: 600; margin: 0 0 10px; }
.cx-aside ol { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.cx-aside li::marker { color: var(--cx-accent2); font-weight: 700; }
.cx-tip { margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--cx-surface); border: 1px solid var(--cx-line); font-size: 12.5px; }
.cx-tip b { color: #fff; font-weight: 600; }
.cx-title { font-family: Poppins, sans-serif; font-size: 21px; font-weight: 700; color: #fff; margin: 0 0 6px; letter-spacing: -.01em; text-wrap: balance; }
.cx-lead { color: var(--cx-text2); margin: 0 0 22px; max-width: 60ch; font-size: 15px; }
.cx-lead b, .cx-lead strong { color: #fff; }
.cx-bar { height: 5px; border-radius: 999px; background: var(--cx-raised); overflow: hidden; margin: 0 0 16px; }
.cx-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--cx-accent), var(--cx-info)); border-radius: 999px; transition: width .6s ease; }
.cx-live { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--cx-well); border: 1px solid var(--cx-line); font-family: var(--cx-mono); font-size: 12.5px; color: var(--cx-text2); margin-bottom: 14px; }
.cx-live .cx-dot { background: var(--cx-info); animation: cxBlink 1.4s ease-in-out infinite; }
/* loader */
.cx-loader { padding: 6px 0 4px; }
.cx-loader-top { display: flex; align-items: center; gap: 18px; padding: 12px 4px 10px; }
.cx-loader-top b { display: block; font-family: Poppins, sans-serif; font-weight: 600; color: #fff; font-size: 16px; }
.cx-loader-top span { color: var(--cx-text2); font-size: 13px; }
.cx-ring { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; border: 4px solid var(--cx-line2); border-top-color: var(--cx-accent); animation: cxSpin .9s linear infinite; }
.cx-checks { display: grid; gap: 8px; margin: 14px 0 6px; font-size: 13px; color: var(--cx-text2); }
.cx-checks div { display: flex; gap: 10px; align-items: center; }
.cx-checks i { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 16px; }
.cx-checks i.is-run { border: 2px solid var(--cx-info); border-right-color: transparent; animation: cxSpin .9s linear infinite; }
.cx-checks i.is-todo { border: 1.5px solid var(--cx-line2); }
/* countdown — big */
.cx-clock { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 18px 20px; margin-bottom: 16px; border: 1px solid var(--cx-line); border-radius: 12px; background: var(--cx-well); }
.cx-clock-val { font-family: var(--cx-mono); font-size: 44px; font-weight: 700; line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.cx-clock-sub { font-size: 12px; color: var(--cx-muted); }
.cx-clock.is-urgent { border-color: rgba(242,193,78,.45); } .cx-clock.is-urgent .cx-clock-val { color: var(--cx-warn); }
.cx-clock.is-critical { border-color: rgba(255,107,107,.55); animation: cxPulseRed 1s ease-in-out infinite; } .cx-clock.is-critical .cx-clock-val { color: var(--cx-crit); }
@keyframes cxPulseRed { 0%,100% { box-shadow: 0 0 0 0 rgba(255,107,107,0); } 50% { box-shadow: 0 0 0 4px rgba(255,107,107,.14); } }
.cx-clock.is-past .cx-clock-val { color: var(--cx-warn); font-family: Poppins, sans-serif; font-size: 26px; }
.cx-tick { display: inline-block; transform-origin: 50% 55%; animation: cxTick 1s steps(2, end) infinite; }
.cx-clock.is-critical .cx-tick { animation-duration: .5s; }
@keyframes cxTick { 0% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } 100% { transform: rotate(-12deg); } }
/* countdown — compact line */
.cx-countline { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--cx-line); border-radius: 12px; background: var(--cx-well); }
.cx-countline-sub { font-size: 12px; color: var(--cx-muted); }
.cx-countline-val { font-family: var(--cx-mono); font-size: 30px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; margin-left: auto; line-height: 1; }
.cx-countline.is-past { border-color: rgba(242,193,78,.4); } .cx-countline.is-past .cx-countline-val { color: var(--cx-warn); font-family: Poppins, sans-serif; font-size: 22px; }
/* choose list */
.cx-pick { border: 1px solid var(--cx-line); border-radius: 12px; background: var(--cx-well); overflow: hidden; margin-bottom: 14px; }
.cx-pick-head { display: flex; justify-content: space-between; padding: 9px 16px; border-bottom: 1px solid var(--cx-line); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--cx-muted); font-weight: 600; }
.cx-pick-list { display: flex; flex-direction: column; }
.cx-pick-list.is-scroll { max-height: 312px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--cx-line2) transparent; }
.cx-opt { display: grid; grid-template-columns: 22px 1fr auto; gap: 16px; align-items: center; width: 100%; text-align: left; padding: 14px 18px; border: 0; border-bottom: 1px solid var(--cx-line); background: transparent; color: var(--cx-text); cursor: pointer; transition: background .12s; }
.cx-opt:last-child { border-bottom: 0; }
.cx-opt:hover:not(:disabled) { background: var(--cx-band); }
.cx-opt.is-on { background: var(--cx-accent-soft); }
.cx-opt:disabled { opacity: .5; cursor: not-allowed; }
.cx-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--cx-line2); position: relative; }
.cx-opt.is-on .cx-radio { border-color: var(--cx-accent); } .cx-opt.is-on .cx-radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--cx-accent); }
.cx-opt-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cx-opt-name { font-family: Poppins, sans-serif; font-weight: 600; font-size: 14px; color: #fff; }
.cx-opt-id { font-size: 12px; color: var(--cx-muted); font-family: var(--cx-mono); }
.cx-opt-meta { font-family: var(--cx-mono); font-size: 15px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; text-align: right; line-height: 1.15; }
.cx-opt-meta small { display: block; font-family: "Open Sans", sans-serif; font-weight: 400; font-size: 11px; color: var(--cx-muted); letter-spacing: .04em; }
.cx-opt.is-soon .cx-opt-meta { color: var(--cx-warn); }
.cx-tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cx-warn); background: var(--cx-warn-soft); border: 1px solid rgba(242,193,78,.35); border-radius: 999px; padding: 2px 8px; margin-left: 8px; vertical-align: middle; }
.cx-picked { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--cx-line); background: var(--cx-band); font-size: 12.5px; color: var(--cx-text2); }
.cx-picked b { color: var(--cx-ok); font-weight: 600; }
/* form */
.cx-form { display: grid; gap: 18px; margin-bottom: 20px; }
.cx-field { display: grid; gap: 5px; }
.cx-field label { font-size: 12.5px; font-weight: 600; color: var(--cx-text2); }
.cx-field label em { color: var(--cx-crit); font-style: normal; }
.cx-field small { color: var(--cx-muted); font-size: 12px; }
.cx-input { height: 42px; border: 1px solid var(--cx-line2); border-radius: 10px; background: var(--cx-well); color: #fff; padding: 0 12px; font: inherit; width: 100%; }
.cx-input:focus { outline: 2px solid var(--cx-accent); outline-offset: 0; border-color: var(--cx-accent); }
.cx-input:disabled { opacity: .6; }
.cx-input--area { height: auto; padding: 10px 12px; }
.cx-input--code { font-family: var(--cx-mono); font-size: 24px; letter-spacing: .32em; text-align: center; height: 56px; }
.cx-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--cx-text2); cursor: pointer; }
.cx-check input { margin-top: 3px; accent-color: var(--cx-accent); }
/* radio cards (ScreenInput.type = "cards") + suffixed input (ScreenInput.suffix) */
.cx-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.cx-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--cx-line2); border-radius: 10px; background: var(--cx-well); color: var(--cx-text2); text-align: left; cursor: pointer; font: inherit; transition: border-color .15s, background .15s, transform .15s; }
.cx-card:hover:not(:disabled) { border-color: var(--cx-accent2); }
.cx-card:disabled { opacity: .6; cursor: default; }
.cx-card.is-on { border-color: var(--cx-accent); background: var(--cx-accent-soft); color: #fff; }
.cx-card .cx-radio { flex: 0 0 auto; display: grid; place-items: center; }
.cx-card.is-on .cx-radio { border-color: var(--cx-accent); }
.cx-card.is-on .cx-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cx-accent2); animation: cxPop .25s cubic-bezier(.2,1.4,.4,1); }
@keyframes cxPop { from { transform: scale(.3); } to { transform: scale(1); } }
.cx-card-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cx-card-text b { font-family: Poppins, sans-serif; font-weight: 600; font-size: 13.5px; color: #fff; }
.cx-card-text small { font-size: 12px; color: var(--cx-muted); }
.cx-card.is-on .cx-card-text small { color: var(--cx-text2); }
.cx-inwrap { display: flex; align-items: stretch; height: 42px; border: 1px solid var(--cx-line2); border-radius: 10px; background: var(--cx-well); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.cx-inwrap:focus-within { border-color: var(--cx-accent); box-shadow: 0 0 0 2px var(--cx-accent); }
.cx-inwrap .cx-input { border: 0; border-radius: 0; height: auto; background: transparent; min-width: 0; flex: 1 1 auto; }
.cx-inwrap .cx-input:focus { outline: none; }
.cx-inwrap-suffix { display: inline-flex; align-items: center; padding: 0 12px; background: var(--cx-raised); color: var(--cx-muted); font-family: var(--cx-mono); font-size: 13px; border-left: 1px solid var(--cx-line2); white-space: nowrap; }
.cx-adv { border: 1px solid var(--cx-line); border-radius: 10px; background: var(--cx-well); }
.cx-adv-toggle { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: none; border: 0; text-align: left; font-family: Poppins, sans-serif; font-weight: 600; font-size: 13px; color: var(--cx-text2); cursor: pointer; }
.cx-adv-toggle:hover { color: #fff; }
.cx-adv-toggle .fas { font-size: 10px; width: 12px; }
.cx-adv-tag { margin-left: auto; font-family: "Open Sans", sans-serif; font-weight: 400; font-size: 11.5px; color: var(--cx-muted); }
.cx-adv-body { padding: 2px 14px 14px; border-top: 1px solid var(--cx-line); display: grid; gap: 12px; }
.cx-adv-text { margin-top: 10px; color: var(--cx-text2); font-size: 13px; max-width: 60ch; }
.cx-adv-text code { color: #c9b8ff; background: #1a1a2a; padding: 1px 5px; border-radius: 4px; }
.cx-terms { border: 1px solid var(--cx-line); border-radius: 10px; background: var(--cx-well); padding: 12px 14px; margin-bottom: 6px; display: grid; gap: 10px; }
.cx-terms-text { max-height: 200px; overflow: auto; font-size: 13px; color: var(--cx-text2); }
.cx-error { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--cx-crit-soft); border: 1px solid rgba(255,107,107,.4); color: #ffd4d4; font-size: 13px; }
/* key/value tiles + notice */
.cx-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 20px; }
.cx-kv > div { border: 1px solid var(--cx-line); border-radius: 10px; background: var(--cx-well); padding: 12px 14px; display: grid; gap: 4px; min-width: 0; }
.cx-kv-val { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #fff; overflow-wrap: anywhere; }
.cx-kv-val.is-code { font-family: var(--cx-mono); font-size: 14px; }
.cx-kv-val button { flex: 0 0 auto; width: 28px; height: 26px; border-radius: 6px; border: 1px solid var(--cx-line2); background: transparent; color: var(--cx-accent2); cursor: pointer; }
.cx-kv-val button:hover { border-color: var(--cx-accent); }
.cx-notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--cx-raised); border: 1px solid var(--cx-line2); color: var(--cx-text2); font-size: 13px; margin-bottom: 14px; }
.cx-notice .fas { color: var(--cx-info); margin-top: 3px; }
/* result */
.cx-result { display: flex; gap: 16px; align-items: flex-start; }
.cx-result-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 44px; font-size: 18px; }
.cx-result-ico.is-ok { background: var(--cx-ok-soft); color: var(--cx-ok); } .cx-result-ico.is-bad { background: var(--cx-crit-soft); color: var(--cx-crit); }
.cx-result .cx-lead { margin-bottom: 0; }
.cx-result + .cx-kv { margin-top: 16px; }
/* footer */
.cx-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 28px; border-top: 1px solid var(--cx-line); background: var(--cx-band); }
.cx-foot-note { margin-left: auto; font-size: 12.5px; color: var(--cx-muted); text-align: right; max-width: 36ch; }
.cx-form-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 2px; }
.cx-form-go .cx-foot-note { margin-left: 0; text-align: left; }
.cx-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; font-family: Poppins, sans-serif; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, color .15s; }
.cx-btn--primary { background: var(--cx-accent); color: #fff !important; box-shadow: 0 8px 20px -10px rgba(124,92,255,.9); }
.cx-btn--primary:hover:not(:disabled) { background: #8b6eff; }
.cx-btn--primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.cx-btn--ghost { background: transparent; border-color: var(--cx-line2); color: var(--cx-text2) !important; }
.cx-btn--ghost:hover, .cx-btn--ghost.is-on { border-color: var(--cx-accent); color: #fff !important; }
.cx-btn--sm { height: 34px; padding: 0 14px; font-size: 13px; }
/* codes drawer */
.cx-drawer { border-top: 1px solid var(--cx-line); background: var(--cx-well); }
.cx-drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 28px; border-bottom: 1px solid var(--cx-line); }
.cx-drawer-head b { font-family: Poppins, sans-serif; font-weight: 600; font-size: 13.5px; color: #fff; }
.cx-drawer-head b .fas { color: var(--cx-accent2); }
.cx-livetag { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--cx-ok); font-weight: 600; }
.cx-livetag .cx-dot { background: var(--cx-ok); animation: cxBlink 1.4s ease-in-out infinite; }
.cx-drawer-empty { display: flex; gap: 14px; align-items: center; padding: 18px 28px; color: var(--cx-text2); font-size: 13px; }
.cx-drawer-empty .cx-ring { width: 30px; height: 30px; flex-basis: 30px; border-width: 3px; }
.cx-drawer-empty b { display: block; color: #fff; font-family: Poppins, sans-serif; font-weight: 600; }
.cx-msg { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 16px 28px; border-bottom: 1px solid var(--cx-line); align-items: center; }
.cx-msg:last-child { border-bottom: 0; }
.cx-msg-from { font-size: 12px; color: var(--cx-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cx-msg-from b { color: var(--cx-accent2); font-weight: 600; }
.cx-msg-when { font-size: 12px; color: var(--cx-muted); text-align: right; white-space: nowrap; }
.cx-msg-subj { grid-column: 1 / -1; font-weight: 600; color: #fff; font-size: 13.5px; }
.cx-msg-acts { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.cx-code { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 8px; background: var(--cx-accent-soft); border: 1px solid rgba(124,92,255,.5); color: #fff; font-family: var(--cx-mono); font-size: 20px; font-weight: 700; letter-spacing: .16em; cursor: pointer; }
.cx-code small { font-family: "Open Sans", sans-serif; font-size: 11px; letter-spacing: 0; color: var(--cx-accent2); font-weight: 600; }
/* email modal */
.cx-modal { position: fixed; inset: 0; z-index: 1070; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cx-modal-card { width: min(860px, 100%); height: min(85vh, 900px); background: var(--cx-surface, #161622); border: 1px solid #363650; border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.cx-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #2b2b3e; }
.cx-modal-title { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-modal-sub { color: #8d8da6; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-modal-close { background: transparent; border: 1px solid #363650; color: #eeedf7; width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; cursor: pointer; }
.cx-modal-close:hover { border-color: #7c5cff; }
.cx-modal-frame { flex: 1 1 auto; width: 100%; border: 0; background: #fff; }
.cx-modal-foot { padding: 8px 16px; border-top: 1px solid #2b2b3e; color: #8d8da6; font-size: 12.5px; }
@container (max-width: 860px) {
  .cx-body.has-aside { grid-template-columns: 1fr; }
  .cx-aside { border-left: 0; border-top: 1px solid var(--cx-line); }
  .cx-aside ol { grid-template-columns: 1fr 1fr; column-gap: 24px; }
}
@container (max-width: 560px) {
  .cx-aside ol { grid-template-columns: 1fr; }
  .cx-main { padding: 20px 18px 18px; }
  .cx-head, .cx-foot, .cx-steps, .cx-drawer-head, .cx-msg, .cx-drawer-empty { padding-left: 18px; padding-right: 18px; }
  .cx-aside { padding: 20px 18px; }
}
@media (max-width: 820px) {
  .cx-body.has-aside { grid-template-columns: 1fr; }
  .cx-aside { border-left: 0; border-top: 1px solid var(--cx-line); }
  .cx-main { padding: 18px 16px 16px; }
  .cx-head, .cx-foot { padding-left: 16px; padding-right: 16px; }
  .cx-foot-note { margin-left: 0; text-align: left; max-width: none; }
  .cx-clock-val { font-size: 36px; }
  .cx-opt { grid-template-columns: 22px 1fr; } .cx-opt-meta { grid-column: 2; text-align: left; } .cx-opt-meta small { display: inline; margin-left: 8px; }
  .cx-drawer-head, .cx-msg, .cx-drawer-empty { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) { .cx-tick, .cx-dot--spin, .cx-live .cx-dot, .cx-livetag .cx-dot, .cx-ring, .cx-checks i.is-run, .cx-pill.is-attn, .cx-clock.is-critical { animation: none; } }

/* rich-text bodies inside console screens (aliased, brand-driven) */
.cx .aether-rich, .aether-rich { color: var(--p-dim); line-height: 1.6; }
.cx .aether-rich h1, .cx .aether-rich h2, .cx .aether-rich h3, .cx .aether-rich h4 { color: var(--p-ink); font-weight: 700; margin: 1em 0 .4em; }
.cx .aether-rich a { color: var(--p-accent-2); }
.cx .aether-rich code { font-family: var(--p-mono); color: var(--p-accent-2); }
.cx .aether-rich strong, .cx .aether-rich b { color: var(--p-ink); }

/* ---- whitelabel portal shell (wrapper around the .cx console) ---- */
.cx-portal-scope{min-height:100dvh;background:var(--p-void);color:var(--p-ink);font-family:var(--p-sans);display:flex;flex-direction:column;
  background-image:radial-gradient(52rem 34rem at 50% -12%, var(--p-accent-glow), transparent 62%);}
.cx-portal-head{display:flex;align-items:center;gap:10px;padding:15px 20px;border-bottom:1px solid var(--p-hair)}
.cx-portal-brand{display:flex;align-items:center;gap:9px}
.cx-portal-mk{width:26px;height:26px;border-radius:8px;background:var(--p-accent);color:var(--p-accent-ink);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13px;overflow:hidden;font-family:var(--p-disp)}
.cx-portal-mk img{width:100%;height:100%;object-fit:cover}
.cx-portal-name{font-family:var(--p-disp);font-weight:700;font-size:15px}
.cx-portal-sec{margin-left:auto;font-family:var(--p-mono);font-size:12px;color:var(--p-dim);display:flex;align-items:center;gap:7px}
.cx-portal-sec .lk{color:var(--p-ok)}
.cx-portal-main{flex:1;display:flex;justify-content:center;padding:30px 16px 60px}
.cx-portal-main .cx{width:100%;max-width:640px;border:1px solid var(--p-line);border-radius:var(--p-rl);overflow:hidden}
.cx-portal-msg{max-width:420px;margin:70px auto;text-align:center;padding:0 20px}
.cx-portal-msg .ic{width:56px;height:56px;border-radius:14px;margin:0 auto 18px;display:flex;align-items:center;justify-content:center;background:var(--p-panel);border:1px solid var(--p-line);color:var(--p-accent);font-size:24px}
.cx-portal-msg h1{font-family:var(--p-disp);color:var(--p-ink);font-size:22px;margin:0 0 8px}
.cx-portal-msg p{color:var(--p-dim);font-size:14px;line-height:1.55}
.cx-portal-foot{padding:18px;text-align:center;font-family:var(--p-mono);font-size:11px;color:var(--p-faint)}

/* ============================================================================
   Portal polish — portal-only motion on top of the base console. Scoped to
   .cx-portal-scope so it never touches the in-account console. Reduced-motion safe.
   ============================================================================ */
@media (prefers-reduced-motion: no-preference) {
  /* entrance */
  .cx-portal-head { animation: cxpFade .55s ease both; }
  .cx-portal-main .cx { animation: cxpRise .6s cubic-bezier(.2,.8,.2,1) both; position: relative; }
  @keyframes cxpFade { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
  @keyframes cxpRise { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }

  /* accent hairline along the top of the console */
  .cx-portal-main .cx::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; z-index: 4;
    pointer-events: none; background: linear-gradient(90deg, transparent, var(--p-accent), transparent); opacity: .75; }

  /* brand mark: soft glow + gentle float */
  .cx-portal-mk { box-shadow: 0 0 18px -2px var(--p-accent-glow); animation: cxpFloat 5s ease-in-out infinite; }
  @keyframes cxpFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

  /* primary button: sheen sweep + hover lift + accent glow */
  .cx-portal-scope .cx-btn--primary { position: relative; overflow: hidden;
    transition: transform .12s ease, filter .2s ease, box-shadow .25s ease; }
  .cx-portal-scope .cx-btn--primary:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06);
    box-shadow: 0 12px 34px -14px var(--p-accent); }
  .cx-portal-scope .cx-btn--primary:active:not(:disabled) { transform: translateY(0); }
  .cx-portal-scope .cx-btn--primary::after { content: ""; position: absolute; top: 0; bottom: 0; width: 38%; left: -60%;
    pointer-events: none; background: linear-gradient(90deg, transparent, rgba(255,255,255,.32), transparent);
    animation: cxpShim 3.8s ease-in-out infinite; }
  @keyframes cxpShim { 0% { left: -60%; } 55%, 100% { left: 150%; } }

  /* inputs: accent focus ring */
  .cx-portal-scope .cx-input:focus,
  .cx-portal-scope .cx-inwrap:focus-within { box-shadow: 0 0 0 4px var(--p-accent-glow); transition: box-shadow .2s ease; }

  /* loader ring glow + status halo while working */
  .cx-portal-scope .cx-ring { filter: drop-shadow(0 0 7px var(--p-accent-glow)); }
  .cx-portal-scope .cx-status.is-progress .cx-dot { animation: cxpHalo 1.8s ease-out infinite; }
  @keyframes cxpHalo { 0% { box-shadow: 0 0 0 0 var(--p-accent-glow); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

  /* done / result icon: pop-in */
  .cx-portal-scope .cx-result-ico { animation: cxpPopIn .55s cubic-bezier(.2,1.5,.4,1) both; }
  @keyframes cxpPopIn { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }

  /* ambient shell glow breathe (sits behind content) */
  .cx-portal-scope { position: relative; }
  .cx-portal-scope::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(46rem 30rem at 50% -8%, var(--p-accent-glow), transparent 62%);
    animation: cxpBreathe 9s ease-in-out infinite; }
  .cx-portal-head, .cx-portal-main, .cx-portal-foot { position: relative; z-index: 1; }
  @keyframes cxpBreathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
}
