/* ============================================================
   BeDeveloped — Base Layers
   Brand-neutral but premium. Works well for both internal
   consulting use and client-facing diagnostic sessions.
   ============================================================ */

:root {
  /* ---- BeDeveloped brand palette ---- */
  --brand:        #579EC0;   /* primary brand blue (from overview deck) */
  --brand-2:      #4A8AAB;   /* darker hover */
  --brand-3:      #6FB0D0;   /* lighter */
  --brand-tint:   #EAF3F8;   /* pale blue tint */
  --brand-ink:    #2F4F5E;   /* deep navy-grey */
  --accent:       #ED7D31;   /* warm accent from deck */
  --accent-2:     #D86A20;

  --ink:     #2F2F2F;   /* matches wordmark */
  --ink-2:   #4A4A4A;
  --ink-3:   #6F7279;
  --ink-4:   #9AA0A8;

  --bg:           #1F2327;   /* top bar / dark surfaces */
  --bg-1:         #272C31;
  --bg-2:         #30363C;
  --surface:      #ffffff;
  --surface-muted:#F5F6F7;

  --line:   #E3E5E8;
  --line-2: #CFD3D8;

  --red:    #C0392B;
  --amber:  #D98E00;
  --green:  #2F8A4F;

  --red-bg:   #FBEAE7;
  --amber-bg: #FBF2DC;
  --green-bg: #E4F3EA;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);

  /* Body: Aptos Light (shipped with Microsoft 365 on user machines) — falls back gracefully */
  --font-sans:    "Aptos Light", "Aptos", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  /* Headings: Bebas Neue (Google Fonts) */
  --font-display: "Bebas Neue", "Aptos Display", "Impact", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface-muted);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

/* Every form control, button, tab, input and textarea uses the app font */
input,
textarea,
select,
button,
optgroup,
option {
  font-family: var(--font-sans);
  font-size: inherit;
  color: inherit;
}

/* Placeholders too */
::placeholder { font-family: var(--font-sans); opacity: 0.7; }

/* ------------------- Top bar ------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 10px 24px;
  background: #ffffff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(16,24,40,0.02);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.brand-logo {
  height: 38px;
  width: auto;
  display: block;
}
.brand-sub {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border: 1px solid rgba(87,158,192,0.25);
}

.topnav {
  display: flex;
  gap: 2px;
  justify-self: center;
  background: var(--surface-muted);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.nav-btn {
  position: relative;
  background: transparent;
  border: 0;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-btn:hover { color: var(--ink); background: #fff; }
.nav-btn.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 3px rgba(87,158,192,0.4);
}
.nav-btn .dot {
  position: absolute;
  top: 4px; right: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--surface-muted);
}
.nav-btn.active .dot { box-shadow: 0 0 0 2px var(--brand); }

.topright {
  display: flex;
  align-items: center;
  gap: 10px;
}
#orgSelect {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  min-width: 180px;
  cursor: pointer;
}
#orgSelect:hover { border-color: var(--brand); }

/* ------------------- Mode toggle ------------------- */
.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}
.mode-toggle input { display: none; }
.mode-toggle .switch {
  position: relative;
  width: 32px;
  height: 18px;
  background: var(--line-2);
  border-radius: 999px;
  transition: background .15s;
}
.mode-toggle .switch::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 999px;
  background: #fff;
  top: 2px; left: 2px;
  transition: transform .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.mode-toggle input:checked + .switch {
  background: var(--brand);
}
.mode-toggle input:checked + .switch::after {
  transform: translateX(14px);
}

/* ------------------- User chip (in topbar) ------------------- */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  cursor: pointer;
  position: relative;
}
.user-chip:hover { border-color: var(--brand); }
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.5px;
}
.avatar.internal { background: var(--brand-ink); }
.user-chip .who {
  font-size: 12.5px;
  line-height: 1;
}
.user-chip .who .name { font-weight: 600; color: var(--ink); }
.user-chip .who .role {
  font-size: 10.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.user-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  min-width: 220px;
  padding: 6px;
  z-index: 100;
}
.user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink);
}
.user-menu button:hover { background: var(--surface-muted); }
.user-menu .divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

/* ------------------- Main layout ------------------- */
main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

h1, h2, .view-title {
  font-family: var(--font-display);
  font-weight: 400;           /* Bebas Neue only has one weight */
  letter-spacing: 0.02em;      /* give Bebas Neue a touch of tracking */
}
.view-title {
  font-size: 40px;
  line-height: 1.05;
  margin: 0 0 4px;
  color: var(--ink);
}
.view-sub {
  color: var(--ink-3);
  margin: 0 0 24px;
  font-size: 15px;
}

