/* The portal shares the public site's wordmark, action colour and warm paper. */
:root[data-surface="digital"][data-product="mobilebarn-digital"] {
  color-scheme: light;
  --bg: #f7f3ec;
  --panel: #fffcf8;
  --panel2: #efebe4;
  --text: #171411;
  --muted: #514b43;
  --line: #c7bfb2;
  --field-line: #81756a;
  --rail: #1a1a1a;
  --rail-text: #fff;
  --rail-muted: #d6d1ca;
  --rail-line: #514c46;
  --action: var(--mb-brand-orange, #ff5a00);
  --action-ink: var(--mb-brand-orange-ink, #8a2d00);
  --focus: var(--action-ink);
  --green: #286643;
  --green-bg: #e5f2e8;
  --gold: #63420b;
  --gold-bg: #fff0d4;
  --red: #8e2922;
  --red-bg: #fbe7e4;
  --info: #234c67;
  --info-bg: #e8f2f7;
  --rose: #873a5a;
  --rose-bg: #f8eaf0;
  --control-radius: 8px;
  --panel-radius: 12px;
  --gutter: clamp(16px, 3.6vw, 48px);
  --content-width: 82rem;
  background: var(--bg);
}

* { box-sizing: border-box; }

:root[data-surface="digital"][data-product="mobilebarn-digital"] body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 1rem / 1.5 var(--mb-os-font-sans, Inter, system-ui, sans-serif);
  overflow-wrap: anywhere;
}

:where(h1, h2, h3, h4, p) { margin: 0; }
:where(h1, h2, h3, h4) { line-height: 1.18; }
:where(img, input, textarea, select) { max-width: 100%; }
:where(input, textarea, select) { min-width: 0; }
img { display: block; }
textarea { resize: vertical; }
.hidden, [hidden], .module { display: none !important; }
.module.active { display: block !important; }
.muted, .helper { color: var(--muted); }
.helper { font-size: .875rem; }

body a:not(.btn) {
  color: var(--action-ink);
  text-underline-offset: .2em;
}
body :is(.main, .portal-auth-card) a:not(.btn) { text-decoration: underline; }

body :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: none;
}

body :is(button, .btn, .account-toggle, .account-menu a, .account-menu button, .nav a, summary) {
  min-height: 44px;
  min-width: 44px;
}

body .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  background: var(--action);
  box-shadow: none;
  color: #0a0a0a;
  font: inherit;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  cursor: pointer;
}

body .btn.alt {
  border-color: var(--field-line);
  background: var(--panel);
  color: var(--text);
}

body .btn:not(:disabled):hover { filter: brightness(.96); }
body :is(button, input, select, textarea):disabled { cursor: not-allowed; }
body .btn:disabled {
  opacity: 1;
  border-color: var(--line);
  background: var(--panel2);
  color: var(--muted);
}
body .btn[aria-busy="true"] { cursor: progress; }
body summary { align-content: center; cursor: pointer; font-weight: 650; }

.skip-link {
  position: fixed;
  z-index: 50;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: var(--control-radius);
  background: var(--action);
  font-weight: 800;
}
body .skip-link:not(.btn) { color: #0a0a0a; }
.skip-link:focus { transform: none; }

/* Signed-out shell and authentication forms. */
.login { min-height: 100vh; }
.portal-auth-header {
  background: var(--rail);
  border-bottom: 2px solid var(--action);
  padding: 14px var(--gutter);
}
.portal-auth-header .login-brand { max-width: var(--content-width); margin-inline: auto; }
.portal-auth-header .login-brand img {
  width: min(225px, 100%);
  max-width: 100%;
  height: auto;
}
.portal-auth-card {
  width: min(calc(100% - 2 * var(--gutter)), 40rem);
  margin: clamp(22px, 6vh, 64px) auto;
  padding: clamp(16px, 4vw, 36px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
}
.portal-auth-card h1 {
  margin-bottom: 8px;
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  letter-spacing: -.047em;
  font-weight: 850;
}
.portal-auth-card h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); }
.portal-auth-card > .form { margin-top: 20px; }
.portal-auth-card > .notice { margin-top: 16px; }
.portal-auth-card > .form > .btn[type="submit"] { margin-top: 6px; }
.portal-auth-card #publicAuthLinks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 12px;
  margin-top: 12px;
}
#publicAuthLinks a { display: inline-flex; align-items: center; min-height: 44px; }
.portal-auth-card #demoButton { margin-top: 6px; }
.login-error, .field-error { color: var(--red); line-height: 1.5; }

