/* ════════════════════════════════════════════════════════════════════
   Dashboards (AB#23388, DASH-DEFINE / DASH-SAAS): the widget frame and each widget type's body, and the PaaS Master
   Studio's widget screens. The nd- widget rules are Dan's DASH-DESIGN v0.1 (nd-widgets.css), with charts drawn by
   Apache ECharts (D-464) instead of the prototype's own SVG. Design-system tokens only: they come from the .uf scope
   (UniversalForms.css), so the components' roots carry .uf.
   ════════════════════════════════════════════════════════════════════ */

.nd-root { --nd-cell-h: 196px; --nd-gap: 16px; --nd-cols: 4;
  --nd-c1: var(--hcm-primary); --nd-c2: var(--hcm-primary-dark); --nd-c3: var(--teal);
  --nd-c4: var(--orange); --nd-c5: var(--purple); --nd-c6: var(--hcm-mantis);
  position: relative; font-family: var(--font-family); color: var(--hcm-text); }
.nd-root *, .nd-root *::before, .nd-root *::after { box-sizing: border-box; }
.nd-root button { font: inherit; }
.nd-ovl-host { position: static; }
.nd-root--phone { --nd-cell-h: 172px; --nd-gap: 12px; --nd-cols: 2; }

.nd-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.nd-pill--danger { background: var(--hcm-carnation-lt); color: #9B2C2C; }
.nd-pill--warn { background: var(--hcm-sun-lt); color: #7A5007; }
.nd-pill--ok { background: var(--hcm-mantis-lt); color: #276B2E; }
.nd-pill--info { background: var(--hcm-primary-light); color: var(--hcm-primary-dark); }
.nd-pill--neutral { background: var(--hcm-foam); color: var(--hcm-text-sec); }
.nd-pill--plain::before { display: none; }

/* ── Dashboard header ── */
.nd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: var(--s-4); flex-wrap: wrap; }
.nd-head-title { font-size: var(--fs-h4); font-weight: var(--fw-semibold); line-height: var(--lh-tight); color: var(--hcm-text); margin: 0; }
.nd-head-sub { font-size: var(--fs-b9); color: var(--hcm-text-sec); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nd-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: relative; }
.nd-root--phone .nd-head { margin-bottom: 12px; align-items: center; flex-wrap: nowrap; }
.nd-root--phone .nd-head-title { font-size: 17px; }
.nd-btn-neutral { background: var(--hcm-surface); color: var(--hcm-text-sec); border-color: var(--hcm-link-water); }
.nd-btn-neutral:hover { background: var(--hcm-foam); }
.nd-iconbtn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-8); border: 1px solid var(--hcm-link-water); background: var(--hcm-surface); color: var(--hcm-text-sec); cursor: pointer; flex-shrink: 0; transition: background var(--dur), color var(--dur); }
.nd-iconbtn:hover { background: var(--hcm-foam); color: var(--hcm-primary); }
.nd-iconbtn:focus-visible, .nd-w button:focus-visible, .nd-root a:focus-visible { outline: 2px solid var(--hcm-primary); outline-offset: 2px; }
.nd-head-date { font-size: var(--fs-b9); font-weight: var(--fw-medium); color: var(--hcm-text-sec); margin-bottom: 2px; }
.nd-root--phone .nd-head-actions { gap: 6px; }
.nd-root--phone .nd-head-sub .fa-lock{font-size:9px;margin-right:2px}
.nd-root--phone .nd-head-actions{flex-wrap:nowrap}
.nd-iconbtn--primary{background:var(--hcm-primary) !important;color:#fff !important;border-color:var(--hcm-primary) !important}
.nd-head-tabs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; flex: 1 1 auto; min-width: 0; }
.nd-head-actions { margin-left: auto; }
.nd-w-tools { display: flex; align-items: center; gap: 2px; margin-top: 6px; flex-wrap: wrap; flex-shrink: 0; }

