/**
 * ALGS Trade Compliance Portal — App Shell Stylesheet (css/app-shell.css)
 * Aesthetic: Apple.com Bento + GitHub Primer 100% Pure Light Mode
 * Features:
 *   - Pixel / Google Omnibox Autocomplete with Ghost Text & Module-First Ranking
 *   - Hover-Only Keyboard Keycaps ([1], [2], [D], [P], [Ctrl+K])
 *   - 3-Tier Cognitive Scaffolding (Beginner Training Wheels -> Intermediate -> Advanced)
 *   - 0.5-Second Inline Cloze Recall Switches (Zero Ad-like Popups)
 *   - "5-Clicks -> 2-Clicks" Smart Path Coach Toast
 *   - Greyed-Out Broken Link Continuity Lock + Tooltip
 *   - Clean Light-Mode Admin Diagnostics & Search Gap / Bounce Intelligence Drawer
 */

:root {
  /* Triumph V10 Navy Prime Palette */
  --navy: #002B49;
  --navy-dark: #001E33;
  --navy-light: #0B4A73;
  --navy-tint: #E8F0F5;
  --navy-tint-strong: #D7E6EF;
  --canvas: #f2f5f7;
  --card: #ffffff;
  --ink: #16222B;
  --ink-muted: #5A6B76;
  --ink-faint: #8496A1;
  --border: #D9E2E8;
  --border-strong: #C3D0D9;
  --amber-bg: #FDF3E0;
  --amber-border: #E9B949;
  --amber-ink: #7A5200;
  --danger: #B3261E;
  --tip-bg: #EDF6EC;
  --tip-border: #9CCB9B;
  --tip-ink: #27512B;
  --radius: 10px;

  /* Legacy & GitHub Primer Fallback Bridge */
  --triumph-navy: var(--navy);
  --triumph-navy-light: var(--navy-light);
  --gh-bg-canvas: #ffffff;
  --gh-bg-subtle: #f2f5f7;
  --gh-bg-inset: #eff2f5;
  --gh-border-default: #D9E2E8;
  --gh-border-muted: #C3D0D9;
  --gh-fg-default: #16222B;
  --gh-fg-muted: #5A6B76;
  --gh-fg-subtle: #8496A1;
  --gh-accent-fg: #002B49;
  --gh-accent-subtle: #E8F0F5;
  --gh-success-fg: #27512B;
  --gh-success-subtle: #EDF6EC;
  --gh-attention-fg: #7A5200;
  --gh-attention-subtle: #FDF3E0;
  --gh-danger-fg: #B3261E;
  --gh-danger-subtle: #ffebe9;
  --apple-blur: saturate(180%) blur(16px);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

body.app-body {
  background-color: var(--gh-bg-subtle);
  color: var(--gh-fg-default);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Accessible Global Native Tooltips via data-tip */
[data-tip] {
  position: relative;
}

[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2328;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(31, 35, 40, 0.22);
  white-space: normal;
  width: max-content;
  max-width: 280px;
  z-index: 500;
  pointer-events: none;
}

/* Native HTML5 View Transitions */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================================
   1. TOP FULL-WIDTH NAVY HEADER BAR & PIXEL OMNIBOX SEARCH (V10 NAVY PRIME)
   ============================================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 62px;
  background: var(--navy);
  color: #ffffff;
  border-bottom: 1px solid var(--navy-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  gap: 20px;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--navy);
  font-weight: 800;
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.06em;
}

.brand-divider {
  display: none;
}

.brand-sub {
  font-size: 12px;
  font-weight: 500;
  color: #B9CFDE;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

/* Google / Pixel Omnibox Search Container */
.omnibox-wrapper {
  position: relative;
  flex: 1 1 420px;
  max-width: 600px;
  margin: 0 auto;
}

.omnibox-input-shell {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 16px;
  height: 38px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: all 0.15s ease;
}

.omnibox-input-shell:focus-within {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(185, 207, 222, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.omnibox-icon {
  font-size: 14px;
  color: var(--ink-faint);
  margin-right: 9px;
  user-select: none;
}

.omnibox-stack {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
}

.omnibox-ghost {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 13.5px;
  font-family: var(--font-sans);
  color: var(--ink-faint);
  pointer-events: none;
  white-space: pre;
  overflow: hidden;
}

.omnibox-input {
  position: relative;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  font-family: inherit;
}

.omnibox-input::placeholder {
  color: var(--ink-faint);
  font-size: 13.5px;
}
  font-family: var(--font-sans);
  color: var(--gh-fg-default);
  outline: none;
}

.omnibox-kbd-group {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

/* Tactile GitHub Keycap Pill */
.kbd-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  color: var(--gh-fg-muted);
  background-color: var(--gh-bg-subtle);
  border: 1px solid var(--gh-border-default);
  border-bottom-width: 2px;
  border-radius: 5px;
  box-shadow: inset 0 -1px 0 var(--gh-border-muted);
  user-select: none;
}

/* Hover-Only Keycap Hint */
.hover-kbd {
  opacity: 0;
  transform: translateY(1px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

*:hover > .hover-kbd,
*:focus-within > .hover-kbd,
.show-all-shortcuts .hover-kbd {
  opacity: 1;
  transform: translateY(0);
}

/* Pixel / Google Omnibox Autocomplete Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--gh-border-default);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(31, 35, 40, 0.14), 0 2px 6px rgba(31, 35, 40, 0.06);
  max-height: 440px;
  overflow-y: auto;
  z-index: 300;
  display: none;
  padding: 6px;
}

.search-dropdown.open {
  display: block;
}

.search-section-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gh-fg-muted);
  padding: 6px 10px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s ease;
  text-decoration: none;
  color: var(--gh-fg-default);
}

.search-item:hover,
.search-item.active {
  background: var(--gh-accent-subtle);
}

.search-item.disabled-item {
  opacity: 0.55;
  cursor: not-allowed;
}

.search-item-left {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.search-item-icon {
  font-size: 15px;
  line-height: 1.2;
  flex-shrink: 0;
}

.search-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gh-fg-default);
}

.search-item-sub {
  font-size: 11px;
  color: var(--gh-fg-muted);
  line-height: 1.35;
}

.search-highlight {
  background: #fff8c5;
  color: #1f2328;
  font-weight: 700;
  padding: 0 2px;
  border-radius: 2px;
}

/* Header Right Cluster */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.75);
}

.pill-btn-geo {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
}

.pill-btn-geo option {
  background: #ffffff;
  color: var(--ink);
}

.pill-btn-mastery {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.pill-btn-primary {
  background: transparent;
  border: 1.5px solid #ffffff;
  color: #ffffff;
  font-weight: 700;
}

.pill-btn-primary:hover {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  color: #ffffff;
}

/* ============================================================================
   2. SUB-HEADER BAR: ROLE FILTERS, TIER SCAFFOLDING & VIEW SWITCHER (V10 SUBBAR)
   ============================================================================ */
.app-subbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 9px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.role-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.subbar-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-right: 2px;
}

.role-chip {
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--canvas);
  color: var(--ink-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.role-chip:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.role-chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #ffffff;
  font-weight: 600;
}

/* 3-Tier Cognitive Scaffolding Switcher + Mode Toggle */
.subbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.segmented-control {
  display: inline-flex;
  background: var(--canvas);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink-muted);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.14s ease;
}

.seg-btn.active {
  background: var(--navy);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 43, 73, 0.35);
}

.seg-btn.locked-tier {
  opacity: 0.55;
}

/* ============================================================================
   3. MAIN WORKSPACE LAYOUT (SIDEBAR + VIEWPORT + SPLIT SCREEN) (V10 WIDE SIDEBAR)
   ============================================================================ */
.app-layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 134px);
}

