/* R68 – global flash in the real Hero, no extra top notification strip.
   Loaded last after shared, page and mobile foundation styles. */
:where(html.aic-layout-refactor) body.app-shell .ui-hero__right:has(> .ui-hero__flash) {
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}
:where(html.aic-layout-refactor) .ui-hero__right > .ui-hero__flash {
  width: auto;
  max-width: min(420px, 100%);
  min-width: 0;
  flex: 0 1 auto;
  margin: 0;
  justify-items: stretch;
}
:where(html.aic-layout-refactor) .ui-hero__flash .ui-flash {
  max-width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: normal;
  text-align: left;
  box-shadow: none;
}
/* Fallback only when a real Hero did not claim the notification. */
:where(html.aic-layout-refactor) body.app-shell main.main-content > .flash-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0 0 8px;
}
:where(html.aic-layout-refactor) body.app-shell main.main-content > .flash-wrap .ui-flash {
  white-space: normal;
  overflow-wrap: normal;
}
/* R70: Flash never forces an otherwise empty Hero grid row.
   <=560px uses the existing Hero V3 responsive stacking. */
:where(html.aic-layout-refactor) .ui-hero__top:has(> .ui-hero__right > .ui-hero__flash) > .ui-hero__right {
  max-width: min(100%, 65vw);
}
@media (max-width: 560px) {
  :where(html.aic-layout-refactor) .ui-hero__top:has(> .ui-hero__right > .ui-hero__flash) > .ui-hero__right {
    max-width: 100%;
  }
}
/* A single flash remains one text line by default; explicit Details reveals all. */
:where(html.aic-layout-refactor) .ui-flash-stack,
:where(html.aic-layout-refactor) .ui-hero__flash { min-width: 0; }
:where(html.aic-layout-refactor) .ui-flash {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  white-space: normal;
}
:where(html.aic-layout-refactor) .ui-flash__message {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
:where(html.aic-layout-refactor) .ui-flash__details { flex: 0 0 auto; position: relative; font-size: 11px; }
:where(html.aic-layout-refactor) .ui-flash__details > summary {
  padding: 1px 4px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
}
:where(html.aic-layout-refactor) .ui-flash__details[open] .ui-flash__full-message {
  display: block;
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  width: max-content;
  min-width: min(220px, 75vw);
  max-width: min(440px, 85vw);
  padding: 10px 12px;
  border: 1px solid var(--ui-color-border);
  border-radius: var(--ui-radius-md);
  color: var(--ui-color-text);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* Driver/staff mini-nav stays fixed. Reserve its width without a tall blank band. */
:where(html.aic-layout-refactor) body.r68-has-mini-sidebar .dashboard-sidebar-toggle {
  top: calc(20px + var(--safe-top));
  min-height: 44px;
  border-width: 1px;
}
:where(html.aic-layout-refactor) body.r68-has-mini-sidebar main.main-content .ui-hero__top {
  padding-inline-end: 116px;
}
:where(html.aic-layout-refactor) body.r68-has-mini-sidebar main.main-content > :first-child:not(.ui-page) {
  padding-inline-end: 100px;
}
@media (max-width: 900px) {
  :where(html.aic-layout-refactor) body.r68-has-mini-sidebar .dashboard-sidebar-toggle {
    top: calc(12px + var(--safe-top));
  }
}
@media (max-width: 640px) {
  :where(html.aic-layout-refactor) body.r68-has-mini-sidebar main.main-content .ui-hero__top {
    padding-inline-end: 52px;
  }
  :where(html.aic-layout-refactor) body.r68-has-mini-sidebar main.main-content > :first-child:not(.ui-page) {
    padding-inline-end: 48px;
  }
}
/* Issue credentials live outside the toast; do not cache password DOM. */
:where(html.aic-layout-refactor) .r68-issued-card {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--ui-color-border-strong);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-xs);
  color: var(--ui-color-text);
  overflow-wrap: anywhere;
}
:where(html.aic-layout-refactor) .r68-issued-card h2 { margin: 0 0 6px; font-size: 16px; }
:where(html.aic-layout-refactor) .r68-issued-card p { margin: 0 0 10px; font-size: 12px; }
:where(html.aic-layout-refactor) .r68-issued-card dl {
  display: grid;
  grid-template-columns: minmax(95px, 150px) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  font-size: 13px;
}
:where(html.aic-layout-refactor) .r68-issued-card dt { font-weight: 700; }
:where(html.aic-layout-refactor) .r68-issued-card dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
:where(html.aic-layout-refactor) .r68-issued-card__password { font-weight: 700; user-select: text; }
@media (max-width: 480px) {
  :where(html.aic-layout-refactor) .r68-issued-card dl { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  :where(html.aic-layout-refactor) .r68-issued-card dt:not(:first-child) { margin-top: 8px; }
}
/* R70: A grid row shared by title and Flash/actions at tablet and narrow desktop
   widths prevents the old forced empty strip while bounding right-column width. */
@media (min-width: 561px) and (max-width: 1280px) {
  :where(html.aic-layout-refactor) .ui-hero__top:has(> .ui-hero__right > .ui-hero__flash) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
  :where(html.aic-layout-refactor) .ui-hero__top:has(> .ui-hero__right > .ui-hero__flash) > .ui-hero__right {
    width: 100%;
    max-width: 100%;
  }
}
