/* MOPC Customer Portal — self-serve account widget.
   Same design language as the order-intake storefront (teal brand, host-theme
   fonts). ALL classes use the .mopc-cp-* prefix, and every rule that styles a
   button/input/link/label/heading is prefixed with .mopc-customer-portal so it
   out-specs host-theme element styling (Hello Elementor kit themes bare
   elements site-wide at up to (0,3,1) — see the order-intake firewall notes
   and tests/theme-cascade.mjs, which guards this file too). */

.mopc-customer-portal {
  position: relative;
  isolation: isolate;

  --cp-primary: #0a7d63;
  --cp-primary-d: #086450;
  --cp-primary-tint: #e8f3ef;
  --cp-hover: #eceff2;
  --cp-hero: #12467a;
  --cp-hero-ink: #ffffff;
  --cp-bg: #f6f7f9;
  --cp-card: #ffffff;
  --cp-border: #e3e6ea;
  --cp-border-2: #cfd6dd;
  --cp-text: #1c2530;
  --cp-ink: #16201a;
  --cp-muted: #5b6573;
  --cp-ok-bg: #e8f5f0;
  --cp-warn: #8a5a00;
  --cp-warn-bg: #fdf3e3;
  --cp-err: #b42318;
  --cp-err-bg: #fdecea;
  --cp-info-bg: #e8f0fb;
  --cp-radius: 14px;
  --cp-shadow: 0 1px 2px rgba(28, 37, 48, .05), 0 10px 26px -18px rgba(28, 37, 48, .25);

  font-family: inherit;
  color: var(--cp-text);
  font-size: 16px;
  line-height: 1.5;
  accent-color: var(--cp-primary);
}
.mopc-customer-portal *,
.mopc-customer-portal *::before,
.mopc-customer-portal *::after { box-sizing: border-box; }

/* ── Host-theme firewall: de-theme bare controls inside the widget ─────────
   :where() keeps specificity at zero so the explicit rules below still win,
   while clearing any kit element styling that would otherwise bleed in. */
.mopc-customer-portal :where(button) {
  all: unset;
  box-sizing: border-box;
  font: inherit;
  cursor: pointer;
}
.mopc-customer-portal :where(input, textarea) {
  font: inherit;
  color: inherit;
}
.mopc-customer-portal :where(h2, h3) {
  margin: 0 0 .6rem;
  padding: 0;
  font-family: inherit;
  color: var(--cp-text);
}
.mopc-customer-portal :where(a) {
  color: var(--cp-primary);
  text-decoration: underline;
}

/* ── Width: break out of block-theme content-size caps ─────────────────────
   Block themes (e.g. Twenty Twenty-Four) drop the widget inside an
   `.is-layout-constrained` post-content that caps every child to
   `--wp--style--global--content-size` (~620px). That was fine for the old
   single-column widget but crushes the new sidebar + content + tile grid, so
   the columns pile onto each other. The doubled class (0,2,0) out-specs the
   theme's (0,1,0) `max-width` regardless of stylesheet order; the cap's
   margins are `!important` but its width is not, so this wins. `94vw` keeps
   the wider widget from forcing horizontal scroll on small screens. */