h2 {
  font-size: 26px;
  margin: 28px 0 10px;
  line-height: 1.1;
  color: var(--ink);
}
h3 {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin: 24px 0 10px;
  font-weight: 400;
}

p { margin: 0 0 12px; }

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------- Buttons ------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 500;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--brand-2); }
.btn.ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.14);
  color: #c7cbd6;
}
.topbar .btn.ghost:hover { background: rgba(255,255,255,0.06); color: #fff; }

.footer .btn.ghost {
  border-color: var(--line-2);
  color: var(--ink-2);
}
.footer .btn.ghost:hover {
  background: var(--surface);
}
.btn.ghost.danger { color: var(--red); }
.btn.ghost.danger:hover { background: var(--red-bg); border-color: var(--red); }

.btn.secondary {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--ink);
}
.btn.secondary:hover { background: var(--surface-muted); }

.btn.sm { padding: 5px 10px; font-size: 12px; }

/* ------------------- Dashboard ------------------- */
.dash-top {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card h3 {
  margin-top: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 14px;
}

.chart-wrap {
  position: relative;
  height: 380px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.summary-cell {
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.summary-cell .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.summary-cell .value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  margin-top: 4px;
}
.summary-cell.red .value    { color: var(--red); }
.summary-cell.amber .value  { color: var(--amber); }
.summary-cell.green .value  { color: var(--green); }

.top-constraints {
  margin-top: 16px;
}
.top-constraints ol {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
}
.top-constraints li { margin-bottom: 6px; }

/* Pillar tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: transform .1s, border-color .1s, box-shadow .15s;
  position: relative;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 160px;
}
.tile:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-2);
}
.tile .num {
  font-family: var(--font-display);
  color: var(--brand);
  font-size: 13px;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
}
.tile.opex .num {
  color: var(--accent);
}
.tile .name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-bottom: 6px;
  color: var(--ink);
}
.tile .tag {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.45;
  flex: 1;
}
.tile .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-3);
}
.tile .score {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--ink);
}
.tile .tile-caret {
  color: var(--ink-4);
  font-size: 12px;
  transition: transform .18s ease;
  display: inline-block;
}
.tile.expanded .tile-caret { transform: rotate(180deg); color: var(--brand); }
.tile.expanded {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(87,158,192,0.12), var(--shadow-sm);
}
.tile.expanded:hover {
  box-shadow: 0 0 0 2px rgba(87,158,192,0.18), var(--shadow-md);
}

.tile-expansion {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  animation: exp-in 0.18s ease-out;
  cursor: default;
}
@keyframes exp-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0);  }
}
.tile-expansion .exp-desc {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0 0 12px;
}
.tile-expansion .exp-achieve {
  background: var(--brand-tint);
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
}
.tile-expansion .exp-achieve-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--brand);
  letter-spacing: 0.12em;
  font-size: 13px;
  margin-bottom: 4px;
}
.tile-expansion .exp-desc,
.tile-expansion .exp-achieve {
  font-family: var(--font-sans);
}
.tile-expansion .exp-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

/* ===== Operational Excellence tile (performance layer, non-scored) ===== */
.tile.opex {
  grid-column: span 2;
  background: var(--surface);          /* white, matches other tiles */
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}
.opex-pill {
  display: inline-block;
  background: var(--brand);
  color: #ffffff;
  font-family: var(--font-display);     /* Bebas Neue for the label */
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 4px;
  width: fit-content;
}
.opex-lede {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 14px;
  max-width: 760px;
}
.opex-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
}
.opex-list li {
  position: relative;
  padding-left: 22px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.45;
}
.opex-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

@media (max-width: 1100px) {
  .opex-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .tile.opex { grid-column: span 1; }
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge.red    { background: var(--red-bg);    color: var(--red); }
.badge.amber  { background: var(--amber-bg);  color: var(--amber); }
.badge.green  { background: var(--green-bg);  color: var(--green); }
.badge.gray   { background: #eef0f5;           color: var(--ink-3); }

/* ------------------- Pillar detail ------------------- */
.pillar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 20px;
}
.pillar-header .back {
  background: transparent;
  border: 0;
  color: var(--ink-3);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 10px;
}
.pillar-header .back:hover { color: var(--ink); }

.pillar-pill {
  font-family: var(--font-display);
  color: var(--ink-4);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.pillar-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

.q-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.q-card .q-text {
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 12px;
}
.likert {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.likert button {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 6px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink-2);
  text-align: center;
  transition: all .12s;
}
.likert button .n {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.likert button .t {
  display: block;
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 4px;
  line-height: 1.25;
}
.likert button:hover { border-color: var(--brand); }
.likert button.sel {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.likert button.sel .n,
.likert button.sel .t { color: #fff; }

.note {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
  background: var(--surface-muted);
}
.note:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
}
.internal-note {
  border-left: 3px solid var(--accent);
  background: #fff7f2;
}
.internal-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

/* Sidebar panels */
.side-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.side-panel h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.1em;
  color: var(--ink);
}
.side-panel ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.side-panel li { margin-bottom: 5px; font-size: 13.5px; }

.score-block {
  text-align: center;
  padding: 20px 16px;
}
.score-block .big {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 600;
  line-height: 1;
}
.score-block .out {
  color: var(--ink-3);
  font-size: 14px;
  margin-left: 4px;
}
.score-block .bar {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  margin: 14px 0 10px;
  overflow: hidden;
}
.score-block .bar > span {
  display: block;
  height: 100%;
  background: var(--brand);
  transition: width .4s ease;
}

/* ------------------- Actions ------------------- */
.action-row {
  display: grid;
  grid-template-columns: auto 1.5fr 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.action-row:first-child {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--surface-muted);
}
.action-row input[type=text],
.action-row input[type=date],
.action-row select {
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  width: 100%;
}
.action-row input[type=checkbox] {
  width: 18px; height: 18px; cursor: pointer;
}
.action-row.done .a-title { text-decoration: line-through; color: var(--ink-4); }

.actions-table {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--ink-3);
  background: var(--surface);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}

/* ------------------- Engagement ------------------- */
.stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stage-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  position: relative;
  transition: border-color .1s, box-shadow .12s;
  box-shadow: var(--shadow-sm);
}
.stage-card:hover { border-color: var(--line-2); }
.stage-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(31,58,166,0.15), var(--shadow-sm);
}
.stage-card .n {
  font-family: var(--font-display);
  color: var(--ink-4);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.stage-card .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  margin: 4px 0 8px;
}
.stage-card .sum {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.45;
}
.stage-card .progress {
  margin-top: 12px;
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.stage-card .progress > span {
  display: block; height: 100%;
  background: var(--brand);
  transition: width .3s;
}

.checklist {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.check-item:last-child { border-bottom: 0; }
.check-item input { width: 18px; height: 18px; }
.check-item label { cursor: pointer; flex: 1; }
.check-item.done label { text-decoration: line-through; color: var(--ink-4); }

/* ------------------- Report ------------------- */
.report {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
  max-width: 900px;
  margin: 0 auto;
}
.report h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 42px;
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}
.report .sub {
  color: var(--ink-3);
  margin-bottom: 28px;
}
.report .row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.report .row .label {
  color: var(--ink-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.report .r-pillars {
  margin-top: 28px;
}
.report .r-pillar {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.report .r-pillar:first-child { border-top: 0; }
.report .r-pillar header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.report .r-pillar .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
}
.report .r-pillar .meta {
  color: var(--ink-3);
  font-size: 12px;
}
.report .r-pillar p { color: var(--ink-2); font-size: 14px; margin-bottom: 6px; }
.report .r-notes {
  background: var(--surface-muted);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-2);
}
.report-toolbar {
  max-width: 900px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ------------------- Modal ------------------- */
.modal-root {
  position: fixed;
  inset: 0;
  background: rgba(14, 17, 22, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-root.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-md);
}
.modal h3 {
  margin-top: 0;
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 18px;
  text-transform: none;
  letter-spacing: 0;
}
.modal .row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.modal input[type=text] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
}
.modal ul {
  list-style: none; padding: 0; margin: 0;
  max-height: 280px; overflow-y: auto;
}
.modal ul li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ------------------- Footer ------------------- */
.footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink-3);
  font-size: 12px;
}
.footer-actions { display: flex; gap: 6px; }

/* ------------------- Print / export ------------------- */
@media print {
  .topbar, .footer, .report-toolbar, nav, button { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .report { box-shadow: none; border: 0; padding: 0; max-width: none; }
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
}
.auth-hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 60%, var(--brand-ink) 100%);
  color: #fff;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.12), transparent 50%),
              radial-gradient(circle at 10% 90%, rgba(237,125,49,0.18), transparent 45%);
  pointer-events: none;
}
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero .hero-logo {
  width: 220px;
  height: auto;
  max-width: 60%;
  display: block;
  align-self: flex-start;
  filter: brightness(0) invert(0.28);
  opacity: 1;
}
.auth-hero .hero-accent {
  border: 0;
  height: 3px;
  width: 440px;
  max-width: 80%;
  background: var(--accent);
  margin: 32px 0 0;
  align-self: flex-start;
  border-radius: 2px;
}
.auth-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: 0.03em;
  margin: 0 0 18px;
}
.auth-heading {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
}
.auth-hero .lede {
  font-size: 18px;
  opacity: 0.9;
  max-width: 420px;
  line-height: 1.5;
}
.auth-hero .quote {
  font-size: 13px;
  opacity: 0.7;
  max-width: 440px;
  font-style: italic;
}

