/* Mirrors the NectarWorks app (frontend/src/styles): light theme, rose app-shell, glass cards, pill controls. */
:root {
  --color-primary-50: #fff0f2;
  --color-primary-500: #e90130;
  --color-primary-700: #9b0022;
  --neutral-950: #111111;
  --surface-card: #ffffff;
  --surface-glass-card: rgba(255, 255, 255, 0.88);
  --surface-glass-card-hover: rgba(255, 255, 255, 0.98);
  --surface-hover: #f0f0f0;
  --surface-muted: #f5f5f5;
  --surface-brand-soft: rgba(233, 1, 48, 0.08);
  --border: #e0e0e0;
  --border-glass: rgba(255, 255, 255, 0.95);
  --text-strong: #111111;
  --text-default: #1a1a1a;
  --text-muted: #777777;
  --yes-bg: #d5f5e3;
  --yes-fg: #146c3a;
  --no-bg: #fff0f2;
  --no-fg: #9b0022;
  --limited-bg: #ebf5fb;
  --limited-fg: #1f5f8b;
  --review-bg: #fef5e7;
  --review-fg: #8a5a00;
  --radius-card: 24px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 1) inset, 0 1px 3px rgba(17, 24, 39, 0.04),
    0 4px 16px -8px rgba(17, 24, 39, 0.08);
  --shadow-card-hover: 0 1px 0 rgba(255, 255, 255, 1) inset, 0 4px 8px rgba(17, 24, 39, 0.08),
    0 20px 40px -12px rgba(233, 1, 48, 0.28), 0 16px 32px -8px rgba(17, 24, 39, 0.18);
  --shadow-nav: 0 8px 24px -4px rgb(0 0 0 / 0.12), 0 2px 8px -2px rgb(0 0 0 / 0.08), 0 0 0 1px rgb(229 229 229 / 0.6);
  --focus-ring: 0 0 0 3px rgba(233, 1, 48, 0.12);
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-default);
}