.mopc-customer-portal.mopc-customer-portal {
  max-width: min(64rem, 94vw);
  margin-inline: auto;
}
.mopc-customer-portal .mopc-cp {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

/* ── Cards ── */
.mopc-customer-portal .mopc-cp-card {
  background: var(--cp-card);
  border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius);
  box-shadow: var(--cp-shadow);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.mopc-customer-portal .mopc-cp-card--narrow {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}
.mopc-customer-portal .mopc-cp-card h2 { font-size: 1.3rem; }
.mopc-customer-portal .mopc-cp-card h3 { font-size: 1.05rem; margin-top: 1.1rem; }

.mopc-customer-portal .mopc-cp-muted { color: var(--cp-muted); font-size: .92rem; }

/* ── Flow bar (full-width self-contained flows) ── */
.mopc-customer-portal .mopc-cp-flowbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.mopc-customer-portal .mopc-cp-title { font-weight: 700; font-size: 1.15rem; }
.mopc-customer-portal .mopc-cp-logout {
  font-family: inherit;
  min-height: 44px;
  padding: .4rem .9rem;
  border-radius: 8px;
  color: var(--cp-muted);
  border: 1px solid var(--cp-border-2);
}
.mopc-customer-portal .mopc-cp-logout:hover { color: var(--cp-err); border-color: var(--cp-err); }

/* ── Buttons ── */
.mopc-customer-portal .mopc-cp-btn {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .55rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--cp-border-2);
  background: var(--cp-card);
  color: var(--cp-text);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.mopc-customer-portal .mopc-cp-btn:hover { border-color: var(--cp-primary); }
.mopc-customer-portal .mopc-cp-btn--primary {
  background: var(--cp-primary);
  border-color: var(--cp-primary);
  color: #fff;
}
.mopc-customer-portal .mopc-cp-btn--primary:hover { background: var(--cp-primary-d); }
.mopc-customer-portal .mopc-cp-btn[disabled],
.mopc-customer-portal .mopc-cp-btn:disabled { opacity: .55; cursor: not-allowed; }
.mopc-customer-portal .mopc-cp-btn:focus-visible,
.mopc-customer-portal .mopc-cp-tab:focus-visible,
.mopc-customer-portal .mopc-cp-logout:focus-visible,
.mopc-customer-portal .mopc-cp-linkbtn:focus-visible {
  outline: 3px solid var(--cp-ink);
  outline-offset: 2px;
}

.mopc-customer-portal .mopc-cp-linkbtn {
  font-family: inherit;
  color: var(--cp-err);
  text-decoration: underline;
  padding: .25rem .4rem;
  min-height: 32px;
}

/* ── Forms (input class tripled to out-spec kit input rules) ── */
.mopc-customer-portal .mopc-cp-label {
  font-family: inherit;
  display: block;
  font-weight: 600;
  margin: .8rem 0 .3rem;
}
.mopc-customer-portal .mopc-cp-input.mopc-cp-input.mopc-cp-input {
  font-family: inherit;
  display: block;
  width: 100%;
  min-height: 44px;
  padding: .55rem .8rem;
  margin-bottom: .9rem;
  border: 1px solid var(--cp-border-2);
  border-radius: 10px;
  background: #fff;
  color: var(--cp-text);
  font-size: 1rem;
}
.mopc-customer-portal .mopc-cp-input.mopc-cp-input.mopc-cp-input:focus {
  outline: 3px solid var(--cp-ink);
  outline-offset: 1px;
  border-color: var(--cp-primary);
}

/* ── Alerts ── */
.mopc-customer-portal .mopc-cp-msg {
  border-radius: 10px;
  padding: .7rem .9rem;
  margin: .6rem 0 .9rem;
  font-size: .95rem;
}
.mopc-customer-portal .mopc-cp-msg--ok { background: var(--cp-ok-bg); color: var(--cp-primary-d); }
.mopc-customer-portal .mopc-cp-msg--err { background: var(--cp-err-bg); color: var(--cp-err); }
.mopc-customer-portal .mopc-cp-msg--info { background: var(--cp-info-bg); }

/* ── Subscriptions ── */
.mopc-customer-portal .mopc-cp-subs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1rem;
}
.mopc-customer-portal .mopc-cp-sub {
  border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.mopc-customer-portal .mopc-cp-sub-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
}
.mopc-customer-portal .mopc-cp-sub-name { font-size: 1.05rem; margin: 0; }

.mopc-customer-portal .mopc-cp-status {
  display: inline-block;
  border-radius: 999px;
  padding: .15rem .6rem;
  font-size: .8rem;
  font-weight: 600;
  background: var(--cp-info-bg);
  white-space: nowrap;
}
.mopc-customer-portal .mopc-cp-status--live,
.mopc-customer-portal .mopc-cp-status--applied,
.mopc-customer-portal .mopc-cp-status--approved { background: var(--cp-ok-bg); color: var(--cp-primary-d); }
.mopc-customer-portal .mopc-cp-status--trial,
.mopc-customer-portal .mopc-cp-status--future,
.mopc-customer-portal .mopc-cp-status--pending { background: var(--cp-warn-bg); color: var(--cp-warn); }
.mopc-customer-portal .mopc-cp-status--unpaid,
.mopc-customer-portal .mopc-cp-status--past_due,
.mopc-customer-portal .mopc-cp-status--dunning,
.mopc-customer-portal .mopc-cp-status--trial_expired,
.mopc-customer-portal .mopc-cp-status--cancelled,
.mopc-customer-portal .mopc-cp-status--cancelled_from_dunning,
.mopc-customer-portal .mopc-cp-status--creation_failed,
.mopc-customer-portal .mopc-cp-status--expired,
.mopc-customer-portal .mopc-cp-status--rejected { background: var(--cp-err-bg); color: var(--cp-err); }