.app-sidebar {
  width: 320px;
  background: #ffffff;
  border-right: 1px solid var(--border);
  padding: 16px 12px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #33475B;
  padding: 0 10px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-group {
  padding: 10px 0 12px;
  border-top: 1px solid #C3CFDA;
}

.nav-group:first-of-type {
  border-top: none;
  padding-top: 2px;
}

.group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #33475B;
  padding: 0 10px 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.group-title .count {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--navy);
  background: var(--navy-tint);
  border: 1px solid var(--navy-tint-strong);
  border-radius: 999px;
  padding: 1px 7px;
  line-height: 1.5;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 6px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  border-left: 3px solid transparent;
  color: #17222B;
  text-decoration: none;
  transition: background 0.12s ease;
}

.nav-item:hover:not(.link-unavailable) {
  background: #F0F4F8;
  border-left-color: transparent;
}

.nav-item.active {
  background: #E3EDF5;
  border-left-color: var(--navy);
  color: var(--navy);
}

.nav-item.active:hover {
  background: #E3EDF5;
}

.nav-item.active::before {
  display: none;
}

.nav-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.nav-item-title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: break-word;
}

.nav-item.active .nav-item-title {
  color: var(--navy);
  font-weight: 600;
}

.nav-item-meta {
  font-size: 11.5px;
  color: #42566B;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-item-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #42566B;
  letter-spacing: -0.01em;
}

