/* ==========================================================================
   ENTERPRISE DEVELOPER DOCUMENTATION PORTAL
   Style System: GitHub Docs / JetBrains Developer Standards
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* GitHub Dark Theme Palette */
  --bg-canvas: #0d1117;
  --bg-sidebar: #161b22;
  --bg-card: #161b22;
  --bg-card-hover: #21262d;
  --bg-code: #0b0e14;
  --bg-code-header: #161b22;

  --border-default: #30363d;
  --border-muted: #21262d;
  --border-focus: #58a6ff;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --text-link: #58a6ff;

  --accent-blue: #58a6ff;
  --accent-blue-bg: rgba(56, 139, 253, 0.12);
  --accent-green: #3fb950;
  --accent-green-bg: rgba(46, 160, 67, 0.15);
  --accent-orange: #d29922;
  --accent-orange-bg: rgba(187, 128, 9, 0.15);
  --accent-purple: #bc8cff;
  --accent-purple-bg: rgba(163, 113, 247, 0.15);

  --sidebar-width: 290px;
  --header-height: 56px;
  --radius: 6px;
  --radius-lg: 8px;
}

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background-color: #161b22;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #238636;
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-tag {
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(110, 118, 129, 0.2);
  color: var(--text-secondary);
  padding: 0.15rem 0.45rem;
  border-radius: 20px;
  border: 1px solid var(--border-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  border: 1px solid var(--border-default);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
}

.btn-header {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-default);
  background: #21262d;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-header:hover {
  background: #30363d;
  border-color: #8b949e;
  text-decoration: none;
}

.btn-header.primary {
  background: #238636;
  border-color: rgba(240, 246, 252, 0.1);
  color: #fff;
}

.btn-header.primary:hover {
  background: #2ea043;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
}

/* Layout */
.app-container {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-default);
  padding: 1.25rem 0.85rem;
}

.sidebar-track-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.6rem 0.6rem 0.35rem;
  margin-top: 0.75rem;
}

.sidebar-track-title:first-child {
  margin-top: 0;
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: all 0.1s ease;
}

.sidebar-nav-item a:hover {
  background: #21262d;
  color: var(--text-primary);
  text-decoration: none;
}

.sidebar-nav-item a.active {
  background: rgba(56, 139, 253, 0.15);
  color: var(--accent-blue);
  font-weight: 600;
}

.sidebar-phase-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.app-main {
  flex: 1;
  min-width: 0;
  padding: 2rem 3rem 5rem;
  max-width: 1180px;
}

/* Dashboard Elements */
.dashboard-masthead {
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-default);
}

.masthead-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.masthead-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 860px;
}