.mopc-customer-portal .mopc-cp-facts { margin: 0; }
.mopc-customer-portal .mopc-cp-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .25rem 0;
  border-bottom: 1px dashed var(--cp-border);
}
.mopc-customer-portal .mopc-cp-facts dt { color: var(--cp-muted); font-size: .9rem; }
.mopc-customer-portal .mopc-cp-facts dd { margin: 0; font-weight: 600; }

.mopc-customer-portal .mopc-cp-addons span { font-weight: 600; font-size: .9rem; }
.mopc-customer-portal .mopc-cp-addons ul { margin: .25rem 0 0 1.1rem; padding: 0; }

/* ── Partner-billed service + provider-switch surfaces ── */
.mopc-customer-portal .mopc-cp-partner-note { margin: .5rem 0 0; font-size: .9rem; }
.mopc-customer-portal .mopc-cp-switch-what { margin: .75rem 0; }
.mopc-customer-portal .mopc-cp-switch-what strong { font-size: .95rem; }
.mopc-customer-portal .mopc-cp-switch-what ul { margin: .35rem 0 0 1.1rem; padding: 0; }
.mopc-customer-portal .mopc-cp-switch-what li { margin: .2rem 0; }

/* ── Billing table ── */
.mopc-customer-portal .mopc-cp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
.mopc-customer-portal .mopc-cp-table th,
.mopc-customer-portal .mopc-cp-table td {
  text-align: left;
  padding: .5rem .6rem;
  border-bottom: 1px solid var(--cp-border);
}
.mopc-customer-portal .mopc-cp-table th { color: var(--cp-muted); font-weight: 600; }
.mopc-customer-portal .mopc-cp-card-line { font-weight: 600; }

/* ── Requests ── */
.mopc-customer-portal .mopc-cp-requests { list-style: none; margin: 0; padding: 0; }
.mopc-customer-portal .mopc-cp-request {
  border: 1px solid var(--cp-border);
  border-radius: 10px;
  padding: .8rem .9rem;
  margin-bottom: .7rem;
}
.mopc-customer-portal .mopc-cp-request-meta {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: .35rem;
  flex-wrap: wrap;
}

/* ── Plan cards — the marketplace component, ported from order-intake.css
   (.mopc-oi-plan family) so the portal and the storefront render the SAME
   card: pill, name, 2-line tagline, big price, spec-icon strip, feature
   checklist, select button. All values are catalog/DB-driven. ── */
.mopc-customer-portal .mopc-cp-planlist {
  border: 0;
  margin: 0 0 .5rem;
  padding: 0;
  min-width: 0;
}
.mopc-customer-portal .mopc-cp-planlist legend {
  font-weight: 600;
  margin-bottom: .5rem;
  padding: 0;
}
.mopc-customer-portal .mopc-cp-plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: .6rem;
}
.mopc-customer-portal .mopc-cp-plan {
  font-family: inherit;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--cp-border);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  background: var(--cp-card);
  box-shadow: var(--cp-shadow);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.mopc-customer-portal .mopc-cp-plan:hover { border-color: var(--cp-border-2); transform: translateY(-2px); }