/* Shared signed-in chrome. */
body .shell {
  display: grid;
  grid-template-columns: clamp(13.25rem, 21vw, 16rem) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}
body .side {
  position: sticky;
  top: 0;
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: start;
  overflow-y: auto;
  height: 100vh;
  height: 100dvh;
  padding: 18px 14px 24px;
  background: var(--rail);
  color: var(--rail-text);
  --focus: var(--mb-brand-orange-soft, #ff9b70);
}
.portal-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px 14px;
  border-bottom: 2px solid var(--action);
}
.portal-sidebar-top .brand { flex: 0 1 210px; min-width: 0; min-height: 44px; }
body .portal-sidebar-top .brand img {
  width: min(100%, 210px);
  height: auto !important;
  max-width: 100% !important;
}
#portalNavToggle { display: none; }
body .shell > .side .nav {
  position: static;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  overflow: visible;
  padding: 10px 4px 4px;
  border: 0;
  margin: 0;
  background: transparent;
}
.portal-nav-group { display: grid; gap: 3px; }
.portal-nav-label {
  padding: 5px 11px 1px;
  font-size: .79rem;
  font-weight: 650;
  color: var(--rail-muted);
}
body .shell > .side .nav a:not(.btn) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  color: var(--rail-text);
  font-size: .925rem;
  font-weight: 650;
  line-height: 1.4;
  text-decoration: none;
  white-space: normal;
}
body .shell > .side .nav a:hover { background: #312d29; }
body .shell > .side .nav a.active {
  border-inline-start: 4px solid var(--action);
  padding-inline-start: 8px;
  background: #552b1a;
  font-weight: 800;
}
.portal-toolbar, body .main {
  width: 100%;
  max-width: var(--content-width);
  min-width: 0;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.portal-toolbar {
  grid-column: 2;
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  padding-bottom: 8px;
  z-index: 10;
}
body .main { grid-column: 2; padding-top: 10px; padding-bottom: 48px; }
.account { position: relative; width: min(100%, 18rem); }
.account-toggle {
  position: relative;
  width: 100%;
  padding: 9px 36px 9px 12px;
  border: 1px solid var(--field-line);
  border-radius: var(--control-radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.account-toggle strong { display: block; font-weight: 780; }
.account-toggle span { color: var(--muted); font-size: .8125rem; }
.account-toggle::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 15px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.account.open .account-toggle::after { transform: translateY(4px) rotate(225deg); }
.account-menu {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 6px);
  display: none;
  z-index: 2;
  max-height: 60dvh;
  overflow-y: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--panel);
  box-shadow: 0 10px 24px #322a201c;
}
.account.open .account-menu { display: grid; gap: 2px; }
.account-menu :is(button, a) {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.account-menu :is(button, a):hover { background: var(--panel2); }
.account-toggle .sync-chip {
  display: inline-flex;
  border-radius: 5px;
  background: var(--info-bg);
  color: var(--info);
  font-weight: 650;
  padding: 2px 6px;
  margin: 3px 0 0 5px;
}

body .main .top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 12px 0 20px;
}
.top > * { min-width: 0; }
body .main .top :is(h1, h2) {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 850;
  line-height: 1.12;
  letter-spacing: -.047em;
}
.top p { margin-top: 6px; max-width: 66ch; }
.top .action-row { width: auto; margin-top: 0; }
.module > .card + .card { margin-top: 16px; }
.module > .top:first-child { margin-top: 0; }

/* Content, feedback, tables and form controls. */
body :is(.card, .mobile-card, .stat, .table, .action-card, .delivery-panel) {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--panel);
  box-shadow: none;
}
body :is(.card, .mobile-card, .stat, .action-card, .delivery-panel) { padding: clamp(14px, 2vw, 22px); }
body .table { max-width: 100%; overflow-x: auto; }
.card :is(h2, h3, h4), .mobile-card :is(h2, h3, h4), .delivery-panel h4 { margin-bottom: 8px; }
.card :is(p, ul, ol) + :is(p, ul, ol), .mobile-card p + p { margin-top: 8px; }
.card :where(p, li), .mobile-card p { color: var(--muted); }
body .main .card .top :is(h1, h2) { font-size: clamp(1.35rem, 2.6vw, 1.9rem); }
.card .top { margin-top: 0; }
.card > details { margin-top: 8px; }
.card strong { color: inherit; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  background: var(--panel2);
  font-size: .875rem;
  font-weight: 750;
  color: var(--text);
}
td { font-size: .9375rem; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.table th, .table td { overflow-wrap: anywhere; }
.table code { overflow-wrap: anywhere; }
.table .row { min-width: 38rem; }

body :is(.grid, .mini-grid, .two-col, .checkout-form .two, .stats, .cards) {
  display: grid;
  gap: 14px;
}
body .grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
body :is(.mini-grid, .two-col, .checkout-form .two) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body :is(.grid, .mini-grid, .two-col, .stats, .journey, .cards, .checkout-form .two) > * { min-width: 0; }
.cards, .mobile-cards { align-content: start; }
.mobile-cards { display: none; gap: 12px; }
.action-row, .row-actions, .empty-actions, .intent-fallback, .service-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 12px;
}
.row-actions .btn { font-size: .875rem; }
.service-strip { align-items: flex-start; }

body :is(.form, .checkout-form) { display: grid; gap: 9px; min-width: 0; }
.checkout-form { margin-top: 12px; }
body :is(.form, .checkout-form) label {
  color: var(--text);
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.5;
}
body :is(.form, .checkout-form) label > :is(input:not([type="checkbox"]):not([type="hidden"]), select, textarea) {
  display: block;
  margin-top: 3px;
}
body :is(.form, .checkout-form) :is(input:not([type="checkbox"]):not([type="hidden"]), select, textarea) {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--field-line);
  border-radius: var(--control-radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
}
body :is(.form, .checkout-form) :is(input, textarea)::placeholder { opacity: 1; color: var(--muted); }
body :is(.form, .checkout-form) [aria-invalid="true"] { border: 2px solid var(--red); }
body :is(.form, .checkout-form) select:not([multiple]):not([size]) {
  appearance: none;
  padding-inline-end: 30px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 16px center, right 11px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
@media (forced-colors: active) {
  body :is(.form, .checkout-form) select:not([multiple]):not([size]) {
    appearance: auto;
    background-image: none;
  }
}
body :is(.form, .checkout-form) :is(input, select, textarea):disabled { background-color: var(--panel2); }
body :is(.form, .checkout-form) input[type="checkbox"] { accent-color: var(--action-ink); }
.form textarea { min-height: 6rem; }
:is(.order-consent, .delivery-consent) {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
}
:is(.order-consent, .delivery-consent) input[type="checkbox"] {
  flex: 0 0 24px;
  width: 24px;
  min-height: 24px;
  margin: 2px 0 0;
  accent-color: var(--action-ink);
}
:is(.order-consent, .delivery-consent):focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.status, .pill, .price-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--green-bg);
  color: var(--green);
  font-size: .8125rem;
  font-weight: 720;
  line-height: 1.35;
}
.pill { background: var(--panel2); color: var(--muted); }
.pill.good { background: var(--green-bg); color: var(--green); }
.status.warn, .pill.warn { background: var(--gold-bg); color: var(--gold); }
.status.red { background: var(--red-bg); color: var(--red); }
.notice, .demo-banner, .conversion-note, .quick-intake, .result, .empty {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
}
.notice, .quick-intake { background: var(--info-bg); color: var(--info); }
.notice, .demo-banner { margin: 0 0 16px; }
.demo-banner { display: none; background: var(--gold-bg); color: var(--gold); }
.demo-banner.active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
}
.portal-preview-copy { flex: 1 1 24rem; min-width: 0; font-size: .875rem; }
.demo-banner .action-row { width: auto; margin-top: 0; }
.demo-banner .btn.alt { border-color: var(--gold); background: transparent; color: var(--gold); }
.result, .conversion-note { margin-top: 12px; }
.result { background: var(--panel); }
.conversion-note { background: var(--green-bg); color: var(--green); }
.empty { border-style: dashed; background: var(--bg); color: var(--muted); }
.empty strong { color: var(--text); }
.intent-package { display: grid; gap: 8px; margin-top: 8px; }
.intent-package ul { margin: 0; padding-inline-start: 18px; }
.intent-price { color: var(--text); font-weight: 850; font-size: 1.65rem; }
.proof-strip { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; }
.proof-strip span { border: 1px solid var(--line); border-radius: var(--control-radius); padding: 9px; font-size: .875rem; }
.intent-steps { display: grid; gap: 8px; margin-top: 10px; }
.intent-steps span { display: flex; align-items: flex-start; gap: 8px; }
.intent-steps b, .campaign-step b, .portal-roadmap-list li::before {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 24px;
  border-radius: 50%;
  background: var(--gold-bg);
  color: var(--action-ink);
}

