/* NavState: breadcrumb bar, not-available / not-found card, unsaved-changes dialog, back link.
   Uses only hifi.css tokens (no per-role accent colours); body.dark swaps the tokens, so light and dark both follow. */

.nav-crumbs {
  margin: 0; padding: 9px 32px; background: var(--panel-2, #f4f7f9); border-bottom: 1px solid var(--border, #d9e2e8);
  font: 600 12.5px/1.4 var(--body, system-ui,sans-serif); color: var(--muted, #5b6b78); min-height: 38px; display: flex; align-items: center;
}
.nav-crumbs[hidden] { display: none; }
.nav-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; flex-wrap: nowrap; min-width: 0; width: 100%; overflow: hidden; }
.nav-crumbs li { display: flex; align-items: center; min-width: 0; flex: 0 1 auto; }
.nav-crumbs li + li::before { content: "\203A"; margin: 0 8px; color: var(--muted, #5b6b78); font-weight: 700; flex: 0 0 auto; }
.nav-crumbs li:last-child { flex: 1 1 0; }
.nav-crumbs a, .nav-crumbs .nav-crumb-current {
  display: block; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 6px;
}
.nav-crumbs li:last-child .nav-crumb-current { max-width: 100%; }
.nav-crumbs a { color: var(--blue, #1c6fb8); text-decoration: none; padding: 2px 3px; margin: -2px -3px; }
.nav-crumbs a:hover { text-decoration: underline; }
.nav-crumbs a:focus-visible { outline: none; box-shadow: var(--focus, 0 0 0 3px rgba(28,111,184,.35)) !important; }
.nav-crumbs .nav-crumb-current { color: var(--text, #14212b); font-weight: 700; }

/* the old text-only ledger trail is replaced by the shared bar */
body.nav-has-bar .ldg-breadcrumb { display: none; }

/* a not-available / not-found card replaces the views, it never silently sends anyone home */
body.nav-card-on .view { display: none !important; }
.nav-empty {
  max-width: 560px; margin: 56px auto; padding: 32px 28px; text-align: center; background: var(--panel, #fff);
  border: 1px solid var(--border, #d9e2e8); border-radius: var(--radius, 14px); box-shadow: var(--shadow-sm, 0 4px 14px rgba(0,0,0,.08)); color: var(--text, #14212b);
}
.nav-empty:focus { outline: none; }
.nav-empty h1 { margin: 12px 0 8px; font: 800 21px/1.25 var(--display, system-ui,sans-serif); letter-spacing: -.02em; }
.nav-empty p { margin: 0 0 10px; color: var(--muted, #5b6b78); font: 500 14px/1.55 var(--body, system-ui,sans-serif); }
.nav-empty .nav-empty-path { font: 600 12px var(--mono, ui-monospace,monospace); color: var(--muted, #5b6b78); overflow-wrap: anywhere; }
.nav-empty-icon {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center;
  background: var(--panel-2, #f4f7f9); border: 1px solid var(--border, #d9e2e8); font: 800 22px var(--display, system-ui,sans-serif); color: var(--muted, #5b6b78);
}
.nav-empty-denied .nav-empty-icon { color: var(--amber, #c98a00); border-color: var(--amber, #c98a00); }
.nav-empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.nav-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 18px;
  border-radius: 11px; border: 1.5px solid var(--border, #d9e2e8); background: var(--panel, #fff); color: var(--text, #14212b);
  font: 700 13px var(--body, system-ui,sans-serif); text-decoration: none; cursor: pointer;
}
.nav-btn:hover { border-color: var(--blue, #1c6fb8); color: var(--blue, #1c6fb8); }
.nav-btn:focus-visible { outline: none; box-shadow: var(--focus, 0 0 0 3px rgba(28,111,184,.35)) !important; }
.nav-btn.primary { background: var(--blue, #1c6fb8); border-color: var(--blue, #1c6fb8); color: #fff; }
.nav-btn.primary:hover { color: #fff; filter: brightness(1.06); }
.nav-btn.danger { background: var(--red, #c0392b); border-color: var(--red, #c0392b); color: #fff; }
.nav-btn.danger:hover { color: #fff; filter: brightness(1.06); }

.nav-back {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 4px 2px; color: var(--blue, #1c6fb8);
  font: 700 13px var(--body, system-ui,sans-serif); text-decoration: none; border-radius: 6px;
}
.nav-back:hover { text-decoration: underline; }
.nav-back:focus-visible { outline: none; box-shadow: var(--focus, 0 0 0 3px rgba(28,111,184,.35)) !important; }

.nav-modal-backdrop {
  position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 16px; background: rgba(12, 19, 25, .55);
}
.nav-modal {
  width: 100%; max-width: 420px; padding: 22px 22px 18px; background: var(--panel, #fff); color: var(--text, #14212b);
  border: 1px solid var(--border, #d9e2e8); border-radius: var(--radius, 14px); box-shadow: var(--shadow-sm, 0 4px 14px rgba(0,0,0,.08));
}
.nav-modal h2 { margin: 0 0 8px; font: 800 17px var(--display, system-ui,sans-serif); letter-spacing: -.01em; }
.nav-modal p { margin: 0; color: var(--muted, #5b6b78); font: 500 14px/1.55 var(--body, system-ui,sans-serif); }
.nav-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.nav-modal h2::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--amber, #c98a00); vertical-align: 1px; }

.nav-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 700px) {
  .nav-crumbs { padding: 8px 16px; }
  .nav-crumbs a, .nav-crumbs .nav-crumb-current { max-width: 12ch; }
  .nav-crumbs li:last-child .nav-crumb-current { max-width: 100%; }
  .nav-crumbs li + li::before { margin: 0 5px; }
  .nav-empty { margin: 28px 16px; padding: 24px 18px; }
}

/* heading that receives programmatic focus on a route change: announce, don't draw a ring around it */
.view [tabindex="-1"]:focus, .view[tabindex="-1"]:focus { outline: none; box-shadow: none !important; }
.nav-empty:focus, .nav-empty h1:focus { outline: none; box-shadow: none !important; }

/* standalone pages: the module content hidden while a not-found / not-available card is showing */
.nav-card-hide { display: none !important; }