.mopc-customer-portal .mopc-cp-plan .mopc-cp-plan-radio {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.mopc-customer-portal .mopc-cp-plan.is-on,
.mopc-customer-portal .mopc-cp-plan:has(.mopc-cp-plan-radio:checked) {
  border-color: var(--cp-primary);
  box-shadow: 0 0 0 2.5px rgba(10, 125, 99, .18), var(--cp-shadow);
}
.mopc-customer-portal .mopc-cp-plan:has(input:focus-visible) {
  outline: 2px solid var(--cp-primary);
  outline-offset: 2px;
}
.mopc-customer-portal .mopc-cp-plan-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mopc-customer-portal .mopc-cp-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--cp-ok-bg);
  color: var(--cp-primary-d);
}
.mopc-customer-portal .mopc-cp-selbadge {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--cp-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
}
.mopc-customer-portal .mopc-cp-plan.is-on .mopc-cp-selbadge,
.mopc-customer-portal .mopc-cp-plan:has(.mopc-cp-plan-radio:checked) .mopc-cp-selbadge { display: inline-block; }
.mopc-customer-portal .mopc-cp-plan-name { font-weight: 700; font-size: 19px; margin: 0 0 2px; }
/* Taglines occupy exactly two lines so cards stay aligned. */
.mopc-customer-portal .mopc-cp-plan-tag {
  color: var(--cp-muted);
  font-size: 14px;
  line-height: 1.4;
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.mopc-customer-portal .mopc-cp-price { display: flex; align-items: baseline; gap: 2px; margin: 14px 0 0; }
.mopc-customer-portal .mopc-cp-price .cur { font-weight: 700; font-size: 18px; align-self: flex-start; margin-top: 5px; }
.mopc-customer-portal .mopc-cp-price .amt { font-weight: 800; font-size: 42px; line-height: .95; letter-spacing: -.02em; }
.mopc-customer-portal .mopc-cp-price .per { color: var(--cp-muted); font-size: 15px; font-weight: 500; }
.mopc-customer-portal .mopc-cp-plan-note { color: var(--cp-warn); font-size: 13px; font-weight: 600; margin-top: 2px; }

/* Icon spec strip (up to 3 headline specs, internet cards only). */
.mopc-customer-portal .mopc-cp-icons {
  display: flex;
  justify-content: space-around;
  gap: 4px;
  padding: 14px 0;
  margin: 14px 0;
  border-top: 1px solid var(--cp-border);
  border-bottom: 1px solid var(--cp-border);
  text-align: center;
}
.mopc-customer-portal .mopc-cp-icon { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--cp-primary); }
.mopc-customer-portal .mopc-cp-icon svg { width: 22px; height: 22px; }
.mopc-customer-portal .mopc-cp-icon-val { font-weight: 700; font-size: 14px; color: var(--cp-text); line-height: 1.2; }
.mopc-customer-portal .mopc-cp-icon-lbl { font-size: 11.5px; color: var(--cp-muted); }

