/*
 * 13.47.2 — Core System Surface Compatibility Foundation.
 *
 * Presentation-only bridge for dedicated public system surfaces whose route /
 * read model remains Core-owned while their historical Theme CSS still uses
 * the pre-Experience --dhv-* design vocabulary. Deliberately scoped: this is
 * not main.css, does not restore the legacy shell and owns no domain truth.
 */
.dhvx-core-system-compat-body {
  --dhv-brand-red: var(--dhvx-brand);
  --dhv-red: var(--dhvx-brand);
  --dhv-red-strong: var(--dhvx-brand-strong);
  --dhv-brand-action: var(--dhvx-brand);
  --dhv-ink: var(--dhvx-text);
  --dhv-text: var(--dhvx-text);
  --dhv-muted: var(--dhvx-text-secondary);
  --dhv-text-muted: var(--dhvx-text-muted);
  --dhv-line: var(--dhvx-border);
  --dhv-soft-line: var(--dhvx-border);
  --dhv-border: var(--dhvx-border);
  --dhv-bg: var(--dhvx-surface);
  --dhv-surface: var(--dhvx-surface);
  --dhv-platform-surface: var(--dhvx-surface);
  --dhv-surface-soft: var(--dhvx-surface-soft);
  --dhv-warm: #f6f7f8;
  --dhv-chip: var(--dhvx-surface-soft);
  --dhv-shadow: none;
  --dhv-shell: 920px;
  --dhv-reading: 720px;
  --dhv-wide-reading: 920px;
  --dhv-radius-sm: 6px;
  --dhv-radius: 8px;
  --dhv-radius-lg: 12px;
  --dhv-serif: "Times New Roman", Times, serif;
  --dhv-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --dhv-body-size: 17px;
  --dhv-body-leading: 1.68;
}

/* Shared primitives referenced by the dedicated system renderers but formerly
   supplied only by main.css. Keep them intentionally small and local. */
.dhvx-core-system-compat-body .dhv-kicker {
  color: var(--dhv-red);
  font-size: 11.5px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.dhvx-core-system-compat-body .dhv-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin: 0 0 24px;
  color: var(--dhv-muted);
  font-size: 11.5px;
  line-height: 1.45;
}
.dhvx-core-system-compat-body .dhv-breadcrumbs a:hover,
.dhvx-core-system-compat-body .dhv-breadcrumbs a:focus-visible { color: var(--dhv-red-strong); }
.dhvx-core-system-compat-body .dhv-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--dhv-red);
  color: #fff;
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
}
.dhvx-core-system-compat-body .dhv-button:hover,
.dhvx-core-system-compat-body .dhv-button:focus-visible,
.dhvx-core-system-compat-body .dhv-button:visited { color: #fff; }
.dhvx-core-system-compat-body .dhv-button:hover { background: var(--dhv-red-strong); }
.dhvx-core-system-compat-body .dhv-button:focus-visible {
  outline: 2px solid color-mix(in srgb,var(--dhvx-brand) 28%,transparent);
  outline-offset: 2px;
}

/* Finite Core/system surfaces use the same 222 + 22 + 920 geometry already
   established by 404 and generic System Document convergence. */
@media (min-width:1200px) {
  .dhvx-site-app.is-system.is-core-system-compat {
    width: min(calc(100% - 32px),1164px);
    grid-template-columns: minmax(196px,222px) minmax(0,920px);
  }
}
.dhvx-site-app.is-system.is-core-system-compat .dhvx-site-stage {
  width: 100%;
  max-width: 920px;
  min-width: 0;
}
.dhvx-site-app.is-system.is-core-system-compat > .dhvx-site-footer {
  grid-column: 2;
  width: 100%;
  max-width: 920px;
  margin: 0;
  padding-inline: 30px;
  border-left: 1px solid var(--dhvx-border);
  border-right: 1px solid var(--dhvx-border);
  background: var(--dhvx-surface);
}
.dhvx-site-app.is-system.is-core-system-compat .dhv-main,
.dhvx-site-app.is-system.is-core-system-compat main {
  min-width: 0;
}
.dhvx-site-app.is-system.is-core-system-compat img,
.dhvx-site-app.is-system.is-core-system-compat video,
.dhvx-site-app.is-system.is-core-system-compat iframe {
  max-width: 100%;
}

@media (max-width:767px) {
  .dhvx-core-system-compat-body .dhv-breadcrumbs { margin-bottom: 18px; }
  .dhvx-site-app.is-system.is-core-system-compat .dhvx-site-stage { max-width: none; }
  .dhvx-site-app.is-system.is-core-system-compat > .dhvx-site-footer { display: none; }
}

/* Touch landscape follows the compact one-column System grammar instead of
   leaving a 72px rail beside an already narrow Core-owned document. */
@media (max-width:920px) and (max-height:500px) and (orientation:landscape) and (pointer:coarse) {
  body.dhvx-core-system-compat-body { padding: 44px 0 calc(50px + env(safe-area-inset-bottom,0px)); }
  .dhvx-site-app.is-system.is-core-system-compat { display:block; width:100%; min-height:100vh; margin:0; }
  .dhvx-site-app.is-system.is-core-system-compat .dhvx-left { display:none!important; }
  .dhvx-site-app.is-system.is-core-system-compat .dhvx-site-stage {
    width:min(100%,720px);
    max-width:720px;
    min-height:calc(100vh - 44px);
    margin-inline:auto;
    border:0;
  }
  .dhvx-site-app.is-system.is-core-system-compat .dhvx-mobile-topbar {
    position:fixed;
    z-index:100;
    inset:0 0 auto 0;
    height:44px;
    display:grid;
    grid-template-columns:minmax(0,1fr) 44px;
    align-items:center;
    padding:0 max(12px,env(safe-area-inset-right,0px)) 0 max(12px,env(safe-area-inset-left,0px));
    border-bottom:1px solid var(--dhvx-border);
    background:var(--dhvx-surface);
  }
  .dhvx-site-app.is-system.is-core-system-compat .dhvx-mobile-brand { display:inline-flex; width:fit-content; height:40px; align-items:center; padding-inline:3px; }
  .dhvx-site-app.is-system.is-core-system-compat .dhvx-mobile-brand svg,
  .dhvx-site-app.is-system.is-core-system-compat .dhvx-mobile-brand img { width:28px; height:28px; }
  .dhvx-site-app.is-system.is-core-system-compat .dhvx-mobile-icon { width:44px; height:44px; display:grid; place-items:center; }
  .dhvx-site-app.is-system.is-core-system-compat .dhvx-bottom-nav {
    position:fixed;
    z-index:100;
    inset:auto 0 0 0;
    min-height:calc(50px + env(safe-area-inset-bottom,0px));
    display:grid;
    grid-auto-flow:column;
    grid-auto-columns:1fr;
    padding:2px max(6px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(6px,env(safe-area-inset-left,0px));
    border-top:1px solid var(--dhvx-border);
    background:var(--dhvx-surface);
  }
  .dhvx-site-app.is-system.is-core-system-compat .dhvx-bottom-nav a { min-height:46px; display:grid; place-items:center; align-content:center; }
  .dhvx-site-app.is-system.is-core-system-compat > .dhvx-site-footer { display:none; }
}
