/* Asset Registry is the geometry reference for existing application heroes. */
body [data-trivsel-app-hero="registry"]:not(.dashboard-hero) {
  --tv-registry-hero-min-height: 128px;
  --tv-registry-hero-padding-block: 18px;
  --tv-registry-hero-padding-inline: 20px;
  --tv-registry-hero-radius: 16px;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 32px;
  width: 100%;
  min-width: 0;
  min-height: var(--tv-registry-hero-min-height);
  height: auto;
  max-height: none;
  box-sizing: border-box;
  margin-top: 0;
  padding: var(--tv-registry-hero-padding-block) var(--tv-registry-hero-padding-inline);
  overflow: hidden;
  border: 1px solid #d5e5ed;
  border-radius: var(--tv-registry-hero-radius);
  background-position: center;
  background-size: cover;
  background-clip: padding-box;
  box-shadow: 0 5px 18px rgba(37, 105, 175, .07);
  color: #000;
  font-family: var(--trivsel-font-ui);
}

body [data-trivsel-app-hero="registry"]:not(.dashboard-hero) > * {
  position: relative;
  z-index: 1;
  min-width: 0;
}

body [data-trivsel-app-hero="registry"]:not(.dashboard-hero)
  :is(.devices-header-main, .tv-visual-hero__copy, .dashboard-header-main,
      .locations-header-main, .location-form-header-main, .device-form-header-main,
      .calibration-header-main, .maintenance-header-main,
      .governance-header > div) {
  flex: 1 1 480px;
  min-width: 0;
  max-width: 690px;
}