.progress-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.progress-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.progress-stat-header {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.progress-stat-val {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-bar-track {
  width: 100%;
  height: 4px;
  background: var(--border-muted);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.filter-btn {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  cursor: pointer;
  transition: all 0.1s ease;
}

.filter-btn:hover {
  background: #21262d;
  color: var(--text-primary);
}

.filter-btn.active {
  background: #21262d;
  color: var(--text-primary);
  border-color: #8b949e;
  font-weight: 600;
}

.search-field-wrap {
  position: relative;
  min-width: 300px;
}

.search-field {
  width: 100%;
  background: #0b0e14;
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  border-radius: var(--radius);
  outline: none;
}

.search-field:focus {
  border-color: var(--border-focus);
}

.search-field-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.track-section {
  margin-bottom: 2.25rem;
}

.track-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.module-rows-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.module-row {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.module-row:hover {
  background: var(--bg-card-hover);
  border-color: #8b949e;
}

.module-row-left {
  flex: 1;
  min-width: 0;
}

.module-row-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.module-row-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-blue);
  background: var(--accent-blue-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.module-row-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
}

.module-row-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.module-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-item {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: #0b0e14;
  border: 1px solid var(--border-muted);
  color: #8b949e;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.module-row-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.module-time-pill {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.open-phase-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-blue);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  background: rgba(56, 139, 253, 0.1);
  border: 1px solid rgba(56, 139, 253, 0.2);
  white-space: nowrap;
}

.open-phase-btn:hover {
  background: rgba(56, 139, 253, 0.2);
  text-decoration: none;
}

/* Documentation Detail Styles */
.phase-masthead {
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-default);
}

.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.phase-h1 {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.65rem;
}

.source-mapping-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  background: #161b22;
  border: 1px solid var(--border-default);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.textbook-badge-bar {
  background: rgba(46, 160, 67, 0.1);
  border: 1px solid rgba(46, 160, 67, 0.25);
  color: #3fb950;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
}

/* 1. HORSTMANN AUTHOR QUOTE BOX */
.horstmann-quote-box {
  background: rgba(56, 139, 253, 0.08);
  border-left: 3px solid #58a6ff;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.15rem 1.35rem;
  margin: 1.25rem 0;
}

.horstmann-citation {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #79c0ff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.horstmann-quote-text {
  font-size: 0.92rem;
  font-style: italic;
  color: #e6edf3;
  line-height: 1.6;
}

.horstmann-axioms-list {
  list-style: none;
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.horstmann-axioms-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.axiom-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 700;
  background: rgba(56, 139, 253, 0.2);
  color: #58a6ff;
  border: 1px solid rgba(56, 139, 253, 0.3);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* 2. REAL-WORLD ANALOGY BOX */
.analogy-box {
  background: rgba(187, 128, 9, 0.08);
  border-left: 3px solid var(--accent-orange);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.35rem;
  margin: 1.25rem 0;
}

.analogy-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: #e3b341;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.analogy-content {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.6;
}

/* 3. SHORT MEMORY PRO-TIP BOX */
.protip-box {
  background: rgba(46, 160, 67, 0.08);
  border-left: 3px solid var(--accent-green);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.protip-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #56d364;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.protip-content {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.55;
}

/* Definition Box */
.def-box {
  background: rgba(56, 139, 253, 0.08);
  border-left: 3px solid var(--accent-blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.def-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: #79c0ff;
  margin-bottom: 0.35rem;
}

.def-content {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.55;
}

/* Concept Cards */
.concept-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-default);
  flex-wrap: wrap;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.checklist-btn {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.1s ease;
}

.checklist-btn:hover {
  background: #21262d;
  color: var(--text-primary);
}

.checklist-btn.completed {
  background: rgba(46, 160, 67, 0.15);
  border-color: rgba(46, 160, 67, 0.4);
  color: var(--accent-green);
}

/* Diagrams */
.diagram-container {
  background: #0b0e14;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.diagram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.65rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-default);
}

.diagram-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.diagram-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Code Snippet Box */
.code-box {
  background: var(--bg-code);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  margin: 1.5rem 0;
  overflow: hidden;
}

.code-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-code-header);
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--border-default);
}

.code-filepath {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: #79c0ff;
}

.copy-btn {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: #21262d;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  cursor: pointer;
}

.copy-btn:hover {
  background: #30363d;
  color: var(--text-primary);
}

pre {
  margin: 0;
  padding: 1.15rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #e6edf3;
}

code {
  font-family: var(--font-mono);
  background: rgba(110, 118, 129, 0.2);
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  font-size: 0.88em;
}

pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.kw { color: #ff7b72; font-weight: 600; }
.typ { color: #79c0ff; }
.fn { color: #d2a8ff; }
.str { color: #a5d6ff; }
.num { color: #79c0ff; }
.ann { color: #ffa657; }
.cmt { color: #8b949e; font-style: italic; }

/* Line by line breakdown */
.code-explanation-box {
  background: #161b22;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin: 1rem 0 1.5rem;
}

.explanation-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.explanation-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.explanation-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.step-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(56, 139, 253, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 139, 253, 0.3);
  white-space: nowrap;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-default);
}

.data-table th {
  background: #0b0e14;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Pagination */
.phase-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-default);
  gap: 1rem;
  flex-wrap: wrap;
}

.page-nav-link {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: #161b22;
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  text-decoration: none;
  max-width: 48%;
}

.page-nav-link:hover {
  background: #21262d;
  border-color: #8b949e;
  text-decoration: none;
}

.page-nav-link.next {
  text-align: right;
  margin-left: auto;
}

.page-nav-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.page-nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0.2rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #21262d;
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-default);
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 1000;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    width: 290px;
    height: calc(100vh - var(--header-height));
    z-index: 99;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
    transition: left 0.25s ease;
  }
  .app-sidebar.open {
    left: 0;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .app-main {
    padding: 1.5rem 1.25rem 4rem;
  }
  .progress-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .progress-strip {
    grid-template-columns: 1fr;
  }
  .module-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .module-row-right {
    width: 100%;
    justify-content: space-between;
  }
  .search-field-wrap {
    min-width: 100%;
  }
  .page-nav-link {
    max-width: 100%;
    width: 100%;
  }
}


/* ==========================================================================
   ENTERPRISE CURRICULUM TOOLBAR, MATRIX CARDS & MILESTONES (MOBILE-FIRST)
   ========================================================================== */

.curriculum-toolbar {
  margin-bottom: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.search-box-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #e6edf3;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  padding: 0.7rem 1rem 0.7rem 2.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238b949e'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.85rem center;
  background-size: 16px;
}

.search-input:focus {
  border-color: #58a6ff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.25);
  background-color: #0d1117;
}

.search-input::placeholder {
  color: #6e7681;
}

/* Scrollable Horizontal Filter Carousel */
.track-filter-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0.2rem 0.1rem;
}

.track-filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  white-space: nowrap;
  flex-shrink: 0;
  background: #21262d;
  color: #8b949e;
  border: 1px solid #30363d;
  border-radius: 20px;
  padding: 0.45rem 0.95rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.filter-pill:hover {
  background: #30363d;
  color: #e6edf3;
  border-color: #8b949e;
}

.filter-pill.active {
  background: #1f6feb;
  color: #ffffff;
  border-color: #58a6ff;
  box-shadow: 0 2px 8px rgba(31, 111, 235, 0.4);
}

/* Track Sections & Header */
.track-section {
  margin-bottom: 2.75rem;
}

.track-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(48, 54, 61, 0.6);
}