.nav-item-icon {
  margin-top: 2px;
  color: #5A6B78;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-item.active .nav-item-icon {
  color: var(--navy);
}

/* GRACEFUL DISABLE WITH CONTINUITY TOOLTIP (Greyed-Out Unclickable Links) */
.link-unavailable {
  opacity: 0.52;
  color: var(--ink-muted) !important;
  background: transparent !important;
  cursor: not-allowed !important;
  user-select: none;
}

.link-unavailable .status-lock-pill {
  font-size: 9.5px;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--canvas);
  color: var(--ink-muted);
  border: 1px solid var(--border);
}

/* Continuity Lock Tooltip on Hover */
.link-unavailable[data-continuity-tooltip]:hover::after {
  content: attr(data-continuity-tooltip);
  position: absolute;
  left: 12px;
  top: calc(100% + 4px);
  z-index: 400;
  width: 245px;
  padding: 7px 10px;
  background: #1f2328;
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(31, 35, 40, 0.22);
  white-space: normal;
  pointer-events: none;
}

/* Onboarding / Progressive Mastery Card in Sidebar */
.onboarding-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 11.5px;
  margin-top: auto;
  padding-top: 12px;
}

.onboarding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  color: var(--gh-fg-default);
  margin-bottom: 6px;
}

.onboarding-progress-bar {
  height: 5px;
  background: var(--gh-bg-inset);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.onboarding-progress-fill {
  height: 100%;
  background: var(--gh-success-fg);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--gh-fg-muted);
  padding: 3px 0;
}

.onboarding-step.done {
  color: var(--gh-success-fg);
  text-decoration: line-through;
}

/* Main Content Area */
.app-main {
  flex: 1;
  min-width: 0;
  padding: 26px 30px 70px;
  overflow-y: auto;
}

/* ============================================================================
   V10 BREADCRUMBS, CARD WRAPPER, SECTION STRIP & TRUTH TABLE STYLING
   ============================================================================ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 12.5px;
  line-height: 1.4;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.breadcrumbs .crumb-link {
  color: var(--ink-muted);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.12s ease;
}

.breadcrumbs .crumb-link:hover {
  color: var(--navy);
  text-decoration: underline;
}

.breadcrumbs .crumb-current {
  color: var(--ink);
  font-weight: 600;
}

.crumbs-sep {
  color: var(--ink-faint);
  font-size: 11px;
  user-select: none;
}

/* In-Card Section Wayfinding Strip */
.section-strip {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 9px 18px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
}

