:root {
  --navy: #1B2A4A;
  --blue: #2B579A;
  --light-blue: #E8EEF7;
  --amber: #F5A623;
  --white: #FFFFFF;
  --gray: #6B7A90;
  --border: #D0DAE8;
  --word: #185ABD;
  --excel: #107C41;
  --ppt: #C43E1C;
  --outlook: #0078D4;
  --teams: #6264A7;
  --onenote: #7719AA;
  --access: #A4373A;
  --publisher: #B7472A;
  --visio: #3955A3;
  --sharepoint: #038387;
  --admin: #707070;
  --copilot: #10A37F;
  --card-bg: #F7FAFF;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #F0F4FB;
  color: var(--navy);
  line-height: 1.6;
}

a { color: inherit; }

/* ===== TOP NAV ===== */
nav.topnav {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 16px rgba(27,42,74,0.18);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
}
.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}
.logo span { color: var(--amber); }
.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.15s;
}
.nav-link:hover { color: var(--white); background: rgba(255,255,255,0.12); }
.nav-link.active { color: var(--white); background: rgba(255,255,255,0.16); }
.nav-search-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.8);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-search-btn:hover { background: rgba(255,255,255,0.16); }

/* ===== PAGE HEADER (per-app hero) ===== */
.page-header {
  padding: 48px 24px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.page-header .app-icon-big {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: rgba(255,255,255,0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--white);
  margin: 0 auto 16px;
  border: 1px solid rgba(255,255,255,0.25);
}
.page-header h1 {
  font-size: clamp(26px, 4.2vw, 42px);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -1px;
  margin-bottom: 10px;
}
.page-header p {
  color: rgba(255,255,255,0.78);
  font-size: 15.5px;
  max-width: 580px;
  margin: 0 auto;
}
.breadcrumb {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 14px;
}
.breadcrumb a { color: rgba(255,255,255,0.75); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== HOME HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #263A5E 60%, #2B579A 100%);
  padding: 72px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(43,87,154,0.4) 0%, transparent 60%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-block;
  background: rgba(245,166,35,0.18);
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(245,166,35,0.3);
}
.hero h1 {
  font-size: clamp(28px, 5vw, 54px);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 16px;
}
.hero h1 em { font-style: normal; color: var(--amber); }
.hero p {
  color: rgba(255,255,255,0.72);
  font-size: 17px;
  max-width: 600px;
  margin: 0 auto 36px;
}
.search-bar { max-width: 560px; margin: 0 auto; position: relative; }
.search-bar input {
  width: 100%;
  padding: 14px 52px 14px 20px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-family: inherit;
  background: var(--white);
  color: var(--navy);
  outline: none;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.search-bar input::placeholder { color: #9AAEC8; }
.search-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--blue); font-size: 18px; pointer-events: none; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 26px; font-weight: 800; color: var(--white); }
.hero-stat .label { font-size: 11.5px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* ===== APP GRID (home page) ===== */
main { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin: 44px auto 56px;
}
.app-card {
  background: var(--white);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 22px;
  text-decoration: none;
  color: var(--navy);
  transition: all 0.18s;
  box-shadow: 0 1px 6px rgba(27,42,74,0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.app-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(27,42,74,0.14); }
.app-card .ic {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--white);
}
.app-card h3 { font-size: 17px; font-weight: 700; }
.app-card p { font-size: 13px; color: var(--gray); line-height: 1.5; }
.app-card .count { font-size: 11px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: 0.4px; margin-top: auto; padding-top: 8px; }

/* ===== SECTION HEADERS ===== */
.section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 44px 0 26px;
}
.section-divider:first-of-type { margin-top: 36px; }
.section-divider h2 { font-size: 23px; font-weight: 800; color: var(--navy); white-space: nowrap; }
.divider-line { flex: 1; height: 1px; background: var(--border); }

/* ===== CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}
.card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
  box-shadow: 0 1px 6px rgba(27,42,74,0.06);
}
.card:hover { box-shadow: 0 6px 24px rgba(27,42,74,0.13); transform: translateY(-2px); }
.card-header {
  padding: 16px 18px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.card-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--navy); }
.card-tag {
  margin-left: auto;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 10px;
  color: var(--white);
  flex-shrink: 0;
}
.card-body { padding: 14px 18px 16px; }
.card-desc { font-size: 13px; color: var(--gray); margin-bottom: 14px; line-height: 1.55; }

/* Shortcut rows */
.shortcut-list { display: flex; flex-direction: column; gap: 8px; }
.shortcut-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shortcut-label { font-size: 13px; color: var(--navy); flex: 1; }
.keys { display: flex; align-items: center; gap: 4px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.key {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card-bg);
  border: 1px solid #C8D5E8;
  border-bottom: 3px solid #B0C0D8;
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11px; font-weight: 700; color: var(--navy);
  font-family: 'Segoe UI', monospace;
  min-width: 26px; text-align: center; line-height: 1.6;
}
.key-sep { font-size: 11px; color: var(--gray); }

/* Tip lists */
.tip-list { display: flex; flex-direction: column; gap: 10px; }
.tip-item { display: flex; gap: 10px; align-items: flex-start; }
.tip-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--light-blue); color: var(--blue);
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}
.tip-text { font-size: 13px; color: var(--navy); line-height: 1.55; }
.tip-text strong { color: var(--blue); }
.tip-text code {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  font-family: 'Cascadia Code', Consolas, monospace;
}