.timeline { display: grid; gap: 6px; margin-top: 10px; }
.step, .campaign-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--panel);
}
.step strong { display: block; }
.step span { color: var(--muted); font-size: .875rem; }
.step .dot { flex: 0 0 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--field-line); }
.step.done .dot, .step.current .dot { background: var(--green); }
.step.current { border-color: var(--green); background: var(--green-bg); }
.step.attention .dot { background: var(--red); }
.step.attention { border-color: var(--red); background: var(--red-bg); }
.campaign-step { margin-top: 8px; min-width: 0; }
.campaign-step > * { min-width: 0; }
.switch-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--field-line);
  border-radius: var(--control-radius);
  background: var(--panel);
  cursor: pointer;
}
.switch-row span { display: grid; gap: 2px; }
.switch-row small { color: var(--muted); font-size: .875rem; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i {
  position: relative;
  flex: 0 0 48px;
  height: 28px;
  border: 1px solid var(--field-line);
  border-radius: 99px;
  background: var(--panel2);
}
.switch-row i::before {
  content: "";
  position: absolute;
  inset: 4px auto auto 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
}
.switch-row input:focus-visible + i { outline: 3px solid var(--focus); outline-offset: 3px; }
.switch-row input:checked + i { background: var(--action); border-color: var(--action-ink); }
.switch-row input:checked + i::before { transform: translateX(20px); background: #0a0a0a; }
.switch-row:has(input:disabled) { cursor: not-allowed; }

/* Overview, service details, growth and customer conversations. */
.portal-attention, .portal-service-overview, .portal-quick-actions { margin-bottom: 18px; }
.portal-domain-records, .portal-service-catalogue { margin-top: 20px; }
.portal-domain-records { margin-bottom: 16px; }
:is(.portal-attention, .portal-service-overview, .portal-domain-records, .portal-service-catalogue) > h2 { margin-bottom: 10px; }
#overview .journey { display: grid; gap: 8px; }
#overview .action-card {
  display: grid;
  grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr) auto;
  grid-template-areas: "state heading button" "state body button";
  align-items: center;
  gap: 2px 14px;
}
#overview .action-card .pill { grid-area: state; justify-self: start; }
#overview .action-card strong { grid-area: heading; }
#overview .action-card .muted { grid-area: body; font-size: .9375rem; }
#overview .action-card .btn { grid-area: button; justify-self: start; }
#overview .action-card:has(.pill.warn) { border-inline-start: 4px solid var(--action); }
#overview .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.stat b { display: block; font-size: clamp(1.2rem, 2.7vw, 1.85rem); line-height: 1.15; }
.stat .muted { font-size: .875rem; }
#overviewCards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portal-quick-actions ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.portal-quick-actions li { border-top: 1px solid var(--line); }
.portal-quick-actions a { display: inline-flex; align-items: center; min-height: 44px; }
.portal-roadmap {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 18px;
}
.portal-roadmap-kicker { margin-bottom: 6px; font-size: .875rem; font-weight: 700; }
.portal-roadmap-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; counter-reset: portal-roadmap; }
.portal-roadmap-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 3px 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  counter-increment: portal-roadmap;
}
.portal-roadmap-list li::before { content: counter(portal-roadmap); grid-row: 1 / span 2; align-self: start; }
.portal-roadmap-list strong { color: var(--text); }
.portal-roadmap-list span { color: var(--muted); font-size: .875rem; }