.strip-item {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-muted);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.strip-item:hover {
  background: var(--canvas);
  color: var(--ink);
}

.strip-item.active {
  background: var(--navy-tint);
  color: var(--navy);
  font-weight: 700;
}

/* High-Contrast Truth Table (Native V10 Specification) */
.truth-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
  font-size: 14.5px;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.truth-table th {
  background: var(--navy);
  color: #ffffff;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 10px 14px;
}

.truth-table td {
  padding: 11px 14px;
  vertical-align: top;
  border-top: 1px solid var(--border);
}

.truth-table tbody tr:nth-child(even) td {
  background: #FAFCFD;
}

.truth-table td.program {
  font-weight: 600;
  color: var(--navy-dark);
  width: 38%;
}

.truth-table .excl {
  font-weight: 700;
  color: var(--danger);
}

/* V10 Callouts & Tips */
.tip-box {
  margin-top: 16px;
  margin-bottom: 16px;
  background: var(--tip-bg);
  border: 1px solid var(--tip-border);
  border-left: 4px solid #4E9A51;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--tip-ink);
  line-height: 1.5;
}

.tip-box strong {
  font-weight: 700;
}

/* Screen Mock/Control Tag */
.mock-tag {
  position: fixed;
  right: 16px;
  bottom: 40px;
  z-index: 99;
  background: var(--navy);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 6px 11px;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 30, 51, 0.35);
  pointer-events: none;
}

/* Predictive Workflow Affinity Bar */
.affinity-bar {
  max-width: 1240px;
  margin: 0 auto 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}



.affinity-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.affinity-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gh-accent-fg);
  background: var(--gh-accent-subtle);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Dual-Aid Split Screen Grid (>= 1500px when toggled) */
.viewport-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

.viewport-grid.split-active {
  grid-template-columns: 1fr 1fr;
  max-width: 17.5in;
  margin: 0 auto;
}

/* ============================================================================
   4. 3-TIER PROGRESSIVE DISCLOSURE & 0.5-SECOND INLINE CLOZE RECALL PILLS
   ============================================================================ */
.quick-tip-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0f172a;
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.45;
}

body[data-mastery-tier="intermediate"] .quick-tip-box,
body[data-mastery-tier="advanced"] .quick-tip-box {
  display: none;
}

.tier-intermediate {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--gh-border-default);
  font-size: 13px;
  line-height: 1.5;
  color: #111827;
  text-align: justify;
  text-justify: inter-word;
}

.tier-advanced {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 3px solid #002B49;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: #111827;
  text-align: justify;
  text-justify: inter-word;
}

body[data-mastery-tier="intermediate"] .tier-intermediate,
body[data-mastery-tier="advanced"] .tier-intermediate {
  display: block;
}

body[data-mastery-tier="advanced"] .tier-advanced {
  display: block;
}

.tier-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
}

.tier-badge-int {
  background: #fef3c7;
  color: #92400e;
}

.tier-badge-adv {
  background: #e0f2fe;
  color: #075985;
}

/* Tactile, Visually Obvious "Either / Or" Quick Check Button Bar */
.quick-check-bar {
  margin-top: 12px;
  padding: 10px 12px;
  background: #f0f9ff;
  border: 1.5px solid #7dd3fc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-check-prompt {
  font-size: 12px;
  font-weight: 700;
  color: #002B49;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cloze-options {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cloze-or-divider {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
}

.cloze-btn {
  border: 1.5px solid #0969da;
  border-bottom-width: 3px;
  background: #ffffff;
  color: #0969da;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(9, 105, 218, 0.1);
  transition: all 0.12s ease;
}

.cloze-btn::before {
  content: "○";
  font-size: 13px;
  line-height: 1;
}

.cloze-btn:hover {
  background: #0969da;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(9, 105, 218, 0.2);
}

