/* Capability Framework — visual language ported from
   deploy/source/Capability Framework.dc.html (inline styles -> classes). */

:root {
  --ink: #0A0F1C;
  --bg: #F5F5F5;
  --muted: #5A6478;
  --body-text: #1c2536;
  --border: #E4E7EE;
  --border-soft: #EEF0F4;
  --accent: #0048AA;
  --accent-teal: #00C7AF;

  --level-0: #00C7AF; /* Foundation */
  --level-1: #00A2A9; /* Proficient */
  --level-2: #0074AE; /* Advanced */
  --level-3: #0048AA; /* Expert */

  --badge-required-bg: #0A0F1C;
  --badge-required-fg: #fff;
  --badge-req-stretch-bg: rgba(0, 72, 170, 0.10);
  --badge-req-stretch-fg: #0048AA;
  --badge-req-stretch-border: rgba(0, 72, 170, 0.25);
  --badge-to-stretch-bg: rgba(255, 187, 59, 0.2);
  --badge-to-stretch-fg: #8a5a00;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Figtree', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-teal); }

button { font-family: inherit; }

img { max-width: 100%; }

/* ---------- Header ---------- */

.cap-header {
  background: var(--ink);
  color: #fff;
  padding: 40px 48px 36px;
}

.cap-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: flex-end;
  justify-content: space-between;
}

.cap-header-topbar {
  max-width: 1320px;
  margin: 0 auto 20px;
  display: flex;
  justify-content: flex-end;
}

.cap-header-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cap-header-user-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.cap-signout-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.cap-signout-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cap-header-intro {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cap-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cap-header-logo-box {
  background: #fff;
  border-radius: 10px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
}

.cap-header-logo-box img {
  height: 22px;
  width: auto;
  display: block;
}

.cap-header-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.cap-header-title {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0;
}

.cap-header-desc {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
}

.cap-header-stats {
  display: flex;
  gap: 32px;
  padding-bottom: 6px;
}

.cap-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cap-stat-num {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cap-stat-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- Family tab bar / view switch ---------- */

.cap-tabbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.cap-tabbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cap-family-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.cap-tab {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  padding: 18px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.cap-tab:hover { opacity: 0.85; }

.cap-tab.is-active {
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.cap-view-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--bg);
  border-radius: 999px;
}

.cap-view-tab {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
}

.cap-view-tab.is-active {
  background: var(--ink);
  color: #fff;
}

/* ---------- Shell / grid ---------- */

.cap-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 36px 48px 80px;
}

.cap-grid {
  display: grid;
  grid-template-columns: 268px 1fr;
  gap: 36px;
  align-items: start;
}

/* ---------- Sidebar ---------- */

.cap-side {
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 84px;
}

.cap-side-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cap-side-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.cap-role-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cap-role-tab {
  font-family: inherit;
  text-align: left;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1.3;
  background: #fff;
  color: #1c2536;
  border: 1px solid var(--border);
}

.cap-role-tab.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* Progress panel */

.cap-progress-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cap-progress-num {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.cap-progress-of {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.cap-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
}

.cap-progress-bar-fill {
  height: 100%;
  background: linear-gradient(45deg, #00C7AF, #0048AA);
}

.cap-progress-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.cap-progress-reset {
  align-self: flex-start;
  background: transparent;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

/* Legend */

.cap-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cap-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: none;
}

.cap-legend-name {
  font-size: 13px;
  font-weight: 600;
  color: #1c2536;
}

.cap-legend-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 2px 0;
}

.cap-legend-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cap-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cap-legend-desc {
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Expectation badges ---------- */

.badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-required {
  background: var(--badge-required-bg);
  color: var(--badge-required-fg);
}

.badge-required-stretch {
  background: var(--badge-req-stretch-bg);
  color: var(--badge-req-stretch-fg);
  border: 1px solid var(--badge-req-stretch-border);
}

.badge-to-stretch {
  background: var(--badge-to-stretch-bg);
  color: var(--badge-to-stretch-fg);
}

/* ---------- Inline error banner ---------- */

.cap-error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #FDECEC;
  border: 1px solid #F5B5B5;
  color: #8a1f1f;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
}

.cap-error-dismiss {
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 800;
  color: #8a1f1f;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

/* ---------- Role header card ---------- */

.cap-role-header {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
}

.cap-role-intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 560px;
}

.cap-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-teal);
}