.info-block {
  background: var(--light-blue);
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  font-size: 13px; color: var(--navy);
  margin-top: 10px; line-height: 1.55;
}
.warn-block {
  background: #FDF1E6;
  border-left: 3px solid var(--amber);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  font-size: 13px; color: var(--navy);
  margin-top: 10px; line-height: 1.55;
}

/* Formula table */
.formula-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.formula-table th {
  text-align: left; padding: 7px 8px;
  background: var(--card-bg); color: var(--gray);
  font-weight: 700; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.4px;
  border-bottom: 2px solid var(--border);
}
.formula-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.formula-table tr:last-child td { border-bottom: none; }
.formula-table code {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-size: 11.5px;
  font-family: 'Cascadia Code', Consolas, monospace; color: var(--excel);
  white-space: nowrap;
}

/* Step list (numbered process) */
.step-list { counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.step-item { display: flex; gap: 12px; }
.step-item .step-marker {
  counter-increment: step;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--blue); color: var(--white);
  font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-item .step-marker::before { content: counter(step); }
.step-content { font-size: 13px; color: var(--navy); line-height: 1.55; padding-top: 2px; }
.step-content strong { color: var(--navy); display: block; margin-bottom: 2px; font-size: 13.5px; }

/* TOC sidebar (per app page) */
.page-layout { display: flex; gap: 32px; align-items: flex-start; margin: 32px auto; }
.toc-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.toc-sidebar h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--gray); margin-bottom: 10px; }
.toc-sidebar a {
  display: block;
  font-size: 12.5px;
  color: var(--navy);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 1px;
}
.toc-sidebar a:hover { background: var(--light-blue); }
.toc-sidebar a.active { background: var(--light-blue); font-weight: 700; color: var(--blue); }
.page-content { flex: 1; min-width: 0; }

/* Footer */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 36px 24px;
  font-size: 13px;
  margin-top: 48px;
}
footer strong { color: var(--amber); }
footer .footer-links { margin-top: 14px; display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
footer .footer-links a { color: rgba(255,255,255,0.65); text-decoration: none; font-size: 12px; }
footer .footer-links a:hover { color: var(--white); }

/* Search overlay */
.search-overlay {
  position: fixed; inset: 0; background: rgba(27,42,74,0.55);
  z-index: 999; display: none; align-items: flex-start; justify-content: center;
  padding-top: 80px;
}
.search-overlay.open { display: flex; }
.search-modal {
  background: var(--white); border-radius: 14px; width: 90%; max-width: 600px;
  max-height: 70vh; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.search-modal input {
  width: 100%; padding: 18px 20px; border: none; border-bottom: 1px solid var(--border);
  font-size: 16px; outline: none; font-family: inherit;
}
.search-results { overflow-y: auto; padding: 8px; }
.search-result-item {
  display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none;
  color: var(--navy); font-size: 13px;
}
.search-result-item:hover { background: var(--light-blue); }
.search-result-item .sr-app { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--blue); }
.search-result-item .sr-title { font-weight: 600; margin: 2px 0; }
.search-result-item .sr-desc { font-size: 12px; color: var(--gray); }
.search-empty { padding: 30px; text-align: center; color: var(--gray); font-size: 13px; }

/* Filter badge for cards (search highlighting) */
.card.hidden { display: none; }

/* Quick nav prev/next at bottom */
.page-nav-footer {
  display: flex; justify-content: space-between; gap: 16px;
  margin: 40px 0 12px; flex-wrap: wrap;
}
.page-nav-btn {
  flex: 1; min-width: 200px;
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 18px; text-decoration: none; color: var(--navy);
  display: flex; flex-direction: column; gap: 2px;
  transition: all 0.15s;
}
.page-nav-btn:hover { box-shadow: 0 4px 16px rgba(27,42,74,0.1); border-color: var(--blue); }
.page-nav-btn.next { text-align: right; align-items: flex-end; }
.page-nav-btn .pn-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray); }
.page-nav-btn .pn-title { font-size: 14.5px; font-weight: 700; }

@media (max-width: 900px) {
  .page-layout { flex-direction: column; }
  .toc-sidebar { position: static; width: 100%; max-height: none; }
}
@media (max-width: 640px) {
  .nav-inner { gap: 12px; }
  .cards-grid { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: 1fr 1fr; }
}