.cloze-btn:active {
  transform: translateY(1px);
  border-bottom-width: 1.5px;
}

.cloze-btn.wrong-flash {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}

.cloze-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
}

/* ============================================================================
   5. INTERACTIVE STEP-BY-STEP COMPLIANCE DECISION TREE (NO CALCULATORS)
   ============================================================================ */
.decision-tree-container {
  max-width: 760px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--gh-border-default);
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: 0 4px 20px rgba(31, 35, 40, 0.05);
}

.wizard-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--gh-fg-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.wizard-question {
  font-size: 20px;
  font-weight: 800;
  color: var(--gh-fg-default);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.wizard-sub {
  font-size: 13px;
  color: var(--gh-fg-muted);
  margin-bottom: 18px;
}

.wizard-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.wizard-choice-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1.5px solid var(--gh-border-default);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  transition: all 0.14s ease;
}

.wizard-choice-card:hover {
  border-color: var(--gh-accent-fg);
  background: #f8fbff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(9, 105, 218, 0.08);
}

.wizard-choice-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gh-fg-default);
  margin-bottom: 3px;
}

.wizard-choice-desc {
  font-size: 12px;
  color: var(--gh-fg-muted);
}

.wizard-outcome-box {
  padding: 18px;
  border-radius: 10px;
  border: 1.5px solid var(--gh-border-default);
  background: var(--gh-bg-subtle);
  margin-bottom: 16px;
}

/* ============================================================================
   6. CLEAN SINGLE-LINE SHORTCUT TIP PILL (REPLACES UGLY PATH COACH BOX)
   ============================================================================ */
.path-coach-toast {
  position: fixed;
  bottom: 44px;
  right: 20px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-left: 4px solid #0969da;
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 350;
  display: none;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: #111827;
}

.path-coach-toast.visible {
  display: inline-flex;
  animation: slideUpToast 0.2s ease-out;
}

@keyframes slideUpToast {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   7. LIGHT-MODE ADMIN DIAGNOSTICS & SEARCH GAP INTELLIGENCE DRAWER
   ============================================================================ */
.admin-drawer {
  position: fixed;
  top: 58px;
  right: 0;
  bottom: 32px;
  width: 680px;
  max-width: 96vw;
  background: #ffffff;
  border-left: 1px solid var(--gh-border-default);
  box-shadow: -8px 0 28px rgba(31, 35, 40, 0.14);
  z-index: 380;
  padding: 20px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  box-sizing: border-box;
}

.admin-drawer.open {
  display: block;
}

.admin-card {
  background: var(--gh-bg-subtle);
  border: 1px solid var(--gh-border-default);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

.admin-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--gh-fg-default);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-drawer .micro-table {
  width: 100%;
  max-width: 100%;
  table-layout: auto;
}

.admin-drawer .micro-table th,
.admin-drawer .micro-table td {
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.admin-drawer .tag {
  white-space: normal;
  text-align: center;
}

/* Mastery & Weekly Cadence Popover */
.mastery-popover {
  position: fixed;
  top: 64px;
  right: 120px;
  width: 340px;
  background: #ffffff;
  border: 1px solid var(--gh-border-default);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(31, 35, 40, 0.14);
  padding: 14px 16px;
  z-index: 360;
  display: none;
}

.mastery-popover.open {
  display: block;
}

/* ============================================================================
   8. BOTTOM HARDWARE TELEMETRY HUD & VERSION FOOTER BAR
   ============================================================================ */
.app-footer-hud {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: #ffffff;
  border-top: 1px solid var(--gh-border-default);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--gh-fg-muted);
  z-index: 250;
}

.hud-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gh-success-fg);
  margin-right: 4px;
}

/* Responsive Viewport Reflow */
@media (max-width: 1024px) {
  .app-sidebar {
    width: 220px;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }
  .app-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--gh-border-default);
  }
}