.cap-role-title {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.cap-role-summary {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

/* Next steps */

.cap-next {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
  border-radius: 14px;
  padding: 16px 18px;
  min-width: 240px;
}

.cap-next-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.cap-next-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.cap-next-btn:hover { border-color: var(--accent-teal); }

.cap-next-arrow {
  color: var(--accent-teal);
  font-weight: 800;
}

/* ---------- Capability cards ---------- */

.cap-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.cap-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 26px 30px 22px;
  border-bottom: 1px solid var(--border-soft);
}

.cap-card-title-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  max-width: 660px;
}

.cap-card-num {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.cap-card-num-0 { background: var(--level-0); }
.cap-card-num-1 { background: var(--level-1); }
.cap-card-num-2 { background: var(--level-2); }
.cap-card-num-3 { background: var(--level-3); }

.cap-card-title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.cap-card-summary {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}

.cap-rate {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.cap-rate-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.cap-rate-options {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border-radius: 999px;
}

.cap-rate-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  width: 30px;
  height: 28px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
}

.cap-rate-btn.is-active {
  background: var(--accent);
  color: #fff;
}

/* Level rows */

.cap-row {
  display: grid;
  grid-template-columns: 172px 1fr;
  gap: 26px;
  padding: 22px 30px;
  border-top: 1px solid #F5F5F5;
}

.cap-row.is-mine {
  background: rgba(0, 72, 170, 0.035);
}

.cap-row.is-stretch {
  background: #FCFCFD;
}

.cap-level-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cap-level-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cap-level-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: none;
}

.cap-level-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.cap-you-are-here {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.cap-you-are-here-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.cap-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cap-bullet {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--body-text);
}

.cap-bullet-tick {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  margin-top: 8px;
}

/* ---------- Compare view ---------- */

.cap-compare-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cap-compare-heading {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.cap-compare-note {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 720px;
}

.cap-compare-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
}

.cap-compare-picker {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cap-compare-select {
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  min-width: 280px;
}

.cap-compare-arrow {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-teal);
  padding-bottom: 10px;
}

.cap-compare-row-head {
  padding: 22px 30px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  gap: 14px;
  align-items: center;
}

.cap-compare-row-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cap-compare-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.cap-compare-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 26px;
}

.cap-compare-side.is-today {
  border-right: 1px solid var(--border-soft);
}

.cap-compare-side.is-target {
  background: rgba(0, 199, 175, 0.04);
}

.cap-compare-side-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.cap-compare-role-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.cap-tag {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg);
  color: var(--muted);
}

.cap-tag.is-target {
  background: rgba(0, 199, 175, 0.15);
  color: #007a6c;
}

.cap-compare-level {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--bg);
}

.cap-compare-level-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cap-compare-bullet {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}

.cap-compare-bullet-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  margin-top: 7px;
  background: #C9CFDB;
}

/* ---------- Map view (all roles) ---------- */

.cap-map-intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 720px;
}

.cap-map-title {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.cap-map-note {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.cap-map-family {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cap-map-family-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cap-map-family-name {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.cap-map-family-rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.cap-map-family-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.cap-map-roles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.cap-map-role-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
}

.cap-map-role-card:hover { border-color: var(--accent-teal); }

.cap-map-role-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.25;
}

.cap-map-role-next {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Print ---------- */

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .cap-shell { max-width: none !important; padding: 0 !important; }
  .cap-side { position: static !important; }
  .cap-grid { display: block !important; }
  .cap-card, .cap-row, .cap-side > div { break-inside: avoid; page-break-inside: avoid; }
  .cap-card { border-radius: 0 !important; border-left: none !important; border-right: none !important; margin-bottom: 18px; }
}
