/*!
 * HyperDC UI — portal layer: dashboard widgets, command palette, shortcuts, bottom navigation,
 * notifications, content slots, Studio banners, header/footer layout variants. docs/PORTAL.md
 */

/* ==========================================================================
   1. Widgets
   ========================================================================== */
.hdc-w { position: relative; }
.hdc-w .hdc-card__header { align-items: flex-start; }
.hdc-w__sub { margin: .2rem 0 0; color: var(--hdc-text-3); font-size: var(--hdc-fs-sm); }
.hdc-w__sub strong { color: var(--hdc-heading); font-weight: 650; }
.hdc-w__dismiss {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 30px; height: 30px; border: 0; border-radius: var(--hdc-r-sm);
  background: transparent; color: var(--hdc-text-3); cursor: pointer;
  opacity: 0; transition: opacity var(--hdc-dur-2), background-color var(--hdc-dur-1);
}
.hdc-w:hover .hdc-w__dismiss, .hdc-w__dismiss:focus-visible { opacity: 1; }
.hdc-w__dismiss:hover { background: var(--hdc-bg-muted); color: var(--hdc-heading); }
@media (hover: none) { .hdc-w__dismiss { opacity: 1; } }

.hdc-dash { display: grid; gap: 1.25rem; }
@media (min-width: 1100px) { .hdc-dash--2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }

/* Spend chart — single series columns: ≤24px, 4px data-end radius, square baseline, 2px gaps */
.hdc-chart { position: relative; height: 200px; margin-top: .25rem; }
.hdc-chart__grid { position: absolute; inset: 0 0 26px 44px; }
.hdc-chart__tick { position: absolute; inset-inline: 0; bottom: var(--p); border-top: 1px solid var(--hdc-border); }
.hdc-chart__tick span {
  position: absolute; inset-inline-end: 100%; bottom: 0; transform: translateY(50%);
  padding-inline-end: 8px; color: var(--hdc-text-3);
  font: 500 var(--hdc-fs-2xs)/1 var(--hdc-font-mono); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hdc-chart__cols { position: absolute; inset: 0 0 0 44px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 2px; }
.hdc-chart__slot { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) 26px; justify-items: center; min-width: 0; border-radius: var(--hdc-r-xs); outline: none; }
.hdc-chart__slot:hover { background: color-mix(in srgb, var(--hdc-primary) 6%, transparent); }
/* Past months at 72% of the brand hue keep ≥3:1 against the surface; the current month is full strength. */
.hdc-chart__col {
  grid-area: 1 / 1; align-self: end;
  width: min(24px, 64%); height: var(--p);
  border-radius: 4px 4px 0 0;
  background: color-mix(in srgb, var(--hdc-primary) 72%, var(--hdc-surface));
  transition: background-color var(--hdc-dur-1);
}
.hdc-chart__slot:hover .hdc-chart__col, .hdc-chart__slot.is-current .hdc-chart__col { background: var(--hdc-primary); }
.hdc-chart__value { grid-area: 1 / 1; align-self: end; position: relative; bottom: calc(var(--p) + 4px); color: var(--hdc-heading); font-size: var(--hdc-fs-2xs); font-weight: 700; white-space: nowrap; }
.hdc-chart__label { grid-row: 2; align-self: center; color: var(--hdc-text-3); font-size: var(--hdc-fs-2xs); white-space: nowrap; }
.hdc-chart__table { margin-top: .75rem; font-size: var(--hdc-fs-sm); }
.hdc-chart__table summary { color: var(--hdc-link); cursor: pointer; }
.hdc-chart__table .hdc-table { margin-top: .5rem; }
@media (max-width: 560px) {
  .hdc-chart__label { font-size: 9px; }
  .hdc-chart__slot:nth-child(odd):not(.is-current) .hdc-chart__label { visibility: hidden; }
  /*
    Columns are narrower than the value label here. Grid falls back to start alignment for an overflowing item,
    so pin the label to the column's end edge instead and lift it clear of the previous column (--pp).
    Explicit end lines keep row 1 as the abspos containing block (an `auto` end line would stretch it to the
    padding edge), so % offsets still match the bars.
  */
  .hdc-chart__slot.is-current .hdc-chart__value { position: absolute; grid-area: 1 / 1 / 2 / 2; inset-inline-end: 0; bottom: calc(max(var(--p), var(--pp, 0%)) + 4px); }
}

