/* Shared application shell. Clinical views keep their own layout and theme. */
[data-myfd-shell] {
  --shell-rail: #082642;
  --shell-text: #e0ebf3;
  --shell-muted: #bfd2e0;
  --shell-active: #1c3d58;
  --shell-divider: #36536a;
  --shell-ease: cubic-bezier(.22, 1, .36, 1);
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: start;
  min-height: 100dvh;
  background: var(--ui-canvas);
  transition: grid-template-columns 800ms var(--shell-ease);
}
:root[data-theme="dark"] [data-myfd-shell] {
  --shell-rail: var(--ui-sidebar);
  --shell-text: var(--ui-sidebar-text);
  --shell-muted: var(--ui-sidebar-muted);
  --shell-active: var(--ui-sidebar-active);
  --shell-divider: var(--ui-sidebar-border);
}
[data-myfd-shell][data-shell-expanded="true"] { grid-template-columns: 312px minmax(0, 1fr); }
[data-myfd-shell] .myfd-sidebar {
  position: sticky;
  inset: auto;
  top: 16px;
  grid-area: 1 / 1;
  width: auto;
  height: calc(100dvh - 32px);
  min-height: 0;
  margin: 16px 16px 16px 16px;
  padding: 24px 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  border: 0;
  border-radius: 48px;
  background: var(--shell-rail);
  color: var(--shell-text);
}
[data-myfd-shell] .myfd-sidebar > :is(.brand, .department-study-brand) {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 14px;
  min-height: 92px;
  padding: 0 11px 24px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--shell-divider);
  color: var(--shell-text);
  white-space: nowrap;
  text-decoration: none;
}
[data-myfd-shell] .myfd-sidebar > :is(.brand, .department-study-brand) img {
  flex: 0 0 46px;
  width: 46px;
  height: 66px;
  object-fit: contain;
}
[data-myfd-shell] .myfd-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--shell-divider) transparent;
}
[data-myfd-shell] .myfd-sidebar-scroll > :is(.workspace-label, .department-study-label) {
  margin: 18px 11px 15px;
  font-size: 11px;
  letter-spacing: 1.8px;
  white-space: nowrap;
  color: var(--shell-muted);
}
[data-myfd-shell] .myfd-sidebar nav { display: block; width: 100%; margin: 0; padding: 0; overflow: visible; background: transparent; border: 0; }
[data-myfd-shell] .myfd-sidebar :is(.nav-link, .department-study-admin, .myfd-sidebar-link, nav > a) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row;
  gap: 11px;
  min-height: 48px;
  min-width: 0;
  padding: 12px 24px;
  margin: 0 0 7px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--shell-text);
  font-size: 15px;
  font-weight: 400;
  line-height: 24px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
}
[data-myfd-shell] .myfd-sidebar :is(.nav-link, .department-study-admin, .myfd-sidebar-link, nav > a)[hidden] { display: none; }
[data-myfd-shell] .myfd-sidebar a :is(svg, .icon) { flex: 0 0 20px; width: 20px; height: 20px; color: var(--shell-muted); stroke-width: 1.7; }
[data-myfd-shell] .myfd-sidebar :is(.nav-link.active, a[aria-current="page"]) { background: var(--shell-active); color: var(--shell-text); font-weight: 600; }
[data-myfd-shell] .myfd-sidebar :is(.nav-link, .department-study-admin, .myfd-sidebar-link, nav > a):hover { background: var(--shell-active); }
[data-myfd-shell] .myfd-sidebar :is(.myfd-sidebar-label, nav > a > span, .nav-link > span, .department-study-admin > span) {
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: opacity 250ms ease, transform 250ms ease, visibility 250ms;
}
[data-myfd-shell][data-shell-expanded="true"] .myfd-sidebar :is(.myfd-sidebar-label, nav > a > span, .nav-link > span, .department-study-admin > span) {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 140ms;
}
[data-myfd-shell] .myfd-sidebar :is(.sidebar-bottom, .department-study-bottom) { display: block; margin-top: auto; padding-top: 24px; }
[data-myfd-shell] .myfd-sidebar :is(.edition, .department-study-edition) { border-top: 1px solid var(--shell-divider); margin: 18px 11px 0; padding-top: 20px; color: var(--shell-muted); }
[data-myfd-shell] .myfd-sidebar :is(.edition, .department-study-edition) strong { color: var(--shell-text); }
[data-myfd-shell] .myfd-sidebar-controls { display: none; flex: 0 0 auto; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--shell-divider); }
[data-myfd-shell][data-shell-device="ipad"] .myfd-sidebar-controls { display: flex; justify-content: center; }
[data-myfd-shell] :is(.myfd-sidebar-toggle, .myfd-menu-toggle) { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 10px; border: 0; border-radius: 10px; color: var(--shell-text); background: transparent; cursor: pointer; }
[data-myfd-shell] :is(.myfd-sidebar-toggle, .myfd-menu-toggle):hover { background: var(--shell-active); }
[data-myfd-shell] :is(.myfd-sidebar-toggle, .myfd-menu-toggle) svg { width: 22px; height: 22px; }
[data-myfd-shell] .myfd-sidebar-toggle svg { transition: transform 800ms var(--shell-ease); }
[data-myfd-shell][data-shell-expanded="true"] .myfd-sidebar-toggle svg { transform: rotate(180deg); }
[data-myfd-shell] .myfd-menu-toggle { display: none; }
[data-myfd-shell] .myfd-workspace { grid-area: 1 / 2; min-width: 0; width: 100%; margin: 0; }
[data-myfd-shell] .protocol-card > div:last-child { min-width: 0; overflow-wrap: anywhere; }
[data-myfd-shell] .myfd-topbar {
  position: relative;
  inset: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 20px;
  width: auto;
  height: auto;
  min-height: 76px;
  margin: 16px 24px 0 16px;
  padding: 12px 24px;
  border: 1px solid var(--ui-border);
  border-radius: 20px;
  background: var(--ui-surface);
  color: var(--ui-text);
  box-shadow: 0 2px 7px color-mix(in srgb, var(--ui-shadow) 5%, transparent);
}
[data-myfd-shell] .myfd-breadcrumb { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 14px; line-height: 1.4; }
[data-myfd-shell] .myfd-breadcrumb > svg { flex: 0 0 16px; width: 16px; height: 16px; color: var(--ui-muted); }
[data-myfd-shell] .myfd-breadcrumb :is(.myfd-context, .myfd-page-title) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-myfd-shell] .myfd-context { color: var(--ui-muted); }
[data-myfd-shell] .myfd-page-title { font-weight: 600; }
[data-myfd-shell] .myfd-topbar :is(.library-shortcuts, .myfd-banner-actions) { display: flex; align-items: center; justify-content: flex-end; flex: 0 0 auto; width: auto; gap: 8px; margin: 0 0 0 auto; }
[data-myfd-shell] .myfd-topbar .library-greeting { min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-myfd-shell] :is(a, button):focus-visible { outline: 3px solid var(--ui-focus); outline-offset: 3px; }
@media (max-width: 1080px) {
  [data-myfd-shell] .myfd-breadcrumb > :is(.myfd-context, svg) { display: none; }
  [data-myfd-shell] .myfd-topbar { padding-inline: 16px; gap: 12px; }
}
@media (max-width: 900px) {
  [data-myfd-shell] .myfd-topbar .library-greeting { display: none; }
  [data-myfd-shell] .myfd-topbar .myfd-theme-toggle { min-width: 44px; padding: 8px; }
  [data-myfd-shell] .myfd-topbar .myfd-theme-toggle span { display: none; }
}
@media (max-width: 700px) {
  [data-myfd-shell], [data-myfd-shell][data-shell-expanded="true"] { display: block; }
  [data-myfd-shell] .myfd-sidebar { position: relative; top: auto; height: auto; margin: 12px; padding: 10px 14px; display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: max-content minmax(0, 0fr); align-content: start; border-radius: 20px; overflow: hidden; transition: grid-template-rows 800ms var(--shell-ease); }
  [data-myfd-shell][data-shell-expanded="true"] .myfd-sidebar { grid-template-rows: max-content minmax(0, 1fr); }
  [data-myfd-shell] .myfd-menu-toggle { display: grid; grid-area: 1 / 1; align-self: center; }
  [data-myfd-shell] .myfd-sidebar > :is(.brand, .department-study-brand) { grid-area: 1 / 2; min-height: 44px; padding: 0 0 0 8px; margin: 0; border: 0; gap: 12px; font-size: 18px; }
  [data-myfd-shell] .myfd-sidebar > :is(.brand, .department-study-brand) img { flex-basis: 32px; width: 32px; height: 44px; }
  [data-myfd-shell] .myfd-sidebar :is(.myfd-sidebar-label, nav > a > span, .nav-link > span, .department-study-admin > span) { opacity: 1; visibility: visible; transform: none; transition: none; }
  [data-myfd-shell] .myfd-sidebar-scroll { grid-area: 2 / 1 / auto / -1; display: flex; overflow: hidden; padding-top: 0; margin-top: 0; border: 0; visibility: hidden; transition: visibility 0s 800ms; }
  [data-myfd-shell] .myfd-sidebar-scroll::before { content: ""; display: block; box-sizing: border-box; flex: 0 0 17px; margin-top: 10px; border-top: 1px solid var(--shell-divider); }
  [data-myfd-shell][data-shell-expanded="true"] .myfd-sidebar-scroll { visibility: visible; transition-delay: 0s; }
  [data-myfd-shell] .myfd-sidebar-scroll :is(a, button):focus-visible { outline-offset: -3px; }
  [data-myfd-shell] .myfd-sidebar .myfd-sidebar-scroll > :is(.workspace-label, .department-study-label) { display: none; }
  [data-myfd-shell] .myfd-sidebar :is(.nav-link, .department-study-admin, .myfd-sidebar-link, nav > a) { padding-inline: 16px; }
  [data-myfd-shell] .myfd-sidebar-controls, [data-myfd-shell][data-shell-device="ipad"] .myfd-sidebar-controls { display: none; }
  [data-myfd-shell] .myfd-topbar { margin: 12px 12px 0; min-height: 64px; padding: 9px 12px; border-radius: 16px; gap: 8px; }
  [data-myfd-shell] .myfd-topbar :is(.library-shortcuts, .myfd-banner-actions) { gap: 4px; }
  [data-myfd-shell] .myfd-breadcrumb { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-myfd-shell], [data-myfd-shell] * { transition: none !important; scroll-behavior: auto !important; }
}