.track-badge {
  background: rgba(88, 166, 255, 0.15);
  color: #58a6ff;
  border: 1px solid rgba(88, 166, 255, 0.3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.track-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #e6edf3;
  letter-spacing: -0.01em;
}

/* Grid of Cards */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.matrix-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.matrix-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #1f6feb, #2ea043);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.matrix-card:hover {
  border-color: #58a6ff;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.matrix-card:hover::before {
  opacity: 1;
}

.matrix-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.matrix-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #79c0ff;
  background: rgba(56, 139, 253, 0.12);
  border: 1px solid rgba(56, 139, 253, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.matrix-time {
  font-size: 0.78rem;
  color: #8b949e;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.matrix-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.matrix-title a {
  color: #e6edf3;
  text-decoration: none;
  transition: color 0.15s ease;
}

.matrix-title a:hover {
  color: #58a6ff;
  text-decoration: none;
}

.matrix-desc {
  font-size: 0.85rem;
  color: #8b949e;
  line-height: 1.55;
  margin-bottom: 1.15rem;
  flex-grow: 1;
}

.matrix-meta {
  margin-bottom: 1rem;
}

.matrix-tag {
  display: inline-block;
  font-size: 0.74rem;
  color: #a5d6ff;
  background: rgba(56, 139, 253, 0.08);
  border: 1px solid rgba(56, 139, 253, 0.2);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.btn-matrix-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.6rem 1rem;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #58a6ff;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-matrix-link:hover {
  background: #1f6feb;
  color: #ffffff;
  border-color: #58a6ff;
  box-shadow: 0 4px 12px rgba(31, 111, 235, 0.3);
  text-decoration: none;
}

/* Master Checklist & Milestones */
.master-checklist-section {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid #30363d;
}

.checklist-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.checklist-subtitle {
  font-size: 0.88rem;
  color: #8b949e;
  margin-top: 0.25rem;
}

.milestones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.75rem;
}

.milestone-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  transition: all 0.15s ease;
}

.milestone-item:hover {
  border-color: #8b949e;
  background: #21262d;
}

.milestone-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.milestone-phase {
  background: #21262d;
  color: #58a6ff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  border: 1px solid #30363d;
  flex-shrink: 0;
}

.milestone-title {
  font-size: 0.85rem;
  color: #e6edf3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   ADVANCED MOBILE RESPONSIVE OPTIMIZATIONS (Smartphones 320px - 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .app-header {
    padding: 0 0.85rem;
  }
  
  .brand-tag {
    display: none !important;
  }
  
  .brand-title {
    font-size: 0.92rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions .btn-header:not(.primary) {
    display: none !important;
  }

  .header-actions .progress-pill {
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
  }

  .app-main {
    padding: 1.25rem 0.95rem 4rem;
  }

  .phase-h1 {
    font-size: 1.45rem !important;
    line-height: 1.25 !important;
  }

  .phase-lead {
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
  }

  .matrix-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .milestones-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .milestone-item {
    padding: 0.65rem 0.85rem;
  }

  .milestone-title {
    font-size: 0.82rem;
  }
  
  .concept-card {
    padding: 1rem;
  }
  
  .card-title {
    font-size: 1.05rem;
  }
}