body [data-trivsel-app-hero="registry"]:not(.dashboard-hero)
  :is(.devices-eyebrow, .tv-visual-hero__eyebrow, .dashboard-eyebrow,
      .locations-eyebrow, .location-form-eyebrow, .device-form-eyebrow,
      .calibration-eyebrow, .maintenance-eyebrow, .hmc-eyebrow,
      .classification-eyebrow) {
  display: block;
  margin: 0 0 .4rem;
  color: var(--brand, #2563eb);
  font-size: .66rem;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body [data-trivsel-app-hero="registry"]:not(.dashboard-hero) h1 {
  max-width: 100%;
  margin: 0;
  color: #000;
  font-family: var(--trivsel-font-heading);
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

body [data-trivsel-app-hero="registry"]:not(.dashboard-hero)
  :is(.devices-header-main > p, .tv-visual-hero__copy > p,
      .dashboard-header-main > p, .locations-header-main > p,
      .location-form-header-main > p, .device-form-header-main > p,
      .calibration-header-main > p, .maintenance-header-main > p,
      .hmc-header > div > p, .governance-header > div > p:not(.classification-eyebrow)) {
  max-width: 560px;
  margin: .35rem 0 0;
  color: #111827;
  font-size: .83rem;
  font-weight: 500;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

body [data-trivsel-app-hero="registry"]:not(.dashboard-hero)
  :is(.devices-header-actions, .tv-visual-hero__actions, .dashboard-actions) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .45rem;
  max-width: 100%;
}

body [data-trivsel-app-hero="registry"]:not(.dashboard-hero)
  :is(.tv-visual-hero__meta, .asset-registry-role-context,
      .dashboard-header-user) {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Headers without a prior image use the Registry photograph. Existing
   directory, staff, calibration, and maintenance gradients stay intact. */
body :is(.device-form-header,
         .governance-header)[data-trivsel-app-hero="registry"] {
  background-image: url('/static/img/hero/trivsel-dashboard-hero-background.png');
}
body [data-trivsel-app-hero="registry"] .classification-eyebrow {
  font-size: .66rem !important;
}

/* Asset 360 keeps the live detail row inside the same expanding banner. */
body .asset360-design6 [data-trivsel-app-hero="registry"].a360-hero {
  align-content: center;
  column-gap: 32px;
  row-gap: 10px;
}
body .asset360-design6 [data-trivsel-app-hero="registry"] .asset360-hero-details {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* History retains its timeline counters and controls in the existing hero. */
body.sidebar-layout .asset-history-timeline-task10
  #asset-history-timeline-header[data-trivsel-app-hero="registry"] {
  display: block;
  min-height: var(--tv-registry-hero-min-height);
  padding: var(--tv-registry-hero-padding-block) var(--tv-registry-hero-padding-inline);
  overflow: hidden;
  border: 1px solid #d5e5ed;
  border-radius: var(--tv-registry-hero-radius);
  background: none;
  box-shadow: 0 5px 18px rgba(37, 105, 175, .07);
}
body.sidebar-layout .asset-history-timeline-task10
  #asset-history-timeline-header[data-trivsel-app-hero="registry"] h1 {
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.035em;
}
body.sidebar-layout .asset-history-timeline-task10
  #asset-history-timeline-header[data-trivsel-app-hero="registry"]
  .tv-visual-hero__eyebrow {
  margin-bottom: .4rem;
  font-size: .66rem;
}
body.sidebar-layout .asset-history-timeline-task10
  #asset-history-timeline-header[data-trivsel-app-hero="registry"] p {
  margin: .35rem 0 0;
  font-size: .83rem;
  line-height: 1.55;
}

@media (max-width: 800px) {
  body [data-trivsel-app-hero="registry"]:not(.dashboard-hero) {
    min-height: 180px;
    align-content: center;
  }
  body [data-trivsel-app-hero="registry"]:not(.dashboard-hero)
    :is(.devices-header-actions, .tv-visual-hero__actions, .dashboard-actions) {
    justify-content: flex-start;
  }
  body.sidebar-layout .asset-history-timeline-task10
    #asset-history-timeline-header[data-trivsel-app-hero="registry"] {
    min-height: 180px;
  }
}

@media (max-width: 560px) {
  body [data-trivsel-app-hero="registry"]:not(.dashboard-hero) {
    min-height: 210px;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 16px;
    border-radius: 20px;
  }
  body [data-trivsel-app-hero="registry"]:not(.dashboard-hero)
    :is(.devices-header-main, .tv-visual-hero__copy, .dashboard-header-main,
        .locations-header-main, .location-form-header-main, .device-form-header-main,
        .calibration-header-main, .maintenance-header-main,
        .governance-header > div) {
    flex-basis: 100%;
  }
  body [data-trivsel-app-hero="registry"]:not(.dashboard-hero)
    :is(.devices-header-actions, .tv-visual-hero__actions, .dashboard-actions) {
    width: 100%;
  }
  body [data-trivsel-app-hero="registry"]:not(.dashboard-hero)
    :is(a, button) {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body.sidebar-layout .asset-history-timeline-task10
    #asset-history-timeline-header[data-trivsel-app-hero="registry"] {
    min-height: 210px;
    padding: 18px 16px;
    border-radius: 20px;
  }
}

/* BATCH 3 TASK 09: HALF-SIZE MOBILE HERO GEOMETRY
 * Scope: existing application registry heroes, dashboard and public device.
 * Half the previous mobile 180/210/205px floors and 18px vertical padding.
 * Intrinsic height must grow when actual content needs more space.
 * This block does not affect desktop viewports or hide any hero content.
 */
@media (max-width: 800px) {
  body [data-trivsel-app-hero="registry"]:not(.dashboard-hero) {
    --tv-registry-hero-min-height: 90px;
    --tv-registry-hero-padding-block: 9px;
    min-height: 90px !important;
    height: auto !important;
    max-height: none !important;
    padding-block: 9px !important;
    row-gap: 7px !important;
  }

  body.sidebar-layout .asset-history-timeline-task10
    #asset-history-timeline-header[data-trivsel-app-hero="registry"] {
    min-height: 90px !important;
    height: auto !important;
    max-height: none !important;
    padding-block: 9px !important;
  }
}