/* Follow the supplied badges' outer silhouettes without changing their pixels.
   White artwork inside each badge remains intact; only its outer canvas is clipped. */
:root img[src$="/myfd-mark.png"],
:root [data-myfd-shell] .myfd-sidebar img[src$="/myfd-mark.png"] {
  height: auto;
  aspect-ratio: 1;
  background: transparent;
  border-radius: 0;
  clip-path: polygon(49.9% 10.45%,81.64% 21.39%,81.64% 48.83%,81.54% 53.71%,81.05% 58.59%,79.79% 63.48%,77.73% 68.36%,74.61% 73.24%,70.12% 78.12%,67.29% 80.57%,63.77% 83.01%,59.67% 85.45%,56.74% 86.91%,54.49% 87.89%,52.05% 88.87%,49.85% 89.65%,47.66% 88.87%,45.12% 87.89%,42.87% 86.91%,40.04% 85.45%,35.84% 83.01%,32.32% 80.57%,29.49% 78.12%,25.1% 73.24%,21.97% 68.36%,19.92% 63.48%,18.65% 58.59%,18.07% 53.71%,18.07% 21.39%);
}
:root img[src^="/api/agency/fort-worth-fire-department/logo"],
:root img[src$="/fwfw-logo.png"],
:root [data-myfd-shell] .myfd-sidebar img[src^="/api/agency/fort-worth-fire-department/logo"],
:root [data-myfd-shell] .myfd-sidebar img[src$="/fwfw-logo.png"] {
  height: auto;
  aspect-ratio: 261 / 300;
  background: transparent;
  border-radius: 0;
  clip-path: polygon(1% 9%,6% 7%,13% 5%,21% 3.5%,32% 1.8%,42% 1%,50% .8%,64% 1.7%,76% 3.5%,87% 5.5%,96.5% 8.5%,97% 50%,96% 60%,94% 66.5%,90% 73.5%,85% 80%,78% 86.5%,66% 93%,55% 97%,49% 98%,42% 96%,30% 91%,19% 84%,11% 75%,5% 65%,1% 55%);
}