.app-shell {
  background-color: #f9ecea;
  background-image:
    radial-gradient(55% 50% at 10% 90%, rgba(155, 0, 34, 0.18), transparent 65%),
    radial-gradient(50% 45% at 90% 10%, rgba(233, 1, 48, 0.14), transparent 65%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

a { color: var(--color-primary-500); }
a:hover { color: var(--color-primary-700); }
:focus-visible { outline: 2px solid var(--color-primary-500); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--surface-card); padding: 0.5rem 1rem; z-index: 10; }

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

/* Floating rounded header, as in the app (.nav-surface rounded-full) */
.site-header {
  position: sticky;
  top: 10px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: calc(100% - 20px);
  height: 56px;
  margin: 10px auto 0;
  padding: 0 1.25rem 0 1.5rem;
  background: var(--surface-card);
  border-radius: 9999px;
  box-shadow: var(--shadow-nav);
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.brand img { display: block; width: auto; }
.logo-hb { height: 34px; }
.logo-nw { height: 26px; }
.brand-label {
  font-size: 14px; font-weight: 700; color: var(--text-strong);
  border-left: 1px solid var(--border); padding-left: 0.75rem; line-height: 24px;
}
.site-header nav { display: flex; gap: 0.5rem; }
.nav-pill {
  display: inline-flex; align-items: center; gap: 0.25rem; height: 34px; padding: 0 0.875rem; white-space: nowrap;
  border: 1px solid #e5e7eb; border-radius: 9999px; background: var(--surface-card);
  color: #4b5563; font-size: 12px; font-weight: 500; text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.nav-pill:hover { border-color: var(--color-primary-500); background: var(--color-primary-50); color: var(--color-primary-700); }
.nav-pill[aria-current='page'] { background: var(--neutral-950); border-color: var(--neutral-950); color: #fff; }

main { max-width: 1240px; margin: 0 auto; padding: 1.75rem 1.5rem 1rem; }
.site-footer { text-align: center; color: var(--text-muted); font-size: 12px; padding: 2rem 1rem; }

h1 { font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; color: var(--text-strong); margin: 0 0 0.25rem; }
h2 { font-size: 18px; font-weight: 700; color: var(--text-strong); margin: 1.75rem 0 0.75rem; }
h4 { margin: 0; }

.page-head { margin-bottom: 1.25rem; }
.page-head p, .lead { color: var(--text-muted); margin: 0; }
.overline {
  margin: 0 0 0.25rem; font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
}
.muted { color: var(--text-muted); font-size: 12px; }

/* Toolbar: role filter pills (app pill-filter) + pill search (app .search-field) */
.toolbar { display: flex; flex-direction: column; gap: 1rem; }
.toolbar .page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: 0; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.375rem; height: 44px; padding: 0 1rem;
  border: 1px solid #e5e7eb; border-radius: 9999px; background: var(--surface-card);
  color: #4b5563; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.chip:hover { border-color: var(--color-primary-500); background: var(--color-primary-50); color: var(--color-primary-700); }
.chip[aria-pressed='true'] { border-color: var(--color-primary-500); background: var(--color-primary-50); color: var(--color-primary-700); }
.chip-divider { width: 1px; height: 20px; margin: 0 0.25rem; background: var(--border); }
.count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1rem; height: 1rem; padding: 0 0.375rem;
  border-radius: 9999px; background: rgba(0, 0, 0, 0.1); font-size: 10px; font-variant-numeric: tabular-nums;
}
.tag-soon {
  display: inline-flex; align-items: center; padding: 0.15rem 0.4rem; border-radius: 9999px;
  background: var(--color-primary-500); color: #fff; font-size: 9px; font-weight: 600; line-height: 1; vertical-align: middle;
}
.search { position: relative; display: inline-flex; align-items: center; width: 320px; max-width: 100%; }
.search svg { position: absolute; left: 0.875rem; color: var(--text-muted); pointer-events: none; }
.search input {
  width: 100%; height: 44px; padding: 0 1rem 0 2.5rem; border: 1px solid var(--border); border-radius: 9999px;
  background: rgba(255, 255, 255, 0.85); font: inherit; font-size: 14px; color: var(--text-default); outline: none;
  transition: border-color 150ms ease, background 150ms ease;
}
.search input:hover, .search input:focus { background: #fff; }
.search input:focus { border-color: var(--color-primary-500); box-shadow: var(--focus-ring); }
.search:focus-within svg { color: var(--color-primary-500); }

.filter-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin: 0.75rem 0 0; }
.filter-row:not(:has(> :not([hidden]))) { display: none; }
.check { display: flex; align-items: center; gap: 0.4rem; font-size: 13px; color: var(--text-muted); }
.hint { color: var(--text-muted); font-size: 13px; margin: 0; }
.tip { margin: 0.5rem 0 0; font-size: 12px; color: var(--text-muted); }
.tip strong { color: var(--text-default); }
.empty { color: var(--text-muted); text-align: center; padding: 2rem; }

/* Groups, as in the app's "Owned by you 3" section headers */
.scope-title { font-size: 18px; margin: 1.75rem 0 0.25rem; }
.area { margin-top: 1.25rem; }
.group-head {
  display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(224, 224, 224, 0.6); font-size: 14px; font-weight: 700; color: var(--text-strong);
}
.group-head .count { height: 1.25rem; min-width: 1.25rem; padding: 0 0.5rem; background: var(--surface-muted); color: var(--text-muted); font-size: 12px; font-weight: 500; }

/* Cards, as in the app's project-card */
.cards { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(280px, 360px)); }
.card {
  display: flex; flex-direction: column; padding: 1.25rem;
  background: var(--surface-glass-card); border: 1px solid var(--border-glass); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
}
.card:hover { transform: translateY(-4px); background: var(--surface-glass-card-hover); box-shadow: var(--shadow-card-hover); }
.card:target { box-shadow: var(--shadow-card), 0 0 0 3px var(--surface-brand-soft); }
.card-top { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.card-icon {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px;
  border-radius: 8px; background: rgba(17, 17, 17, 0.06); color: var(--text-strong);
}
.card-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1; }
.card-meta span { font-size: 11px; color: var(--text-muted); }
.card-meta strong { font-size: 12px; font-weight: 600; color: rgba(17, 17, 17, 0.8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title { font-size: 20px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.375rem; }
.card-title a { color: var(--text-strong); text-decoration: none; }
.card-title a:hover { color: var(--color-primary-500); }
.card-summary {
  margin: 0 0 0.75rem; min-height: 2.4em; color: var(--text-muted); font-size: 12px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin-top: auto; padding-top: 0.75rem; border-top: 1px solid rgba(224, 224, 224, 0.6);
}

/* Buttons, as in the app's nectarworks-secondary / nectarworks-outline */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; height: 40px; padding: 0 1.25rem;
  border: 2px solid transparent; border-radius: 9999px; font: inherit; font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.btn-sm { height: 32px; padding: 0 1rem; font-size: 12px; font-weight: 700; }
.btn-dark { background: var(--neutral-950); border-color: var(--neutral-950); color: #fff; }
.btn-dark:hover { background: var(--color-primary-500); border-color: var(--color-primary-500); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(233, 1, 48, 0.3); }
.btn-outline { background: var(--surface-card); border-color: #d4d4d4; color: var(--neutral-950); }
.btn-outline:hover { background: var(--neutral-950); border-color: var(--neutral-950); color: #fff; }
/* App's "nectarworks" primary button (e.g. New Project) */
.btn-brand { background: var(--color-primary-500); border-color: var(--color-primary-500); color: #fff; }
.btn-brand:hover { background: var(--neutral-950); border-color: var(--neutral-950); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); }
.app-link { margin: 1rem 0 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0;
  border: 0; border-radius: 9999px; background: transparent; color: var(--text-muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text-strong); }

/* Steps pop-up */
.dialog {
  width: min(560px, calc(100% - 2rem)); max-height: calc(100% - 4rem); padding: 0;
  border: 0; border-radius: var(--radius-card); background: var(--surface-card); color: var(--text-default);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
.dialog-inner { padding: 1.5rem 1.5rem 1.25rem; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dialog-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.dialog-summary { margin: 0.25rem 0 0.5rem; color: var(--text-muted); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }
.dialog-back { margin-right: auto; }

/* Relationships between capabilities (parent, before, next, related, includes) */
.relations { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem 1.25rem; margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid rgba(224, 224, 224, 0.6); }
.relation-group h3 { margin: 0 0 0.375rem; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.relation-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.relation {
  display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.75rem;
  border: 1px solid #e5e7eb; border-radius: 9999px; background: var(--surface-card);
  color: var(--text-default); font-size: 13px; font-weight: 500; text-decoration: none;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}
.relation:hover { border-color: var(--color-primary-500); background: var(--color-primary-50); color: var(--color-primary-700); }

/* Learning paths (MS Learn style): path cards, ordered modules, step navigation */
.paths, .group-head, .card, .scope-title { scroll-margin-top: 88px; }
.paths { margin-top: 0.5rem; }
.path-cards { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(280px, 360px)); margin-top: 0.75rem; }
.path-card {
  display: flex; flex-direction: column; padding: 1.25rem;
  background: var(--surface-glass-card); border: 1px solid var(--border-glass); border-left: 4px solid var(--color-primary-500);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.path-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }
.path-audience { margin: 0 0 0.75rem; font-size: 12px; color: var(--text-muted); }
.path-modules { list-style: none; counter-reset: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.module {
  display: flex; align-items: center; gap: 0.875rem; padding: 0.875rem 1rem;
  border: 1px solid rgba(224, 224, 224, 0.8); border-radius: 16px; background: var(--surface-card);
  color: var(--text-default); text-decoration: none; transition: border-color 150ms ease, background-color 150ms ease;
}
.module:hover { border-color: var(--color-primary-500); background: var(--color-primary-50); }
.module-num {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 2rem; height: 2rem;
  border-radius: 9999px; background: var(--neutral-950); color: #fff; font-size: 13px; font-weight: 700;
}
.module-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.module-body strong { color: var(--text-strong); font-size: 15px; }
.module-body span { color: var(--text-muted); font-size: 12px; }
.path-nav { display: flex; flex-direction: column; gap: 0.75rem; margin: 1.25rem 0 0; }
.path-nav-item { padding: 0.875rem 1rem; border-radius: 16px; background: var(--color-primary-50); }
.path-nav-item .overline { color: var(--color-primary-700); }
.path-nav-title { margin: 0 0 0.5rem; font-weight: 700; }
.path-nav-title a { color: var(--text-strong); text-decoration: none; }
.path-nav-title a:hover { color: var(--color-primary-500); }
.path-nav-buttons { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.path-step {
  display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.75rem; border-radius: 9999px;
  background: var(--surface-card); border: 1px solid #e5e7eb; color: var(--text-default); font-size: 13px; font-weight: 500; text-decoration: none;
}
.path-step:hover { border-color: var(--color-primary-500); color: var(--color-primary-700); }
.path-step.next { background: var(--neutral-950); border-color: var(--neutral-950); color: #fff; }
.path-step.next:hover { background: var(--color-primary-500); border-color: var(--color-primary-500); color: #fff; }

.panel {
  padding: 1.75rem; background: var(--surface-glass-card); border: 1px solid var(--border-glass);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card);
}

/* Numbered steps with brand-tinted counters */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0.75rem 0; }
.steps li { position: relative; counter-increment: step; padding: 0.15rem 0 0.15rem 2.25rem; margin: 0.6rem 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.1rem;
  display: flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem;
  border-radius: 9999px; background: var(--color-primary-50); color: var(--color-primary-700);
  font-size: 12px; font-weight: 700;
}
.steps strong, .note strong { color: var(--text-strong); }
.note {
  margin: 0.75rem 0;
  padding: 0.6rem 0.875rem;
  border-left: 3px solid var(--color-primary-500);
  background: var(--surface-brand-soft);
  border-radius: 0 12px 12px 0;
  color: var(--text-default);
}

.badge {
  display: inline-block;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
}
.badge.yes, .cell.yes { background: var(--yes-bg); color: var(--yes-fg); }
.badge.no, .cell.no { background: var(--no-bg); color: var(--no-fg); }
.badge.limited, .cell.limited { background: var(--limited-bg); color: var(--limited-fg); }
.badge.review, .cell.review { background: var(--review-bg); color: var(--review-fg); }

.breadcrumb { font-size: 13px; color: var(--text-muted); margin: 0 0 1rem; }
.breadcrumb a { color: var(--text-default); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-primary-500); }
.breadcrumb [aria-current] { color: var(--text-strong); font-weight: 600; }
.capability { max-width: 760px; }
.capability h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.access-table { border-collapse: collapse; min-width: 320px; }
.access-table th, .access-table td { text-align: left; padding: 0.5rem 1.5rem 0.5rem 0; border-bottom: 1px solid rgba(224, 224, 224, 0.6); }
.access-table th { font-weight: 500; }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; padding: 0; margin: 1rem 0; font-size: 12px; color: var(--text-muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-card); }
.matrix { border-collapse: collapse; width: 100%; font-size: 13px; }
.matrix th, .matrix td { padding: 0.5rem 0.75rem; border-bottom: 1px solid rgba(224, 224, 224, 0.6); text-align: left; }
.matrix thead th { position: sticky; top: 0; background: var(--surface-muted); font-size: 12px; }
.matrix tbody tr:hover { background: var(--color-primary-50); }
.matrix tbody th { font-weight: 500; }
.matrix tbody th a { color: var(--text-default); text-decoration: none; }
.matrix tbody th a:hover { color: var(--color-primary-500); }
.matrix .cell, .matrix tfoot td { text-align: center; }
.matrix tfoot { font-weight: 700; background: var(--surface-muted); }

/* Compact layout for a narrow help window docked beside the app */
@media (max-width: 720px) {
  main { padding: 1.25rem 0.875rem 1rem; }
  .site-header { height: 52px; padding: 0 0.75rem 0 1rem; }
  .brand .logo-hb { display: none; }
  /* The logo already links to the capabilities page. */
  .nav-pill--capabilities { display: none; }
  .nav-pill--paths { display: none; }
  .path-cards { grid-template-columns: 1fr; gap: 1rem; }
  .site-header nav { gap: 0.375rem; }
  .brand { gap: 0.5rem; }
  .brand-label { padding-left: 0.5rem; }
  .nav-pill { padding: 0 0.625rem; }
  .toolbar .page-head { flex-direction: column; align-items: stretch; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.25rem; scrollbar-width: thin; }
  .chip { flex-shrink: 0; height: 38px; padding: 0 0.875rem; }
  .search { width: 100%; }
  .cards { grid-template-columns: 1fr; gap: 1rem; }
  .panel { padding: 1.25rem; }
}

@media (max-width: 400px) {
  .brand-label { display: none; }
  .site-header { padding: 0 0.5rem 0 0.875rem; }
}