@media (max-width: 560px) {
  body [data-trivsel-app-hero="registry"]:not(.dashboard-hero) {
    --tv-registry-hero-min-height: 105px;
    min-height: 105px !important;
    padding: 9px 16px !important;
    gap: 7px 12px !important;
  }

  body [data-trivsel-app-hero="registry"]:not(.dashboard-hero)
    :is(.devices-eyebrow, .tv-visual-hero__eyebrow, .dashboard-eyebrow,
        .locations-eyebrow, .location-form-eyebrow, .device-form-eyebrow,
        .calibration-eyebrow, .maintenance-eyebrow, .hmc-eyebrow,
        .classification-eyebrow) {
    margin-bottom: 2px !important;
    font-size: .61rem !important;
    line-height: 1.15 !important;
  }

  body [data-trivsel-app-hero="registry"]:not(.dashboard-hero) h1 {
    font-size: clamp(1.25rem, 5.4vw, 1.65rem) !important;
    line-height: 1.12 !important;
  }

  body [data-trivsel-app-hero="registry"]:not(.dashboard-hero)
    :is(.devices-header-main > p, .tv-visual-hero__copy > p,
        .dashboard-header-main > p, .locations-header-main > p,
        .location-form-header-main > p, .device-form-header-main > p,
        .calibration-header-main > p, .maintenance-header-main > p,
        .hmc-header > div > p,
        .governance-header > div > p:not(.classification-eyebrow)) {
    margin-top: 3px !important;
    font-size: .76rem !important;
    line-height: 1.3 !important;
  }

  body [data-trivsel-app-hero="registry"]:not(.dashboard-hero)
    :is(.tv-visual-hero__meta, .asset-registry-role-context,
        .dashboard-header-user) {
    margin-top: 3px !important;
    font-size: .7rem !important;
    line-height: 1.2 !important;
  }

  body [data-trivsel-app-hero="registry"]:not(.dashboard-hero)
    .tv-visual-hero__callout {
    padding: 8px 10px !important;
    gap: 4px !important;
  }

  body.sidebar-layout .asset-history-timeline-task10
    #asset-history-timeline-header[data-trivsel-app-hero="registry"] {
    min-height: 105px !important;
    padding: 9px 16px !important;
  }
}

@media (max-width: 699px) {
  body.sidebar-layout .dashboard-page[data-trivsel-dashboard] .dashboard-hero {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 9px 16px !important;
  }

  body.sidebar-layout .dashboard-page[data-trivsel-dashboard] .dashboard-hero-main {
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    gap: 4px !important;
  }

  body.sidebar-layout .dashboard-page[data-trivsel-dashboard] .dashboard-hero h1 {
    font-size: clamp(1.3rem, 5.6vw, 1.7rem) !important;
    line-height: 1.1 !important;
    margin: 0 0 3px !important;
  }

  body.sidebar-layout .dashboard-page[data-trivsel-dashboard]
    .dashboard-header-user {
    margin-top: 3px !important;
    font-size: .72rem !important;
    line-height: 1.2 !important;
  }

  body.sidebar-layout .dashboard-page[data-trivsel-dashboard]
    .dashboard-hero-actions {
    margin-top: 5px !important;
    padding-top: 0 !important;
    gap: 6px !important;
  }

  /* Maintain a touch-safe target even as whitespace and hero type shrink. */
  body.sidebar-layout .dashboard-page[data-trivsel-dashboard]
    .dashboard-hero-button {
    min-height: 44px !important;
  }
}

@media (max-width: 700px) {
  .public-device-page .public-device-hero {
    min-height: 102.5px !important;
    height: auto !important;
    max-height: none !important;
    padding: 14px 13px !important;
  }

  .public-device-page .public-device-hero h1 {
    font-size: clamp(1.3rem, 5.4vw, 1.7rem) !important;
    line-height: 1.12 !important;
  }

  .public-device-page .public-device-hero .public-device-hero-meta {
    margin-top: 7px !important;
    gap: 6px 10px !important;
  }

  .public-device-page .public-device-hero .public-device-tag {
    min-height: 44px !important;
    padding: 8px 12px !important;
    font-size: .85rem !important;
  }
}