/* Feature checklist (green check) — the plan's own catalog features. */
.mopc-customer-portal .mopc-cp-features { list-style: none; margin: 4px 0 16px; padding: 0; display: grid; gap: 8px; flex: 1; }
.mopc-customer-portal .mopc-cp-features li { position: relative; padding-left: 26px; font-size: 14px; color: var(--cp-text); }
.mopc-customer-portal .mopc-cp-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cp-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.mopc-customer-portal .mopc-cp-selbtn {
  display: block;
  text-align: center;
  padding: 12px;
  min-height: 46px;
  margin-top: auto;
  border-radius: 11px;
  font-weight: 700;
  font-size: 15px;
  border: 1.5px solid var(--cp-primary);
  background: var(--cp-card);
  color: var(--cp-primary-d);
}
.mopc-customer-portal .mopc-cp-plan:hover .mopc-cp-selbtn { background: var(--cp-primary-tint); }
.mopc-customer-portal .mopc-cp-plan.is-on .mopc-cp-selbtn,
.mopc-customer-portal .mopc-cp-plan:has(.mopc-cp-plan-radio:checked) .mopc-cp-selbtn { background: var(--cp-primary); color: #fff; }
.mopc-customer-portal .mopc-cp-selbtn .txt-sel { display: none; }
.mopc-customer-portal .mopc-cp-plan.is-on .mopc-cp-selbtn .txt-pick,
.mopc-customer-portal .mopc-cp-plan:has(.mopc-cp-plan-radio:checked) .mopc-cp-selbtn .txt-pick { display: none; }
.mopc-customer-portal .mopc-cp-plan.is-on .mopc-cp-selbtn .txt-sel,
.mopc-customer-portal .mopc-cp-plan:has(.mopc-cp-plan-radio:checked) .mopc-cp-selbtn .txt-sel { display: inline; }

.mopc-customer-portal .mopc-cp-row {
  display: flex;
  gap: .7rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.mopc-customer-portal .mopc-cp-sub-actions { margin-top: .9rem; }

/* ── Address picker (move request) ─────────────────────────────────────── */
.mopc-customer-portal .mopc-cp-suggest {
  display: grid;
  gap: 2px;
  margin: .25rem 0 .5rem;
}
.mopc-customer-portal .mopc-cp-suggest-item {
  font-family: inherit;
  font-size: 1rem;
  text-align: left;
  background: var(--cp-surface, #fff);
  border: 1px solid var(--cp-border-2);
  border-radius: 8px;
  padding: .6rem .8rem;
  cursor: pointer;
  color: inherit;
}
.mopc-customer-portal .mopc-cp-suggest-item:hover,
.mopc-customer-portal .mopc-cp-suggest-item:focus-visible {
  border-color: var(--cp-primary);
  background: var(--cp-primary-tint);
}
.mopc-customer-portal .mopc-cp-suggest-note {
  color: var(--cp-muted, #667);
  font-size: .9rem;
  padding: .3rem .1rem;
}

/* ── Add-a-service picker (per-group sections + review) ─────────────────── */
/* "No thanks" stays a compact full-width row under the card grid. */
.mopc-customer-portal .mopc-cp-plan--none {
  flex-direction: row;
  align-items: center;
  gap: .7rem;
  opacity: .8;
  padding: .7rem .9rem;
  border-radius: 10px;
  border-width: 1px;
  box-shadow: none;
  margin-bottom: .6rem;
}
.mopc-customer-portal .mopc-cp-plan--none:hover { transform: none; }
.mopc-customer-portal .mopc-cp-plan--none.is-on { background: var(--cp-primary-tint); box-shadow: none; }
.mopc-customer-portal .mopc-cp-plan--none input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
}
.mopc-customer-portal .mopc-cp-plan--none .mopc-cp-plan-name { font-size: 1rem; font-weight: 600; }
.mopc-customer-portal .mopc-cp-svc-addons { margin: .35rem 0 .1rem; }

/* Marketplace add-on rows (storefront .mopc-oi-addon-row): name + catalog
   description + price/cadence + switch. */
.mopc-customer-portal .mopc-cp-addon-tier { margin: .8rem 0 .4rem; font-weight: 600; }
.mopc-customer-portal .mopc-cp-addon-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--cp-border);
  border-radius: 12px;
  margin-bottom: 8px;
  background: var(--cp-card);
}
.mopc-customer-portal .mopc-cp-addon-row.is-on { border-color: var(--cp-primary); background: var(--cp-ok-bg); }
.mopc-customer-portal .mopc-cp-addon-meta { flex: 1; min-width: 0; display: grid; cursor: pointer; }
.mopc-customer-portal .mopc-cp-addon-name { font-weight: 600; }
.mopc-customer-portal .mopc-cp-addon-desc { color: var(--cp-muted); font-size: 13px; }
.mopc-customer-portal .mopc-cp-addon-price { font-weight: 700; white-space: nowrap; }
.mopc-customer-portal .mopc-cp-addon-price small { font-weight: 500; color: var(--cp-muted); font-size: 11px; }

/* toggle = switch (storefront .mopc-oi-switch) */
.mopc-customer-portal .mopc-cp-switch { position: relative; width: 50px; height: 30px; flex: none; }
.mopc-customer-portal .mopc-cp-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.mopc-customer-portal .mopc-cp-switch .track {
  position: absolute;
  inset: 0;
  background: var(--cp-border-2);
  border-radius: 999px;
  transition: background .2s;
  pointer-events: none;
}
.mopc-customer-portal .mopc-cp-switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.mopc-customer-portal .mopc-cp-switch input:checked + .track { background: var(--cp-primary); }
.mopc-customer-portal .mopc-cp-switch input:focus-visible + .track {
  outline: 2px solid var(--cp-primary);
  outline-offset: 2px;
}
.mopc-customer-portal .mopc-cp-switch input:checked + .track::after { transform: translateX(20px); }

.mopc-customer-portal .mopc-cp-review-addon dt { font-weight: 400; padding-left: .9rem; }

/* ── Bill hero ─────────────────────────────────────────────────────────── */
.mopc-customer-portal .mopc-cp-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--cp-hero);
  color: var(--cp-hero-ink);
  border-radius: var(--cp-radius);
  box-shadow: var(--cp-shadow);
  padding: 1.1rem 1.4rem;
  margin-bottom: 1rem;
}
.mopc-customer-portal .mopc-cp-hero-info { display: flex; flex-direction: column; gap: .1rem; }
.mopc-customer-portal .mopc-cp-hero-title { font-size: .95rem; opacity: .85; }
.mopc-customer-portal .mopc-cp-hero-amount { font-size: 1.8rem; font-weight: 700; line-height: 1.15; }
.mopc-customer-portal .mopc-cp-hero-due { font-size: .9rem; opacity: .9; }
.mopc-customer-portal .mopc-cp-hero-btn {
  font-family: inherit;
  min-height: 44px;
  padding: .5rem 1.2rem;
  border-radius: 10px;
  background: var(--cp-hero-ink);
  color: var(--cp-hero);
  font-weight: 600;
  border: 1px solid transparent;
}
.mopc-customer-portal .mopc-cp-hero-btn:hover { opacity: .92; }