/* ── Grid ─────────────────────────────────────────────────────────── */
.nd-grid { display: grid; grid-template-columns: repeat(var(--nd-cols), minmax(0, 1fr)); grid-auto-rows: var(--nd-cell-h); grid-auto-flow: row dense; gap: var(--nd-gap); }
.nd-size--s { grid-column: span 1; grid-row: span 1; }
.nd-size--w { grid-column: span 2; grid-row: span 1; }
.nd-size--t { grid-column: span 1; grid-row: span 2; }
.nd-size--l { grid-column: span 2; grid-row: span 2; }

/* ── Widget frame ─────────────────────────────────────────────────── */
.nd-w { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--hcm-surface); border: 1px solid var(--hcm-link-water); border-radius: var(--r-16); box-shadow: var(--shadow-card); padding: 14px 14px 10px; overflow: hidden; transition: box-shadow var(--dur), border-color var(--dur), transform var(--dur), opacity var(--dur); }
.nd-w:hover { box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--hcm-primary) 30%, var(--hcm-link-water)); }
.nd-root--phone .nd-w { padding: 11px 11px 8px; }
.nd-w-head { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 0; min-height: 30px; }
.nd-w-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-size: 13px; flex-shrink: 0; --nd-cat: var(--hcm-primary); background: color-mix(in srgb, var(--nd-cat) 13%, var(--hcm-surface)); color: color-mix(in srgb, var(--nd-cat) 72%, #0B1C30); }
.nd-cat--work { --nd-cat: var(--hcm-primary); } .nd-cat--ts { --nd-cat: var(--teal); } .nd-cat--comp { --nd-cat: var(--orange); } .nd-cat--cust { --nd-cat: var(--purple); } .nd-cat--fin { --nd-cat: var(--hcm-mantis); }
.nd-root--phone .nd-w-ico { width: 26px; height: 26px; border-radius: 9px; font-size: 11.5px; }
.nd-w-title { flex: 1; min-width: 0; font-size: var(--fs-b6); font-weight: var(--fw-semibold); color: var(--hcm-text); margin: 0; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.nd-size--w .nd-w-title, .nd-size--l .nd-w-title { -webkit-line-clamp: 1; }
.nd-root--phone .nd-w-title { font-size: 13px; }
.nd-root--phone .nd-size--s .nd-w-ico, .nd-root--phone .nd-size--t .nd-w-ico { display: none; }
.nd-w-tool { width: 28px; height: 28px; border: 0; background: transparent; color: var(--hcm-text-sec); border-radius: var(--r-8); cursor: pointer; display: grid; place-items: center; font-size: 13px; flex-shrink: 0; transition: background var(--dur), color var(--dur); }
.nd-w-tool:hover { background: var(--hcm-foam); color: var(--hcm-primary-dark); }
.nd-w-tool--sm { width: 22px; height: 22px; font-size: 10.5px; border-radius: var(--r-6); }
.nd-w-head > .nd-w-tool { margin-right: -4px; }
.nd-w-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; min-width: 0; flex-shrink: 0; }
.nd-period { display: inline-flex; align-items: center; gap: 5px; height: 22px; max-width: 100%; padding: 0 9px; border-radius: var(--r-pill); background: var(--hcm-foam); border: 1px solid var(--hcm-link-water); color: var(--hcm-text-sec); font-size: 11px; font-weight: var(--fw-medium); white-space: nowrap; flex-shrink: 0; }
.nd-period > span { overflow: hidden; text-overflow: ellipsis; }
.nd-w-head .nd-period { flex-shrink: 1; min-width: 0; }
button.nd-period { cursor: pointer; font-family: inherit; }
button.nd-period:hover { border-color: var(--hcm-primary); color: var(--hcm-primary-dark); background: var(--hcm-primary-light); }
.nd-period i { font-size: 9.5px; flex-shrink: 0; }
.nd-w-body { position: relative; flex: 1; min-height: 0; margin-top: 10px; display: flex; flex-direction: column; }
.nd-root--phone .nd-w-body { margin-top: 8px; }
.nd-w-foot { display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-top: 6px; min-height: 22px; }
.nd-root button.nd-period { font-size: 11px; }
.nd-updated { font-size: 11px; color: var(--hcm-text-sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nd-w-foot .nd-link { margin-left: auto; white-space: nowrap; }
.nd-link { border: 0; background: none; padding: 0; color: var(--hcm-primary-dark); font-size: var(--fs-b9); font-weight: var(--fw-medium); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font-family: inherit; }
.nd-link:hover { text-decoration: underline; }
.nd-link i { font-size: 9px; }

/* Popovers (widget menu, More actions) */
.nd-pop { position: absolute; z-index: 20; min-width: 190px; background: var(--hcm-surface); border: 1px solid var(--hcm-link-water); border-radius: var(--r-12); box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; }
.nd-pop-lbl { font-size: var(--fs-b10); font-weight: var(--fw-medium); color: var(--hcm-hippie); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px 4px; }
.nd-pop-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: var(--r-8); font-size: var(--fs-b9); color: var(--hcm-text); cursor: pointer; white-space: nowrap; }
.nd-pop-item:hover { background: var(--hcm-foam); }
.nd-pop-item i { width: 14px; text-align: center; color: var(--hcm-text-sec); font-size: 12px; }
.nd-pop-item .nd-check { margin-left: auto; color: var(--hcm-primary); }
.nd-pop-item.is-on { color: var(--hcm-primary-dark); font-weight: var(--fw-medium); }
.nd-pop-item--danger, .nd-pop-item--danger i { color: #B42323; }
.nd-pop-item[disabled] { color: var(--hcm-text-sec); cursor: not-allowed; opacity: .6; }
.nd-pop-sep { height: 1px; background: var(--hcm-link-water); margin: 4px 2px; }

/* ── Body: Number ─────────────────────────────────────────────────── */
.nd-num { flex: 1; min-height: 0; display: flex; align-items: center; gap: 16px; }
.nd-num-main { display: flex; flex-direction: column; justify-content: center; min-width: 0; flex-shrink: 0; }
.nd-num-val { font-size: 32px; font-weight: var(--fw-semibold); color: var(--hcm-text); line-height: 1; letter-spacing: -.02em; white-space: nowrap; }
.nd-num-unit { font-size: var(--fs-b9); font-weight: var(--fw-medium); color: var(--hcm-text-sec); margin-left: 6px; letter-spacing: 0; }
.nd-cmp { font-size: 11.5px; font-weight: var(--fw-medium); margin-top: 6px; white-space: nowrap; }
.nd-cmp--good { color: #276B2E; } .nd-cmp--bad { color: #9B2C2C; } .nd-cmp--neutral { color: var(--hcm-text-sec); }
.nd-num-spark { flex: 1; min-width: 0; align-self: stretch; }
.nd-size--s .nd-num-spark { display: none; }
.nd-root--phone .nd-num-val { font-size: 28px; }

/* ── Body: List ───────────────────────────────────────────────────── */
.nd-list { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; margin: -4px -6px 0; padding: 0; list-style: none; }
.nd-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; padding: 7px 6px; border-radius: var(--r-8); cursor: pointer; font-family: inherit; }
.nd-list li + li .nd-row { box-shadow: inset 0 1px 0 var(--border-subtle); border-radius: 0 0 var(--r-8) var(--r-8); }
.nd-row:hover { background: var(--hcm-foam); }
.nd-row-txt { flex: 1; min-width: 0; }
.nd-row-p { font-size: 12.5px; font-weight: var(--fw-medium); color: var(--hcm-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.nd-row-s { font-size: 11px; color: var(--hcm-text-sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

/* ── Body: Chart ──────────────────────────────────────────────────── */
.nd-donut { display: flex; align-items: center; gap: 14px; flex: 1; min-height: 0; }
.nd-donut-svg { position: relative; height: 100%; aspect-ratio: 1; max-width: 100%; flex-shrink: 0; }
.nd-donut-svg svg { width: 100%; height: 100%; display: block; overflow: visible; }
.nd-donut-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.nd-donut-mid b { font-size: 20px; font-weight: var(--fw-semibold); color: var(--hcm-text); line-height: 1; }
.nd-donut-mid span { font-size: var(--fs-b10); color: var(--hcm-text-sec); margin-top: 2px; }
.nd-size--s .nd-donut { gap: 12px; }
.nd-donut-side { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.nd-donut-side b { font-size: 22px; font-weight: var(--fw-semibold); color: var(--hcm-text); }
.nd-donut-side span { font-size: 11px; color: var(--hcm-text-sec); }
.nd-donut-legend { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.nd-donut-legend div { display: flex; align-items: center; gap: 8px; font-size: var(--fs-b9); color: var(--hcm-text-sec); }
.nd-donut-legend i { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.nd-donut-legend b { margin-left: auto; color: var(--hcm-text); font-weight: var(--fw-medium); }
.nd-size--l .nd-donut-svg { height: 82%; }

/* ── Body: Table (and chart "Show as table") ──────────────────────── */
.nd-tablewrap { position: relative; flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--hcm-link-water); border-radius: var(--r-12); }
.nd-table { width: 100%; border-collapse: collapse; font-size: var(--fs-b9); }
.nd-table th { position: sticky; top: 0; background: var(--hcm-foam); color: var(--hcm-hippie); font-weight: var(--fw-medium); font-size: var(--fs-b10); text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 0; border-bottom: 1px solid var(--hcm-link-water); white-space: nowrap; }
.nd-table th button { width: 100%; border: 0; background: transparent; padding: 6px 10px; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; text-align: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.nd-table th button:hover { color: var(--hcm-primary-dark); }
.nd-table th.is-num, .nd-table td.is-num { text-align: right; }
.nd-table th.is-num button { justify-content: flex-end; }
.nd-tablewrap--fit { overflow: hidden; }
.nd-table td { padding: 6px 10px; border-bottom: 1px solid var(--border-subtle); color: var(--hcm-text); white-space: nowrap; }
.nd-table tr:last-child td { border-bottom: 0; }
.nd-table tbody tr { cursor: pointer; }
.nd-table tbody tr:hover td { background: var(--hcm-foam); }
.nd-table .nd-sort { font-size: 9px; color: var(--hcm-primary); }

/* ── Body: Progress ───────────────────────────────────────────────── */
.nd-prog { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.nd-prog > :first-child { margin-top: auto; } .nd-prog > :last-child { margin-bottom: auto; }
.nd-prog-ring { position: relative; height: 100%; max-height: 84px; aspect-ratio: 1; flex-shrink: 0; }
.nd-prog--ring { flex-direction: row; align-items: center; gap: 12px; }
.nd-prog--ring > :first-child, .nd-prog--ring > :last-child { margin: 0; }
.nd-prog--ring .nd-prog-nums { text-align: left; line-height: 1.35; }
.nd-prog--ring .nd-prog-nums b { display: block; font-size: 15px; }
.nd-prog-ring svg { width: 100%; height: 100%; display: block; transform: rotate(-90deg); }
.nd-prog-ring .nd-donut-mid b { font-size: 13px; }
.nd-prog-nums { font-size: var(--fs-b9); color: var(--hcm-text-sec); text-align: center; }
.nd-prog-nums b { color: var(--hcm-text); font-weight: var(--fw-semibold); }
.nd-prog-big { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.nd-prog-big b { font-size: 26px; font-weight: var(--fw-semibold); color: var(--hcm-text); line-height: 1; }
.nd-prog-big span { font-size: var(--fs-b9); color: var(--hcm-text-sec); }
.nd-bar { height: 10px; border-radius: var(--r-pill); background: var(--hcm-primary-light); overflow: hidden; position: relative; }
.nd-bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--r-pill); background: var(--hcm-primary); }
.nd-bar-foot { display: flex; justify-content: space-between; font-size: var(--fs-b10); color: var(--hcm-text-sec); }

/* ── States ───────────────────────────────────────────────────────── */
.nd-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: safe center; text-align: center; gap: 6px; padding: 4px; min-height: 0; min-width: 0; overflow-y: auto; }
.nd-state-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: var(--hcm-foam); color: var(--hcm-hippie); flex-shrink: 0; }
.nd-state-ico--warn { background: var(--hcm-sun-lt); color: #7A5007; }
.nd-state-ico--danger { background: var(--hcm-carnation-lt); color: #B42323; }
/* A message stays inside the card at every size: long words and settings (e.g. Dashboards:PreviewTenantIds) wrap. */
.nd-state-msg { font-size: var(--fs-b9); color: var(--hcm-text-sec); line-height: 1.4; width: 100%; max-width: 260px; overflow-wrap: anywhere; }
.nd-state .btn { margin-top: 2px; }
.nd-size--s .nd-state-ico { width: 26px; height: 26px; font-size: 12px; }
.nd-w--retired { background: var(--hcm-surface-alt); border-style: dashed; box-shadow: none; }
.nd-w--retired .nd-w-ico { background: var(--hcm-link-water); color: var(--hcm-text-sec); }
/* Loading skeleton — keeps the widget's size; nothing else moves */
.nd-skel { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: hidden; }
.nd-skel i { display: block; border-radius: var(--r-6); background: linear-gradient(90deg, var(--hcm-foam) 0%, var(--hcm-primary-light) 50%, var(--hcm-foam) 100%); background-size: 200% 100%; animation: nd-shimmer 1.2s linear infinite; }
.nd-skel-bars { flex: 1; display: flex; align-items: flex-end; gap: 8px; min-height: 0; }
.nd-skel-bars i { flex: 1; }
@keyframes nd-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* A grid cell (the dashboard's, or the Master Studio preview's): the widget fills it. */
.nd-cell { display: flex; min-width: 0; min-height: 0; }
.nd-cell > .nd-w { flex: 1 1 auto; width: 100%; height: 100%; }

/* ECharts draws into this box; it fills what the widget's body leaves (DASH-DEFINE, D-464). */
.nd-echart { position: absolute; inset: 0; }
.nd-chart--donut { flex: 0 0 auto; height: 100%; aspect-ratio: 1; max-width: 55%; position: relative; }
.nd-size--s .nd-chart--donut { max-width: 100%; }

/* ════ PaaS Master Studio ▸ Widgets (DASH-DEFINE, Dan's design v0.1) ═══════════════════════════════ */
.mstw-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--hcm-link-water); background: var(--hcm-surface); color: var(--hcm-text); font-size: 12px; font-weight: 500; cursor: pointer; }
.mstw-chip[aria-pressed="true"] { border-color: var(--hcm-primary); background: var(--hcm-primary); color: var(--hcm-surface); }
.mstw-chip span { opacity: .75; }
.mstw-select { height: 32px; border: 1px solid var(--hcm-link-water); border-radius: 8px; background: var(--hcm-surface); padding: 0 10px; font-size: 13px; color: var(--hcm-text); }
.mstw-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.mstw-card { text-align: left; background: var(--hcm-surface); border: 1px solid var(--hcm-link-water); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.mstw-card:hover { border-color: var(--hcm-primary); box-shadow: var(--shadow-card); }
.mstw-card:focus-visible, .mstw-step:focus-visible, .mstw-opt:focus-visible { outline: 2px solid var(--hcm-primary); outline-offset: 2px; }
.mstw-empty { padding: 36px; text-align: center; background: var(--hcm-surface); border: 1px dashed var(--hcm-link-water); border-radius: 10px; color: var(--hcm-text-sec); }
.mstw-badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.mstw-badge--Published { background: var(--hcm-mantis-lt); color: #276B2E; }
.mstw-badge--Draft { background: var(--hcm-sun-lt); color: #7A5007; }
.mstw-badge--Retired { background: var(--hcm-foam); color: var(--hcm-text-sec); }
.mstw-badge--info { background: var(--hcm-primary-light); color: var(--hcm-primary-dark); }

.mstw-editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .mstw-editor { grid-template-columns: minmax(0, 1fr); } }
.mstw-steps { display: flex; gap: 4px; flex-wrap: wrap; padding: 3px; background: var(--hcm-foam); border-radius: 8px; align-self: flex-start; }
.mstw-step { height: 32px; padding: 0 14px; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; background: transparent; color: var(--hcm-text-sec); display: inline-flex; align-items: center; gap: 6px; }
.mstw-step[aria-current="step"] { background: var(--hcm-surface); color: var(--hcm-primary-dark); }
.mstw-step:disabled { cursor: not-allowed; opacity: .5; }
.mstw-step b { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; background: var(--hcm-link-water); color: var(--hcm-text); }
.mstw-step[aria-current="step"] b { background: var(--hcm-primary); color: var(--hcm-surface); }
.mstw-panel { background: var(--hcm-surface); border: 1px solid var(--hcm-link-water); border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.mstw-field { display: flex; flex-direction: column; gap: 6px; }
.mstw-label { font-size: 12px; font-weight: 600; color: var(--hcm-text); }
.mstw-help { font-size: 12px; color: var(--hcm-text-sec); }
.mstw-err { font-size: 12px; color: #B42323; }
.mstw-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.mstw-opt { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--hcm-link-water); background: var(--hcm-surface); color: var(--hcm-text); font-size: 13px; cursor: pointer; }
.mstw-opt[aria-pressed="true"], .mstw-opt[aria-checked="true"] { border-color: var(--hcm-primary); background: var(--hcm-primary-light); color: var(--hcm-primary-dark); font-weight: 500; }
.mstw-opt:disabled { opacity: .5; cursor: not-allowed; }
.mstw-source { text-align: left; width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--hcm-link-water); border-radius: 10px; background: var(--hcm-surface); cursor: pointer; }
.mstw-source[aria-checked="true"] { border-color: var(--hcm-primary); background: var(--hcm-primary-light); }
.mstw-input { height: 34px; border: 1px solid var(--hcm-link-water); border-radius: 8px; padding: 0 10px; font-size: 13px; color: var(--hcm-text); background: var(--hcm-surface); width: 100%; }
textarea.mstw-input { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; }
.mstw-input[aria-invalid="true"] { border-color: #B42323; }
.mstw-preview { position: sticky; top: 0; }
.mstw-stage { background: var(--hcm-bg, #F4F7FB); border-radius: 12px; padding: 16px; display: grid; justify-content: center; }
.mstw-stage .nd-root { --nd-cell-h: 176px; --nd-gap: 16px; }
.mstw-stage--phone .nd-root { --nd-cell-h: 150px; --nd-gap: 10px; }
.mstw-issues { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--hcm-text-sec); }
.mstw-dialog-back { position: fixed; inset: 0; background: rgba(11, 28, 48, .45); z-index: 1000; display: grid; place-items: center; padding: 16px; }
.mstw-dialog { background: var(--hcm-surface); border-radius: 12px; width: min(520px, 100%); max-height: 85vh; overflow: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg); }
.mstw-dialog:focus { outline: none; }
.mstw-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.mstw-alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.mstw-alert--danger { background: var(--hcm-carnation-lt); color: var(--hcm-text); }
.mstw-alert--warn { background: var(--hcm-sun-lt); color: var(--hcm-text); }
.mstw-alert--info { background: var(--hcm-primary-light); color: var(--hcm-text); }
/* DASH-REPORT-SOURCES: New widgets from a report */
.mstw-from-report { padding: 16px; margin-bottom: 16px; border: 1px solid var(--hcm-link-water); border-radius: 12px; background: var(--hcm-surface); }
.mstw-from-report-options { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.mstw-from-report-option { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--hcm-text); font-size: 13px; text-align: left; cursor: pointer; }
.mstw-from-report-option:hover:not(:disabled) { background: var(--hcm-primary-light); }
.mstw-from-report-option:disabled { cursor: default; color: var(--hcm-text-ter); }
.mstw-from-report-option i { color: var(--hcm-primary); width: 16px; }
.mstw-from-report-meta { font-size: 11px; color: var(--hcm-text-ter); }