.auth-form {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 28px;
}
.auth-tabs button {
  background: transparent;
  border: 0;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s;
}
.auth-tabs button:hover { color: var(--ink); }
.auth-tabs button.active {
  background: #fff;
  color: var(--brand-ink);
  box-shadow: var(--shadow-sm);
}
.auth-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.04em;
  color: #474747;
  margin: 0 0 6px;
}
.auth-sub {
  color: var(--ink-3);
  margin-bottom: 24px;
  font-size: 14px;
}
.auth-field {
  margin-bottom: 14px;
}
.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.auth-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(87,158,192,0.18);
}
.auth-submit {
  width: 100%;
  padding: 12px;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background .12s;
}
.auth-submit:hover { background: var(--brand-2); }
.auth-error {
  color: var(--red);
  font-size: 13px;
  margin: 8px 0;
  padding: 8px 12px;
  background: var(--red-bg);
  border-radius: 6px;
}
.auth-help {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.6;
}
.auth-help code {
  background: var(--surface-muted);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.auth-help a { color: var(--brand); cursor: pointer; }

/* ============================================================
   ROUND SELECTOR / PROGRESS
   ============================================================ */
.round-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px 10px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.round-bar .round-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
}
.round-bar .round-pill {
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(87,158,192,0.2);
}
.round-bar .round-meta {
  color: var(--ink-3);
  font-size: 12px;
}
.round-bar-actions {
  display: flex;
  gap: 8px;
}