/* Strict file:// Protocol Lockout Overlay */
.origin-lockout-screen {
  position: fixed;
  inset: 0;
  background: #f6f8fa;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.origin-lockout-card {
  max-width: 480px;
  background: #ffffff;
  border: 1px solid var(--gh-border-default);
  border-top: 4px solid var(--gh-danger-fg);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(31, 35, 40, 0.1);
}


/* ============================================================================
   JOB AID & COMPLIANCE MODULE COMPONENT STYLES (SCREEN ONLY)
   ============================================================================ */
/**
 * ALGS Visual Content & Job Aid Stylesheet (css/job-aid-print.css)
 * High-Contrast, Simplified Typography & Clean 1–2 Page Print Pagination (8.5" x 11")
 */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* High-Contrast Enterprise Palette */
  --triumph-navy: #002B49;
  --triumph-navy-dark: #001A2C;
  --triumph-red: #8B1D2C;

  --ink-primary: #111827;     /* High-contrast near-black for all body reading */
  --ink-secondary: #374151;   /* Crisp dark slate for secondary labels */
  --ink-muted: #4b5563;

  --border-strong: #94a3b8;
  --border-default: #cbd5e1;
  --border-subtle: #e2e8f0;

  --surface-white: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-header: #f1f5f9;

  /* Single Clean System Font Stack */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ============================================================================
   1. WEB VIEW (DEFAULT) vs. PRINT PREVIEW MODE (8.5" x 11" 1-2 PAGE)
   ============================================================================ */
.sheet-container {
  max-width: 1220px;
  margin: 0 auto;
  background: transparent;
}

.page {
  width: 100%;
  max-width: 1220px;
  padding: 28px 32px;
  margin: 0 auto;
  background: var(--surface-white);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
  color: var(--ink-primary);
}


/* ============================================================================
   2. DOCUMENT HEADER
   ============================================================================ */
.doc-header {
  border-bottom: 2px solid var(--triumph-navy);
  padding-bottom: 12px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.doc-org {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--triumph-red);
  margin-bottom: 4px;
}

.doc-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--triumph-navy);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.doc-subtitle {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink-secondary);
  margin-top: 3px;
}

.doc-meta {
  text-align: right;
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.45;
  flex-shrink: 0;
}

.doc-badge {
  display: inline-block;
  background: var(--triumph-navy);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

/* ============================================================================
   3. UNIFORM SYMMETRIC GRID & CARDS (SIMPLIFIED FONTS, HIGH CONTRAST)
   ============================================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.grid-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  background: var(--surface-white);
  border: 1px solid var(--border-default);
  border-top: 3px solid var(--triumph-navy);
  border-radius: 8px;
  padding: 16px 18px;
  break-inside: avoid;
  page-break-inside: avoid;
  display: flex;
  flex-direction: column;
}

.card-red {
  border-top-color: var(--triumph-red);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--triumph-navy);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title-icon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.card-lead {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-primary);
  margin-bottom: 10px;
  text-align: justify;
  text-justify: inter-word;
}

/* ============================================================================
   4. UNIFORM HIGH-CONTRAST TABLES (FIXED COLUMN ALIGNMENT)
   ============================================================================ */
.micro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 4px 0 8px;
  table-layout: fixed;
  border: 1px solid var(--border-default);
}

.micro-table th {
  background: var(--surface-header);
  color: var(--ink-primary);
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--border-strong);
  border-right: 1px solid var(--border-subtle);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.micro-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-default);
  border-right: 1px solid var(--border-subtle);
  vertical-align: top;
  color: var(--ink-primary);
  line-height: 1.45;
  text-align: left;
}

.micro-table th:last-child,
.micro-table td:last-child {
  border-right: none;
}

.micro-table tr:last-child td {
  border-bottom: none;
}

.micro-table tr:nth-child(even) td {
  background-color: var(--surface-subtle);
}