/* ── App shell (sidebar + content) ─────────────────────────────────────── */
.mopc-customer-portal .mopc-cp-app {
  display: grid;
  /* minmax(0, 1fr) lets the content track shrink below its min-content width
     instead of overflowing into (and overlapping) the sidebar column. */
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.mopc-customer-portal .mopc-cp-sidebar {
  position: sticky;
  top: 1rem;
  background: var(--cp-card);
  border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius);
  box-shadow: var(--cp-shadow);
  padding: .7rem;
  display: grid;
  gap: .5rem;
  /* The sidebar sits in a fixed 14rem grid track. Without min-width:0 it would
     size to its min-content (the long, nowrap plan name) and overflow the
     track — spilling its rows on top of the content column. min-width:0 here
     and on every nested grid/flex item below keeps everything inside 14rem. */
  min-width: 0;
}
.mopc-customer-portal .mopc-cp-side-services,
.mopc-customer-portal .mopc-cp-side-footer { display: grid; gap: .2rem; min-width: 0; }
.mopc-customer-portal .mopc-cp-side-footer {
  border-top: 1px solid var(--cp-border);
  padding-top: .5rem;
  margin-top: .2rem;
}
.mopc-customer-portal .mopc-cp-side-heading {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--cp-muted);
  padding: .2rem .5rem .1rem;
}
.mopc-customer-portal .mopc-cp-side-loading { padding: .3rem .5rem; }
.mopc-customer-portal .mopc-cp-side-row,
.mopc-customer-portal .mopc-cp-side-add {
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  min-width: 0;          /* respect the 14rem track instead of min-content */
  max-width: 100%;
  min-height: 44px;
  padding: .45rem .6rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--cp-text);
  text-align: left;
}
/* Hover is a neutral grey; the SELECTED row alone gets the teal tint + border,
   so the two states are never confusable (FE-07). */