/* Health ring (meter) */
.hdc-w-health__body { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.hdc-ring { position: relative; width: 120px; height: 120px; flex: 0 0 auto; }
.hdc-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hdc-ring circle { fill: none; stroke-width: 12; }
.hdc-ring__track { stroke: var(--hdc-bg-muted); }
.hdc-ring__value { stroke: var(--hdc-primary); stroke-linecap: round; stroke-dasharray: var(--v) 100; transition: stroke-dasharray .8s var(--hdc-ease); }
.hdc-ring--warn .hdc-ring__value { stroke: var(--hdc-warning); }
.hdc-ring--bad .hdc-ring__value { stroke: var(--hdc-danger); }
.hdc-ring__num { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 42px; color: var(--hdc-heading); font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; }
.hdc-ring__num small { color: var(--hdc-text-3); font-size: var(--hdc-fs-xs); font-weight: 500; letter-spacing: 0; }
.hdc-w-health__list { flex: 1 1 220px; min-width: 0; }
.hdc-w-health__state { margin: 0 0 .6rem; font-weight: 650; }
.hdc-w-health__state--ok { color: var(--hdc-success-text); }
.hdc-w-health__state--warn { color: var(--hdc-warning-text); }
.hdc-w-health__state--bad { color: var(--hdc-danger-text); }
.hdc-checks { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; font-size: var(--hdc-fs-sm); }
.hdc-checks__item { display: flex; align-items: center; gap: .55rem; }
.hdc-checks__item .hdc-i { color: var(--hdc-warning); }
.hdc-checks__item.is-ok .hdc-i { color: var(--hdc-success); }
.hdc-checks__item.is-ok span { color: var(--hdc-text-2); }

/* Onboarding */
.hdc-onb { display: grid; gap: .5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.hdc-onb__step { display: flex; align-items: center; gap: .7rem; font-size: var(--hdc-fs-sm); }
.hdc-onb__mark {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 26px; height: 26px; border: 1.5px solid var(--hdc-border-strong); border-radius: 50%;
  color: var(--hdc-text-2); font: 700 var(--hdc-fs-2xs)/1 var(--hdc-font-mono);
}
.hdc-onb__step.is-done .hdc-onb__mark { border-color: var(--hdc-success); background: var(--hdc-success); color: #fff; }
.hdc-onb__step.is-done span:not(.hdc-onb__mark) { color: var(--hdc-text-3); text-decoration: line-through; text-decoration-color: var(--hdc-border-strong); }
/* C2: steps as tiles (one row on wide screens), "Next step" highlighted, compact progress bar in the header */
.hdc-w .hdc-w-onboarding__header { flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.hdc-w-onboarding__title { flex: 1 1 220px; min-width: 0; }
.hdc-w-onboarding__bar { flex: 0 1 220px; height: 8px; }
.hdc-onb--tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: .65rem; margin: 0; }
.hdc-onb--tiles .hdc-onb__step {
  align-items: flex-start; gap: .65rem; padding: .8rem .9rem;
  border: 1px solid var(--hdc-border); border-radius: var(--hdc-r-md); background: var(--hdc-surface);
}
.hdc-onb--tiles .hdc-onb__step.is-done { background: var(--hdc-bg-soft); }
.hdc-onb--tiles .hdc-onb__step.is-done span:not(.hdc-onb__mark) { text-decoration: none; }
.hdc-onb--tiles .hdc-onb__step.is-next { border-color: color-mix(in srgb, var(--hdc-primary) 55%, var(--hdc-border)); background: var(--hdc-primary-soft); }
.hdc-onb--tiles .hdc-onb__step.is-next .hdc-onb__mark { border-color: var(--hdc-primary); color: var(--hdc-primary-text); }
.hdc-onb__text { display: grid; gap: .15rem; min-width: 0; padding-top: .15rem; line-height: 1.35; overflow-wrap: anywhere; }
.hdc-onb__eyebrow { color: var(--hdc-primary-text); font: 600 var(--hdc-fs-2xs)/1.2 var(--hdc-font-mono); letter-spacing: var(--hdc-tracking-label); text-transform: uppercase; }
.hdc-onb__link { font-weight: 600; }

/* Upcoming timeline */
.hdc-timeline { display: grid; margin: 0; padding: 0 0 .5rem; list-style: none; }
.hdc-timeline__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .85rem; padding: .75rem clamp(1.15rem, .9rem + 1vw, 1.75rem); border-top: 1px solid var(--hdc-border); }
.hdc-timeline__item:first-child { border-top: 0; }
.hdc-timeline__main { min-width: 0; color: var(--hdc-text) !important; }
.hdc-timeline__name { display: block; overflow: hidden; color: var(--hdc-heading); font-weight: 600; font-size: var(--hdc-fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.hdc-timeline__date { display: block; color: var(--hdc-text-3); font-size: var(--hdc-fs-xs); }
.hdc-timeline__side { display: grid; justify-items: end; gap: .25rem; }
.hdc-timeline__amount { color: var(--hdc-heading); font-weight: 650; font-size: var(--hdc-fs-sm); font-variant-numeric: tabular-nums; }

/* Pinned resources */
.hdc-w-pinned__head { margin-bottom: .75rem; }
.hdc-w-pinned__title { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: var(--hdc-fs-lg); }
.hdc-w-pinned__title .hdc-i { color: var(--hdc-warning); }
.hdc-pins { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.hdc-pin {
  display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem;
  border: 1px solid var(--hdc-border); border-radius: var(--hdc-r-lg); background: var(--hdc-surface); color: var(--hdc-text) !important;
  transition: border-color var(--hdc-dur-2), box-shadow var(--hdc-dur-2), transform var(--hdc-dur-2) var(--hdc-ease);
}
.hdc-pin:hover { border-color: var(--hdc-border-strong); box-shadow: var(--hdc-shadow-md); transform: translateY(-2px); }
.hdc-pin__text { flex: 1 1 auto; min-width: 0; }
.hdc-pin__name, .hdc-pin__sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdc-pin__name { color: var(--hdc-heading); font-weight: 650; font-size: var(--hdc-fs-sm); }
.hdc-pin__sub { color: var(--hdc-text-3); font-size: var(--hdc-fs-xs); }

/* Status widget */
.hdc-w-status { display: flex; align-items: center; gap: .85rem; padding: 1rem 1.25rem; color: var(--hdc-text) !important; }
.hdc-w-status:hover { border-color: var(--hdc-border-strong); }
.hdc-w-status__text { display: grid; flex: 1 1 auto; font-size: var(--hdc-fs-sm); }
.hdc-w-status__text strong { color: var(--hdc-heading); }
.hdc-w-status__text span { color: var(--hdc-text-3); font-size: var(--hdc-fs-xs); }
.hdc-w-status.is-issue { border-color: color-mix(in srgb, var(--hdc-danger) 40%, transparent); }

/* Pin, nickname and view controls (service/domain pages) */
[data-hdc-pin][aria-pressed="true"] { color: var(--hdc-warning) !important; }
.hdc-label-editor { max-width: 360px; }
.hdc-nickname { display: block; color: var(--hdc-primary-text); font-size: var(--hdc-fs-xs); font-weight: 650; letter-spacing: .02em; }
.hdc-viewswitch { display: inline-flex; padding: 3px; border: 1px solid var(--hdc-border); border-radius: var(--hdc-r-sm); background: var(--hdc-bg-soft); }
.hdc-viewswitch button { display: inline-grid; place-items: center; width: 34px; height: 30px; border: 0; border-radius: var(--hdc-r-xs); background: transparent; color: var(--hdc-text-3); cursor: pointer; }
.hdc-viewswitch button[aria-pressed="true"] { background: var(--hdc-surface); color: var(--hdc-heading); box-shadow: var(--hdc-shadow-xs); }

/* ==========================================================================
   2. Command palette & shortcuts
   ========================================================================== */
dialog.hdc-cmd { width: min(660px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 80px)); margin-top: 10vh; padding: 0; overflow: hidden; }
dialog.hdc-cmd[open] { display: flex; flex-direction: column; }
.hdc-cmd__bar { display: flex; align-items: center; gap: .75rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--hdc-border); color: var(--hdc-text-3); }
.hdc-cmd__bar .hdc-i { --hdc-i: 20px; }
.hdc-cmd__input { flex: 1 1 auto; min-width: 0; height: 36px; border: 0; background: transparent; color: var(--hdc-heading); font: 500 var(--hdc-fs-lg)/1 var(--hdc-font-sans); }
.hdc-cmd__input:focus { outline: none; }
.hdc-cmd__input::-webkit-search-cancel-button { display: none; }
.hdc-cmd.is-loading .hdc-cmd__bar::after { content: ""; width: 16px; height: 16px; border: 2px solid var(--hdc-border-strong); border-top-color: var(--hdc-primary); border-radius: 50%; animation: hdc-spin .7s linear infinite; }
.hdc-cmd__body { flex: 1 1 auto; overflow-y: auto; padding: .4rem; overscroll-behavior: contain; }
.hdc-cmd__list { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; }
.hdc-cmd__group { padding: .7rem .7rem .3rem; color: var(--hdc-text-3); font: 600 var(--hdc-fs-2xs)/1 var(--hdc-font-mono); letter-spacing: var(--hdc-tracking-label); text-transform: uppercase; }
.hdc-cmd__item { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border-radius: var(--hdc-r-md); color: var(--hdc-text); cursor: pointer; }
.hdc-cmd__item.is-active { background: var(--hdc-primary-soft); color: var(--hdc-heading); }
.hdc-cmd__item .hdc-icon-tile { --hdc-tile: 32px; }
.hdc-cmd__text { display: grid; flex: 1 1 auto; min-width: 0; font-size: var(--hdc-fs-sm); font-weight: 550; }
.hdc-cmd__title, .hdc-cmd__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdc-cmd__sub { color: var(--hdc-text-3); font-size: var(--hdc-fs-xs); font-weight: 400; }
.hdc-cmd__foot { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding: .6rem 1.1rem; border-top: 1px solid var(--hdc-border); background: var(--hdc-surface-sunken); color: var(--hdc-text-3); font-size: var(--hdc-fs-xs); }
.hdc-cmd__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hdc-cmd__empty { padding: 1.5rem .75rem; color: var(--hdc-text-3); font-size: var(--hdc-fs-sm); text-align: center; }
.hdc-shortcuts dd { display: flex; gap: .3rem; justify-content: flex-end; }
.hdc-topbar__kbd { position: absolute; inset-inline-end: .6rem; pointer-events: none; }
@media (max-width: 1023.98px) { .hdc-topbar__kbd { display: none; } }

/* ==========================================================================
   3. Mobile bottom navigation (client app)
   ========================================================================== */
.hdc-bottomnav { display: none; }
@media (max-width: 767.98px) {
  .hdc-bottomnav {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 70;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: .35rem .35rem calc(.35rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--hdc-border);
    background: color-mix(in srgb, var(--hdc-surface) 92%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  }
  .hdc-layout-client .hdc-app__body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .hdc-layout-client .hdc-toasts, .hdc-layout-client .hdc-banner-toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
.hdc-bottomnav__item { display: grid; justify-items: center; gap: .15rem; padding: .35rem 0; border: 0; border-radius: var(--hdc-r-sm); background: none; color: var(--hdc-text-3) !important; font: 600 10px/1.2 var(--hdc-font-sans); cursor: pointer; }
.hdc-bottomnav__item .hdc-i { --hdc-i: 22px; }
.hdc-bottomnav__item.is-active { color: var(--hdc-primary-text) !important; }

/* ==========================================================================
   4. Notifications drawer additions
   ========================================================================== */
.hdc-notify__head { padding: .2rem .2rem .35rem; }
.hdc-notify__item.is-unread { background: color-mix(in srgb, var(--hdc-primary) 6%, transparent); }
.hdc-notify__item strong { display: block; color: var(--hdc-heading); font-weight: 600; }
.hdc-notify__body { display: block; color: var(--hdc-text-2); }
.hdc-notify__time { display: block; color: var(--hdc-text-3); font-size: var(--hdc-fs-2xs); }

/* ==========================================================================
   5. Content slots & Studio banners
   ========================================================================== */
.hdc-slot { margin-block: 0 1.5rem; }
.hdc-slot--after { margin-block: 1.5rem 0; }
.hdc-slot > .hdc-section { padding-block: 0; }

.hdc-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: .85rem 1.25rem;
  margin-bottom: 1.25rem; padding: 1rem 1.25rem;
  border: 1px solid var(--hdc-border); border-radius: var(--hdc-r-lg); background: var(--hdc-surface);
}
.hdc-banner--soft { background: radial-gradient(120% 140% at 100% 0%, var(--hdc-primary-soft) 0%, transparent 60%), var(--hdc-surface); }
.hdc-banner--night, .hdc-banner--brand { border-color: transparent; }
.hdc-banner--night { background: linear-gradient(180deg, var(--hdc-night-800), var(--hdc-night-900)); --hdc-heading: #f4f7fb; --hdc-text: #c9d3e0; --hdc-text-2: #a5b3c6; color: var(--hdc-text); }
.hdc-banner--brand { background: var(--hdc-brand-glow), var(--hdc-brand-gradient); --hdc-heading: #fff; --hdc-text: rgba(255, 255, 255, .9); --hdc-text-2: rgba(255, 255, 255, .78); color: var(--hdc-text); }
.hdc-banner__img { width: 56px; height: 56px; object-fit: contain; }
.hdc-banner__body { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; flex: 1 1 280px; min-width: 0; }
.hdc-banner__title { color: var(--hdc-heading); }
.hdc-banner__text { color: var(--hdc-text-2); font-size: var(--hdc-fs-sm); }
.hdc-banner__timer { color: var(--hdc-heading); font: 600 var(--hdc-fs-sm)/1 var(--hdc-font-mono); font-variant-numeric: tabular-nums; }
.hdc-banner__close { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: var(--hdc-r-sm); background: transparent; color: var(--hdc-text-2); cursor: pointer; }
.hdc-banner-toast {
  position: fixed; inset-inline-end: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 1065;
  display: grid; gap: .5rem; width: min(380px, calc(100vw - 32px)); padding: 1.1rem 1.2rem;
  border: 1px solid var(--hdc-border); border-radius: var(--hdc-r-xl); background: var(--hdc-surface-raised); box-shadow: var(--hdc-shadow-lg);
  animation: hdc-slide-up var(--hdc-dur-3) var(--hdc-ease);
}
dialog.hdc-popup { width: min(520px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
.hdc-popup__img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.hdc-popup__body { display: grid; gap: .85rem; padding: 1.75rem; }
.hdc-popup__body h2 { margin: 0; font-size: var(--hdc-fs-h3); }
.hdc-popup__body p { margin: 0; color: var(--hdc-text-2); }
.hdc-popup__close { position: absolute; top: .6rem; inset-inline-end: .6rem; z-index: 1; display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--hdc-surface) 80%, transparent); color: var(--hdc-heading); cursor: pointer; }
.hdc-copy--lg { padding: .45rem .8rem; font-size: var(--hdc-fs-base); }

/* Banner variants: hero (bigger promo card) and the order form summary placement */
.hdc-banner--hero { padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); }
.hdc-banner--hero .hdc-banner__title { font-size: var(--hdc-fs-xl); letter-spacing: -.015em; }
.hdc-banner--at-summary { flex-direction: column; align-items: stretch; gap: .65rem; margin: 0 0 1rem; padding: .9rem 1rem; }
.hdc-banner--at-summary .hdc-banner__body { flex: 0 1 auto; }
.hdc-banner--at-summary .hdc-banner__close { position: absolute; top: .35rem; inset-inline-end: .35rem; }
.hdc-banner--at-summary { position: relative; padding-inline-end: 2.5rem; }

/* Full-bleed placements (includes/hdc-place.tpl): "after hero" (moved by js/hdc.js) and "before footer" */
.hdc-place { padding-block: clamp(1rem, .75rem + 1vw, 1.75rem); }
.hdc-place__banners > .hdc-banner:last-child { margin-bottom: 0; }
.hdc-place .hdc-slot { margin-block: 0; }
.hdc-place__banners + .hdc-slot { margin-top: 1.25rem; }
.hdc-place:not(:has(.hdc-slot, .hdc-banner:not([hidden]))) { display: none; } /* every banner dismissed, no slot */
.hdc-place__banners:not(:has(.hdc-banner:not([hidden]))) { display: none; }
.hdc-js [data-hdc-place="after-hero"]:not(.is-placed) {
  visibility: hidden; max-height: 0; overflow: hidden; padding-block: 0;
  animation: hdc-place-fallback 0s linear 3s forwards; /* shown in place if js/hdc.js never runs */
}
@keyframes hdc-place-fallback { to { visibility: visible; max-height: none; overflow: visible; padding-block: 1rem; } }

/* ==========================================================================
   6. Layout variants from Studio ($hdc.layoutConfig, header.tpl — docs/handoff/T6.md)
   ========================================================================== */
@media (min-width: 1100px) {
  .hdc-header--centered .hdc-nav { display: flex; justify-content: center; }
  .hdc-header--minimal .hdc-nav { display: none; }
  .hdc-header--minimal .hdc-burger { display: inline-grid; }
}
.hdc-header--transparent:not(.is-scrolled) { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.hdc-footer--minimal .hdc-footer__main, .hdc-footer--minimal .hdc-footer__cta { display: none; }
.hdc-footer--compact .hdc-footer__main > :not(.hdc-footer__brand) { display: none; }
.hdc-footer--compact .hdc-footer__main { grid-template-columns: 1fr; }

/* headerSticky = false (html.hdc-header-static): site header and client top bar scroll away */
.hdc-header--static, .hdc-header-static .hdc-topbar { position: relative; }
.hdc-header-static { scroll-padding-top: 16px; }
@media (min-width: 1200px) { .hdc-header-static .hdc-app__aside { top: 1.5rem; } }

/* topbar = true: $hdc.menus.topbar above the site header (includes/hdc-sitebar.tpl) */
.hdc-sitebar { position: relative; z-index: 55; border-bottom: 1px solid var(--hdc-border); background: var(--hdc-bg-soft); font-size: var(--hdc-fs-xs); }
.hdc-sitebar__inner { display: flex; justify-content: flex-end; }
.hdc-sitebar__list { display: flex; align-items: center; gap: 0 1.1rem; min-width: 0; margin: 0; padding: 0 2px; list-style: none; overflow-x: auto; scrollbar-width: none; }
.hdc-sitebar__list::-webkit-scrollbar { display: none; }
.hdc-sitebar__link { display: inline-flex; align-items: center; gap: .35rem; min-height: 34px; color: var(--hdc-text-2) !important; font-weight: 550; white-space: nowrap; }
.hdc-sitebar__link:hover { color: var(--hdc-heading) !important; }
.hdc-sitebar__link .hdc-i { --hdc-i: 15px; color: var(--hdc-text-3); }
.hdc-sitebar__link .hdc-badge { font-size: var(--hdc-fs-2xs); }
@media (max-width: 767.98px) { .hdc-sitebar__inner { justify-content: flex-start; } }

/* container = "wide" (html.hdc-wide): site chrome and WHMCS page content; builder blocks keep their own width */
.hdc-wide :is(.hdc-header, .hdc-footer, .hdc-announce, .hdc-sitebar, .hdc-place) .hdc-container,
.hdc-wide .hdc-site-content { --hdc-container: var(--hdc-container-wide); }
.hdc-wide .hdc-app__content, .hdc-wide .hdc-verify__inner { max-width: 1680px; }

/* sidebar = "end": footer.tpl renders WHMCS sidebars after the content, shown on the inline-end side */
@media (min-width: 992px) { .hdc-site-content.has-aside.hdc-aside-end { grid-template-columns: minmax(0, 1fr) 280px; } }
@media (min-width: 1200px) { .hdc-app__content.has-aside.hdc-aside-end { grid-template-columns: minmax(0, 1fr) var(--hdc-aside-w, 256px); } }

/* clientNav = "top": horizontal navigation under the client top bar (includes/hdc-client-topnav.tpl). The side
   navigation stays the phone/tablet drawer. */
.hdc-topbar__brand, .hdc-topnav { display: none; }
@media (min-width: 1100px) {
  .hdc-app--topnav { grid-template-columns: minmax(0, 1fr); }
  .hdc-app--topnav .hdc-app__side { display: none; }
  .hdc-topbar--topnav .hdc-topbar__brand { display: inline-flex; flex: 0 0 auto; margin-inline-end: .75rem; }
  .hdc-topbar--topnav .hdc-topbar__brand img { height: 27px; width: auto; }
  .hdc-topnav {
    position: relative; z-index: 44; display: block;
    padding-inline: clamp(1rem, 2vw, 2rem);
    border-bottom: 1px solid var(--hdc-border); background: var(--hdc-surface);
  }
  .hdc-topnav__list { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; max-width: 1360px; margin: 0 auto; padding: .4rem 0; list-style: none; }
  .hdc-wide .hdc-topnav__list { max-width: 1680px; }
  .hdc-topnav__link {
    display: inline-flex; align-items: center; gap: .45rem; height: 38px; padding: 0 .75rem;
    border: 0; border-radius: var(--hdc-r-sm); background: transparent;
    color: var(--hdc-text) !important; font: 550 var(--hdc-fs-sm)/1 var(--hdc-font-sans); white-space: nowrap; cursor: pointer;
    transition: background-color var(--hdc-dur-1), color var(--hdc-dur-1);
  }
  .hdc-topnav__link .hdc-i, .hdc-topnav__fa { --hdc-i: 17px; color: var(--hdc-text-3); }
  .hdc-topnav__link:hover, .hdc-topnav__item.is-open > .hdc-topnav__link { background: var(--hdc-bg-soft); color: var(--hdc-heading) !important; }
  .hdc-topnav__link.is-active { background: var(--hdc-primary-soft); color: var(--hdc-primary-text) !important; }
  .hdc-topnav__link.is-active .hdc-i { color: var(--hdc-primary); }
  .hdc-topnav__link .hdc-topnav__chev { --hdc-i: 14px; transition: transform var(--hdc-dur-2) var(--hdc-ease); }
  .hdc-topnav__item.is-open .hdc-topnav__chev { transform: rotate(180deg); }
  .hdc-topnav__menu { top: calc(100% + 4px); }
}

/* Login style "centered" (Client Area Studio): no brand panel, the card sits in the middle */
.hdc-auth--centered { grid-template-columns: minmax(0, 1fr); background: var(--hdc-bg-soft); }
.hdc-auth--centered .hdc-auth__main { background: transparent; }
@media (min-width: 1024px) {
  .hdc-auth--centered { grid-template-columns: minmax(0, 1fr); }
  .hdc-auth--centered .hdc-auth__mobile-logo { visibility: visible; }
}
@media (min-width: 560px) {
  .hdc-auth--centered .hdc-auth__content > .hdc-auth-card {
    padding: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
    border: 1px solid var(--hdc-border); border-radius: var(--hdc-r-xl);
    background: var(--hdc-surface); box-shadow: var(--hdc-shadow-md);
  }
}

/* ==========================================================================
   7. MarketConnect promotions (C2): compact strip at the end of client pages (includes/hdc-mc-strip.tpl) and the
      dashboard's "Recommended for you" carousel ($addons_html) — only rendered while MarketConnect selling is on.
   ========================================================================== */
.hdc-mcstrip { margin-top: 2rem; }
.hdc-mcstrip__title { margin: 0 0 .75rem; color: var(--hdc-text-2); font-size: var(--hdc-fs-sm); font-weight: 650; letter-spacing: .01em; }
.hdc-mcstrip__list {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(min(230px, 82vw), 1fr); gap: .75rem;
  margin: 0; padding: 0 0 .5rem; list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin;
}
.hdc-mcstrip__item {
  display: grid; grid-template-rows: auto 1fr auto; gap: .45rem; min-width: 0;
  padding: .85rem 1rem; border: 1px solid var(--hdc-border); border-radius: var(--hdc-r-lg);
  background: var(--hdc-surface); scroll-snap-align: start;
}
.hdc-mcstrip__name { margin: 0; color: var(--hdc-heading); font-size: var(--hdc-fs-sm); font-weight: 650; }
.hdc-mcstrip__body .text-center { text-align: start !important; } /* over hdc-compat's .hdc-module .text-center */
.hdc-mcstrip__body a { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; color: var(--hdc-text-2) !important; font-size: var(--hdc-fs-xs); font-weight: 400 !important; line-height: 1.45; }
.hdc-mcstrip__body img, .hdc-side-card--promo .hdc-side-card__body img { flex: 0 0 auto; width: auto; max-width: 96px; max-height: 40px; object-fit: contain; }
.hdc-mcstrip__more { display: flex; align-items: center; gap: .35rem; font-size: var(--hdc-fs-xs); font-weight: 600; }
.hdc-mcstrip__more i { color: var(--hdc-text-3); }
/* Vendor logos are drawn for light backgrounds */
[data-theme="dark"] :is(.hdc-mcstrip__body, .hdc-side-card--promo .hdc-side-card__body) img { padding: 3px; border-radius: var(--hdc-r-xs); background: var(--hdc-gray-0); }

/* Dashboard: WHMCS's promotion carousel becomes a row of compact cards (no carousel script in this theme) */
.hdc-dash-addon .promo-container .header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.hdc-dash-addon .promo-container .header h3, .hdc-dash-addon > h3 { margin: 0 0 .75rem !important; color: var(--hdc-text-2); font-size: var(--hdc-fs-sm); font-weight: 650; }
.hdc-dash-addon .promotions-slider-control { display: none; }
.hdc-dash-addon .carousel-inner {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(min(320px, 86vw), 1fr); gap: .75rem;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding-bottom: .5rem; scrollbar-width: thin;
}
.hdc-dash-addon .carousel-item { display: block !important; float: none !important; width: auto !important; margin: 0 !important; transform: none !important; scroll-snap-align: start; }
.hdc-dash-addon .hdc-store-promo { height: 100%; }
.hdc-dash-addon > br { display: none; }