/* Fixed Column Width Classes for Clean Alignment */
.col-25 { width: 25%; }
.col-30 { width: 30%; }
.col-35 { width: 35%; }
.col-45 { width: 45%; }
.col-50 { width: 50%; }

/* ============================================================================
   5. CHECKLISTS & CALLOUT BANNERS
   ============================================================================ */
.check-list {
  list-style: none;
  margin: 4px 0;
}

.check-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-primary);
  text-align: justify;
  text-justify: inter-word;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #15803d;
  font-weight: 800;
}

.callout {
  padding: 10px 14px;
  border-radius: 6px;
  margin: 8px 0;
  font-size: 13.5px;
  line-height: 1.5;
  border: 1px solid var(--border-default);
  border-left: 4px solid var(--triumph-navy);
  background: var(--surface-subtle);
  color: var(--ink-primary);
  text-align: justify;
  text-justify: inter-word;
}

.callout-red {
  background: #fef2f2;
  border-color: #fecaca;
  border-left-color: var(--triumph-red);
}

.callout-navy {
  background: #f0f9ff;
  border-color: #bae6fd;
  border-left-color: var(--triumph-navy);
}

.callout-emerald {
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-left-color: #15803d;
}

.callout-title {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-primary);
  margin-bottom: 3px;
}

/* Clean High-Contrast Status Badges */
.tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-default);
  background: var(--surface-header);
  color: var(--ink-primary);
  white-space: nowrap;
}

.tag-red {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.tag-navy {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #075985;
}

.tag-amber {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.tag-green {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

/* Explicit Danger / Prohibition Pill ("❌ Never use a Temporary Importation under Bond (TIB)") */
.ban-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  color: #b91c1c;
  background: #fef2f2;
  border: 1.5px solid #f87171;
  padding: 2px 8px;
  border-radius: 6px;
  line-height: 1.35;
}



/* ============================================================================
   SIDEBAR ROLE SLICER & INLINE OUT-OF-SLICE SEARCH PROMPT
   ============================================================================ */
.sidebar-role-slicer {
  padding: 12px 14px 14px;
  background: var(--gh-canvas-subtle, #f6f8fa);
  border-bottom: 1px solid var(--gh-border-default, #d0d7de);
  margin-bottom: 12px;
}
.slicer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.slicer-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gh-fg-muted, #57606a);
}
.slicer-reset-btn {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--gh-accent, #0969da);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
}
.slicer-reset-btn:hover {
  text-decoration: underline;
  background: rgba(9, 105, 218, 0.08);
}
.slicer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.slicer-chip {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid var(--gh-border-default, #d0d7de);
  background: #ffffff;
  color: var(--gh-fg-default, #24292f);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.35;
}
.slicer-chip:hover {
  background: #f3f4f6;
  border-color: var(--triumph-navy, #002B49);
}
.slicer-chip.active {
  background: var(--triumph-navy, #002B49);
  color: #ffffff;
  border-color: var(--triumph-navy, #002B49);
  font-weight: 600;
}
.empty-slice-notice {
  padding: 20px 14px;
  font-size: 12px;
  color: var(--gh-fg-muted, #57606a);
  text-align: center;
  font-style: italic;
}
.out-of-slice-banner {
  padding: 8px 12px;
  background: #f0fdf4;
  border-top: 1px solid #bbf7d0;
  font-size: 11px;
  color: #166534;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.out-of-slice-btn {
  background: #166534;
  color: #ffffff;
  border: none;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}
.nav-tree-btn {
  background: transparent;
  border: 1px solid var(--gh-border-default, #d0d7de);
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 2px 4px;
  color: var(--gh-fg-muted, #57606a);
  transition: all 0.15s ease;
}
.nav-tree-btn:hover {
  background: var(--gh-canvas-subtle, #f6f8fa);
  border-color: var(--triumph-navy, #002B49);
  color: var(--triumph-navy, #002B49);
}