.mopc-customer-portal .mopc-cp-side-row:hover,
.mopc-customer-portal .mopc-cp-side-add:hover { background: var(--cp-hover); }
.mopc-customer-portal .mopc-cp-side-row.is-active {
  background: var(--cp-primary-tint);
  border-color: var(--cp-primary);
}
.mopc-customer-portal .mopc-cp-side-row.is-active:hover { background: var(--cp-primary-tint); }
.mopc-customer-portal .mopc-cp-side-row.is-active .mopc-cp-side-label { color: var(--cp-primary-d); }
.mopc-customer-portal .mopc-cp-side-icon { font-size: 1.1rem; line-height: 1; width: 1.4rem; flex: none; text-align: center; }
.mopc-customer-portal .mopc-cp-side-text { display: flex; flex-direction: column; min-width: 0; }
.mopc-customer-portal .mopc-cp-side-label,
.mopc-customer-portal .mopc-cp-side-plan {
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mopc-customer-portal .mopc-cp-side-label { font-weight: 600; font-size: .95rem; }
.mopc-customer-portal .mopc-cp-side-plan { font-size: .82rem; color: var(--cp-muted); }
/* Terminal (cancelled/expired/…) service marker in the sidebar. */
.mopc-customer-portal .mopc-cp-side-status { font-size: .74rem; color: var(--cp-err); }
.mopc-customer-portal .mopc-cp-side-link {
  font-family: inherit;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  padding: .4rem .6rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--cp-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.mopc-customer-portal .mopc-cp-side-link:hover { background: var(--cp-hover); }
.mopc-customer-portal .mopc-cp-side-link.is-active { color: var(--cp-primary-d); font-weight: 700; }
/* The sign-out button lives in the sidebar footer here — fill the track width
   like the links (FE-06); its flow-bar use elsewhere keeps its own sizing. */
.mopc-customer-portal .mopc-cp-side-footer .mopc-cp-logout {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}
.mopc-customer-portal .mopc-cp-content { min-width: 0; }

/* ── Service action grid ───────────────────────────────────────────────── */
.mopc-customer-portal .mopc-cp-svc-head {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1rem;
}
.mopc-customer-portal .mopc-cp-svc-icon { font-size: 1.6rem; line-height: 1; }
.mopc-customer-portal .mopc-cp-svc-titles { display: flex; flex-direction: column; }
.mopc-customer-portal .mopc-cp-svc-group { font-size: .82rem; color: var(--cp-muted); }
.mopc-customer-portal .mopc-cp-svc-name { font-size: 1.2rem; margin: 0; }
.mopc-customer-portal .mopc-cp-svc-head .mopc-cp-status { margin-left: auto; }
.mopc-customer-portal .mopc-cp-tiles {
  display: grid;
  /* min(11rem, 100%) so a tile never forces the grid wider than its container
     (which would blow the layout out) when the content column is narrow. */
  grid-template-columns: repeat(auto-fill, minmax(min(11rem, 100%), 1fr));
  gap: .8rem;
  margin-bottom: 1.4rem;
}
.mopc-customer-portal .mopc-cp-tile {
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-height: 92px;
  padding: .9rem;
  border-radius: 14px;
  border: 1px solid var(--cp-border-2);
  background: var(--cp-card);
  color: var(--cp-text);
  text-align: left;
}
.mopc-customer-portal .mopc-cp-tile:hover { border-color: var(--cp-primary); background: var(--cp-primary-tint); }
.mopc-customer-portal .mopc-cp-tile-icon { font-size: 1.3rem; line-height: 1; }
.mopc-customer-portal .mopc-cp-tile-title { font-weight: 600; }
.mopc-customer-portal .mopc-cp-tile-sub { font-size: .85rem; color: var(--cp-muted); }
.mopc-customer-portal .mopc-cp-tile--danger .mopc-cp-tile-icon,
.mopc-customer-portal .mopc-cp-tile--danger .mopc-cp-tile-title { color: var(--cp-err); }
.mopc-customer-portal .mopc-cp-tile--danger:hover { border-color: var(--cp-err); background: var(--cp-err-bg); }

.mopc-customer-portal .mopc-cp-side-row:focus-visible,
.mopc-customer-portal .mopc-cp-side-add:focus-visible,
.mopc-customer-portal .mopc-cp-side-link:focus-visible,
.mopc-customer-portal .mopc-cp-tile:focus-visible,
.mopc-customer-portal .mopc-cp-hero-btn:focus-visible {
  outline: 2px solid var(--cp-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .mopc-customer-portal * { transition: none !important; }
}

@media (max-width: 48rem) {
  .mopc-customer-portal .mopc-cp-card { padding: 1rem; }
  .mopc-customer-portal .mopc-cp-flowbar { gap: .5rem; }
  .mopc-customer-portal .mopc-cp-app { grid-template-columns: 1fr; }
  /* Content before the sidebar so keyboard/SR users reach the actions first. */
  .mopc-customer-portal .mopc-cp-content { order: 1; }
  .mopc-customer-portal .mopc-cp-sidebar { position: static; order: 2; }
  .mopc-customer-portal .mopc-cp-hero { padding: 1rem; }
}