.delta-up   { color: var(--green); font-weight: 600; }
.delta-down { color: var(--red);   font-weight: 600; }
.delta-same { color: var(--ink-4); font-weight: 600; }

.respondents-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--ink-3);
  margin-left: 8px;
}

/* ============================================================
   COMMENTS (Slack-style)
   ============================================================ */
.comments {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-top: 20px;
}
.comments h3 {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 14px 0;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}
.comment {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 4px 0;
}
.comment.unread {
  background: linear-gradient(90deg, rgba(237,125,49,0.07), transparent 60%);
  border-left: 2px solid var(--accent);
  padding-left: 8px;
  margin-left: -10px;
  border-radius: 4px;
}
.comment .body { font-size: 13.5px; color: var(--ink); line-height: 1.5; white-space: pre-wrap; }
.comment .head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.comment .head .name { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.comment .head .when { color: var(--ink-4); font-size: 11.5px; }
.comment .head .tag-internal {
  background: var(--brand-tint);
  color: var(--brand);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.comment-composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.comment-composer textarea {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13.5px;
  resize: vertical;
  min-height: 46px;
  max-height: 180px;
  background: var(--surface-muted);
}
.comment-composer textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(87,158,192,0.15);
}
.comment-composer .opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.comment-composer .opts label {
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  gap: 4px;
  align-items: center;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}

/* ============================================================
   RESPONDENT PRESENCE INDICATORS
   ============================================================ */
.respondent-stack {
  display: inline-flex;
  align-items: center;
  gap: -6px;
}
.respondent-stack .avatar {
  width: 22px;
  height: 22px;
  font-size: 9px;
  border: 2px solid #fff;
  margin-left: -6px;
  box-shadow: 0 0 0 1px var(--line);
}
.respondent-stack .avatar:first-child { margin-left: 0; }

/* ------------------- Print / export ------------------- */
@media print {
  .topbar, .footer, .report-toolbar, nav, button, .comments, .round-bar-actions {
    display: none !important;
  }
  body { background: #fff; }
  main { padding: 0; }
  .report { box-shadow: none; border: 0; padding: 0; max-width: none; }
}

/* ------------------- Responsive ------------------- */
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr; gap: 10px; }
  .topnav { justify-self: stretch; overflow-x: auto; }
  .topright { flex-wrap: wrap; }
  .dash-top { grid-template-columns: 1fr; }
  .pillar-grid { grid-template-columns: 1fr; }
  .stages { grid-template-columns: repeat(2, 1fr); }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .action-row { grid-template-columns: auto 1fr 1fr auto; }
  .action-row .a-owner, .action-row .a-due { grid-column: span 1; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