#digitalOrdersList { display: grid; gap: 12px; }
#digitalOrdersPanel, #digitalOrderReviewForm, #supportThread { margin-top: 16px; }
#digitalOrdersList > .card { background: var(--bg); }
body .card.portal-selected-product { border-color: var(--action-ink); }
#digitalOrderReviewBody, .delivery-panel code { overflow-wrap: anywhere; }
.delivery-panel { margin-top: 12px; }
.delivery-panel ul { margin: 8px 0; padding-inline-start: 18px; }
.delivery-panel code { font: .8125rem / 1.5 ui-monospace, monospace; color: var(--muted); }
.delivery-panel .delivery-consent { margin-top: 12px; }

.score-ring {
  display: grid;
  place-items: center;
  width: 86px;
  min-height: 86px;
  margin: 8px 0;
  border: 5px solid var(--green);
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  font-size: 1.45rem;
  font-weight: 850;
  text-align: center;
}
body :is(.premium-card, .review-card) { border-color: var(--rose); }
body .review-card { border-inline-start: 4px solid var(--rose); }
#reputation .campaign-step b { background: var(--rose-bg); color: var(--rose); }
#reviewInboxList .campaign-step p b { display: inline; background: transparent; color: inherit; }
.review-history { min-width: 0; }
.review-history .history-filter { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.review-history .history-filter input { flex: 0 0 20px; width: 20px; min-height: 20px; }
.review-history .history-copy { white-space: pre-wrap; }
:is(.review-history, .support-thread, .support-history) nav { margin-top: 12px; }

.card-heading { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-heading > div { min-width: 0; }
.card-heading .row-actions { margin-top: 0; }
.support-history #ticketsList, .support-messages { display: grid; gap: 8px; }
.support-ticket-button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.support-ticket-button:hover, .support-ticket-button[aria-current="true"] { border-color: var(--action-ink); }
.support-ticket-button[aria-current="true"] { box-shadow: inset 3px 0 var(--action); }
.support-ticket-title { font-weight: 780; line-height: 1.35; }
.support-ticket-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--muted); font-size: .85rem; }
.support-thread .support-original { margin: 14px 0; padding: 13px; border: 1px solid var(--line); border-radius: var(--control-radius); }
.support-conversation { margin-top: 16px; }
.support-messages { margin: 8px 0 0; padding: 0; list-style: none; }
.support-message {
  min-width: 0;
  max-width: min(83%, 52rem);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
}
.support-message.customer { justify-self: end; background: var(--panel2); }
.support-message.staff { justify-self: start; background: #faf1e1; }
.support-message header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.support-message time, .support-message .read-state { color: var(--muted); font-size: .8125rem; }
.support-message p, .support-original p { margin-top: 6px; white-space: pre-wrap; color: var(--text); }
.support-reply { max-width: 52rem; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

@media (max-width: 960px) {
  body .shell { display: block; }
  body .side { position: relative; height: auto; overflow: visible; padding: 8px var(--gutter); }
  .portal-sidebar-top { padding: 0 0 6px; }
  body .portal-sidebar-top .brand img { width: min(100%, 175px); }
  .side[data-portal-nav-ready] #portalNavToggle:not([hidden]) {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--rail-line);
    border-radius: var(--control-radius);
    background: var(--rail);
    color: var(--rail-text);
    font: inherit;
    cursor: pointer;
  }
  body .shell > .side[data-portal-nav-ready] .nav:not(.portal-nav-open) { display: none !important; }
  .portal-toolbar { position: relative; padding-top: 10px; padding-bottom: 8px; }
  body .main { padding-top: 8px; padding-bottom: 32px; }
  body .grid, #overviewCards, .portal-roadmap { grid-template-columns: minmax(0, 1fr); }
  .mobile-cards { display: grid; }
  .mobile-primary-card { margin-bottom: 14px; }
  .desktop-table, .mobile-hide-table { display: none !important; }
  .top .btn { justify-self: start; }
}

@media (max-width: 700px) {
  #overview .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #overview .action-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "state" "heading" "body" "button";
    gap: 5px;
  }
  #overview .action-card .btn { width: 100%; margin-top: 4px; }
  .portal-quick-actions ul { grid-template-columns: minmax(0, 1fr); }
  .support-message { max-width: 100%; }
}

@media (max-width: 560px) {
  .portal-auth-card { width: calc(100% - 2 * var(--gutter)); }
  body :is(.mini-grid, .two-col, .checkout-form .two), .proof-strip { grid-template-columns: minmax(0, 1fr); }
  body :is(.action-row, .row-actions) { width: 100%; }
  body :is(.top, .action-row, .row-actions) > .btn { width: 100%; }
  .account { width: 100%; }
  th, td { padding-inline: 9px; }
}
