:root {
  --navy: #002650;
  --blue-600: #0052cc;
  --blue-500: #0066ff;
  --blue-400: #3385ff;
  --blue-300: #66a3ff;
  --blue-200: #99c2ff;
  --blue-100: #cce0ff;
  --blue-50: #e6f0ff;
  --green-600: #1a9e19;
  --green-500: #25c023;
  --green-400: #4dd34b;
  --green-100: #d4f5d0;
  --green-50: #f0fdf0;
  --orange-600: #c5650a;
  --orange-500: #e5780b;
  --orange-400: #f59e3f;
  --orange-100: #fde8cc;
  --orange-50: #fff7ed;
  --red-600: #d42f15;
  --red-500: #fa3b1d;
  --red-400: #ff6b52;
  --red-100: #fdd;
  --red-50: #fff5f5;
  --pink: #ff4ad3;
  --g9: #1a1a2e;
  --g8: #2d2d44;
  --g7: #4a4a65;
  --g6: #6b6b85;
  --g5: #9198a6;
  --g4: #b0b7c3;
  --g3: #d1d5db;
  --g2: #e5e7eb;
  --g1: #f3f4f6;
  --g0: #f9fafb;
  --w: #fff;
  --purple: #8b5cf6;
  --teal: #14b8a6;
  --sb-c: 64px;
  --sb-e: 280px;
  --content-max: 960px;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--g0);
  color: var(--g9);
  overflow-x: hidden;
  line-height: 1.55
}

/* SIDEBAR */
.sb {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sb-c);
  background: var(--navy);
  z-index: 100;
  transition: width .3s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column
}

.sb:hover {
  width: var(--sb-e)
}

.sb-logo {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0
}

.sb-logo .ico {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--blue-500), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}
.sb-logo .ico img {
  width: 100%;
  height: 100%;
  object-fit: contain
}

.sb-logo .txt {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .3s
}

.sb:hover .txt {
  opacity: 1
}

.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0
}

.si {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  color: rgba(255, 255, 255, .5);
  transition: all .2s;
  position: relative;
  white-space: nowrap
}

.si:hover {
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .85)
}

.si.on {
  color: #fff;
  background: rgba(255, 255, 255, .1)
}

.si.on::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 3px;
  background: var(--blue-400);
  border-radius: 0 3px 3px 0
}

.si .ic {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0
}

.si .lb {
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .3s;
  flex: 1
}

.sb:hover .lb {
  opacity: 1
}

.si .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .3s
}

.si .dot.unr {
  background: var(--orange-400)
}

.si .dot.rev {
  background: var(--green-400)
}

.sb:hover .dot {
  opacity: 1
}

.si .arr {
  font-size: 9px;
  margin-left: auto;
  opacity: 0;
  transition: all .3s;
  color: rgba(255, 255, 255, .4)
}

.sb:hover .arr {
  opacity: 1
}

.arr.open {
  transform: rotate(180deg)
}

.si-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s
}

.si-sub.open {
  max-height: 500px
}

.si-sub .si {
  padding: 6px 16px 6px 48px;
  font-size: 11px
}

.si-sub .si .ic {
  width: 18px;
  height: 18px;
  font-size: 10px
}

.si-sub .si .lb {
  font-size: 11px
}

.si.nest {
  padding-left: 18px
}

.s-sec {
  padding: 10px 16px 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, .25);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .3s
}

.sb:hover .s-sec {
  opacity: 1
}

/* MAIN */
.mn {
  margin-left: var(--sb-c);
  min-height: 100vh
}

.pg {
  display: none
}

.pg.on {
  display: block;
  animation: fadeIn .3s ease
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px)
  }
  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: all .5s ease
}

.reveal.shown {
  opacity: 1;
  transform: translateY(0)
}

.show-results-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 28px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .3s ease;
  background: var(--g5);
  color: #fff;
}
.show-results-btn:disabled {
  opacity: .7;
  cursor: default;
}
.show-results-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}
.sr-spinner {
  display: inline-flex;
}
.show-results-btn.ready .sr-spinner {
  display: none;
}

.topbar {
  padding: 10px 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--g5);
  background: var(--w);
  border-bottom: 1px solid var(--g2);
  position: sticky;
  top: 0;
  z-index: 50
}

.topbar a {
  color: var(--blue-500);
  text-decoration: none;
  cursor: pointer
}

.topbar .sep {
  color: var(--g3);
  font-size: 9px
}

.reset-btn {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 14px;
  background: var(--g1);
  border: 1px solid var(--g3);
  color: var(--g6);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit
}

.gr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border-radius: 10px;
  border: 3px solid;
  line-height: 1
}

.gr.xl {
  width: 56px;
  height: 56px;
  font-size: 26px;
  border-radius: 14px
}

.gr.lg {
  width: 44px;
  height: 44px;
  font-size: 20px
}

.gr-A, .gr-B {
  background: var(--green-100);
  color: var(--green-600);
  border-color: var(--green-400)
}

.gr-C {
  background: var(--orange-50);
  color: var(--orange-600);
  border-color: var(--orange-400)
}

.gr-D {
  background: var(--red-50);
  color: var(--red-600);
  border-color: var(--red-400)
}

.gr-F {
  background: var(--red-100);
  color: var(--red-600);
  border-color: var(--red-500)
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600
}

.chip.fail {
  background: var(--red-50);
  color: var(--red-600)
}

.chip.pass {
  background: var(--green-50);
  color: var(--green-600)
}

.chip.skip {
  background: var(--g1);
  color: var(--g6)
}

.pri {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  min-width: 62px;
  text-align: center;
  display: inline-block
}

.pri-c {
  background: var(--red-100);
  color: var(--red-600)
}

.pri-h {
  background: var(--orange-100);
  color: var(--orange-600)
}

.pri-m {
  background: var(--blue-100);
  color: var(--blue-600)
}

.pri-l {
  background: var(--g1);
  color: var(--g6)
}

.ct {
  padding: 0 40px 40px;
  max-width: calc(var(--content-max) + 80px);
  margin: 0 auto
}

/* Overlook inline */
.mi {
  background: var(--w);
  border: 1px solid var(--g2);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  margin: 16px 0
}

.mav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}
.mav img {
  width: 75%;
  height: 75%;
  object-fit: contain;
  border-radius: 50%;
}

.mname {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px
}

.mname .ai {
  font-size: 9px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--blue-500), var(--purple));
  color: #fff;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: .5px
}

.mt {
  font-size: 13px;
  color: var(--g7);
  line-height: 1.65
}

.mt p {
  margin-bottom: 6px
}

.mt strong {
  color: var(--navy)
}

.mt .hl {
  color: var(--blue-500);
  font-weight: 600
}

/* Category list */
.cat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px
}

.cc {
  background: var(--w);
  border: 1px solid var(--g2);
  border-radius: 10px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 16px
}

.cc:hover {
  border-color: var(--blue-300);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  transform: translateY(-1px)
}

.cc .cc-info {
  flex: 1
}

.cc .cc-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy)
}

.cc .cc-q {
  font-size: 12px;
  color: var(--g6);
  margin-top: 1px;
  font-style: italic
}

.cc .cc-highlights {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-size: 11.5px;
  color: var(--g6);
  line-height: 1.6;
}
.cc .cc-highlights li::before {
  content: "\2022";
  color: var(--g4);
  margin-right: 6px;
}

.cc .cc-stats {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0
}

.cc .cc-counts {
  display: flex;
  gap: 8px;
  font-size: 11px;
  font-weight: 600
}

.rv-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px
}

.rv-badge.unr {
  background: var(--orange-100);
  color: var(--orange-600)
}

.rv-badge.rev {
  background: var(--green-100);
  color: var(--green-600)
}

.cc .cc-arrow {
  color: var(--g4);
  font-size: 12px
}

/* Issue list */
.il {
  margin-top: 16px
}

.ii {
  background: var(--w);
  border: 1px solid var(--g2);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all .2s
}

.ii:hover {
  border-color: var(--blue-300);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .05)
}

.idot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0
}

.idot.fail {
  background: var(--red-50);
  color: var(--red-500)
}

.idot.pass {
  background: var(--green-50);
  color: var(--green-500)
}

.iinfo {
  flex: 1
}

.iname {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy)
}

.isub {
  font-size: 11px;
  color: var(--g5);
  margin-top: 1px
}

.ie {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-shrink: 0
}

.icta {
  padding: 7px 16px;
  border-radius: 8px;
  background: var(--purple);
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 110px
}

.icta:hover {
  background: #7c3aed;
  box-shadow: 0 3px 10px rgba(139, 92, 246, .35);
  transform: translateY(-1px)
}

.show-btn {
  background: none;
  border: 1px solid var(--g3);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--g6);
  cursor: pointer;
  margin-top: 8px;
  width: 100%
}

/* Impact card */
.impact {
  border-radius: 8px;
  padding: 16px 18px;
  margin: 16px 0;
  display: flex;
  align-items: flex-start;
  gap: 14px
}

.impact.red {
  background: var(--red-50);
  border: 1px solid rgba(250, 59, 29, .12)
}

.impact.orange {
  background: var(--orange-50);
  border: 1px solid rgba(229, 120, 11, .12)
}

.impact .imp-i {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0
}

.impact.red .imp-i {
  background: var(--red-100);
  color: var(--red-500)
}

.impact.orange .imp-i {
  background: var(--orange-100);
  color: var(--orange-600)
}

.impact h4 {
  font-size: 13px;
  font-weight: 700
}

.impact.red h4 {
  color: var(--red-600)
}

.impact.orange h4 {
  color: var(--orange-600)
}

.impact p {
  font-size: 12px;
  color: var(--g7);
  margin-top: 2px
}

/* Data tables — clickable data points */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 16px 0
}

.data-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--g5);
  font-weight: 600;
  border-bottom: 2px solid var(--g2);
  font-size: 11px
}

.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--g1);
  cursor: pointer;
  transition: background .15s
}

.data-table td:hover {
  background: var(--blue-50)
}

.data-table td.selected {
  background: var(--blue-100);
  outline: 2px solid var(--blue-400);
  outline-offset: -2px;
  border-radius: 4px
}

.data-table .val {
  text-align: right;
  font-weight: 600
}

.data-table .bad {
  color: var(--red-500)
}

.data-table .warn {
  color: var(--orange-500)
}

.data-table .good {
  color: var(--green-600)
}

.pbar {
  height: 6px;
  background: var(--g1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px
}

.pbar .fill {
  height: 100%;
  border-radius: 3px
}

/* Followup chips */
.followups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px
}

.followup {
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
  color: var(--blue-600);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  line-height: 1.3
}

.followup:hover {
  background: var(--blue-100);
  border-color: var(--blue-400)
}

.fix-btn {
  background: linear-gradient(135deg, var(--green-500), var(--teal));
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
  box-shadow: 0 3px 10px rgba(37, 192, 35, .25)
}

.fix-btn:hover {
  transform: translateY(-1px)
}

.xc {
  background: linear-gradient(135deg, var(--blue-50), #f0e6ff);
  border: 1px solid var(--blue-200);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 14px
}

.xc .xi {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--w);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-500);
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06)
}

.xc .xt {
  flex: 1
}

.xc .xt h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy)
}

.xc .xt p {
  font-size: 11px;
  color: var(--g6)
}

.xc .xb {
  padding: 6px 16px;
  border-radius: 16px;
  background: var(--blue-500);
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap
}

/* Channel grouping */
.cg-panel {
  background: var(--w);
  border: 1px solid var(--g2);
  border-radius: 10px;
  margin-top: 16px;
  overflow: hidden
}

.cg-panel-header {
  padding: 12px 16px;
  background: var(--g0);
  border-bottom: 1px solid var(--g2);
  display: flex;
  align-items: center;
  justify-content: space-between
}

.cg-panel-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 6px
}

.step-pills {
  display: flex;
  gap: 3px
}

.step-pill {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer
}

.step-pill.active {
  background: var(--blue-500);
  color: #fff
}

.step-pill.inactive {
  background: var(--g1);
  color: var(--g5)
}

.step-pill.done {
  background: var(--green-100);
  color: var(--green-600)
}

.cg-body {
  padding: 16px
}

.cg-step {
  display: none
}

.cg-step.on {
  display: block
}

.ch-row {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--g2);
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--w);
  cursor: grab;
  font-size: 12px
}

.ch-row:active {
  cursor: grabbing;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .1)
}

.ch-row .drag-handle {
  color: var(--g4);
  font-size: 12px;
  margin-right: 10px
}

.ch-row .ch-name {
  font-weight: 600;
  color: var(--navy);
  flex: 1
}

.ch-row .ch-detail {
  color: var(--g5);
  flex: 2
}

.ch-row .ch-count {
  font-weight: 700;
  color: var(--blue-600);
  width: 80px;
  text-align: right
}

.ch-row .ch-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--blue-50);
  color: var(--blue-600)
}

.drop-zone {
  border: 2px dashed var(--blue-300);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 12px;
  background: var(--blue-50);
  min-height: 44px
}

.drop-zone.over {
  border-color: var(--blue-500);
  background: var(--blue-100)
}

.ch-group-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--g6);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px
}

.save-success {
  display: none;
  padding: 20px;
  text-align: center
}

.save-success.on {
  display: block;
  animation: fadeIn .4s
}

.save-success .check-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green-50);
  border: 3px solid var(--green-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--green-500);
  margin: 0 auto 12px
}

.save-success h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy)
}

.save-success p {
  font-size: 13px;
  color: var(--g6);
  margin-top: 6px
}

.view-reports-btn {
  margin-top: 16px;
  padding: 10px 24px;
  border-radius: 20px;
  background: var(--blue-500);
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px
}

/* Conversations */
.convo-item {
  background: var(--w);
  border: 1px solid var(--g2);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  gap: 14px
}

.conv-ic {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--blue-50);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-500);
  flex-shrink: 0
}

.conv-info h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy)
}

.conv-info p {
  font-size: 12px;
  color: var(--g5);
  margin-top: 1px
}

.conv-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--g4);
  margin-top: 3px
}

.conv-find {
  background: var(--orange-50);
  color: var(--orange-600);
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600
}

/* Action plan */
.prog-track {
  background: var(--g1);
  border-radius: 10px;
  height: 10px;
  margin-top: 10px;
  overflow: hidden
}

.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-500), var(--teal));
  border-radius: 10px;
  transition: width .5s
}

.ag {
  margin-top: 20px
}

.ag-h {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--g5);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px
}

.ai-item {
  background: var(--w);
  border: 1px solid var(--g2);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px
}

.ai-item.done {
  opacity: .5
}

.ai-item.done .ai-txt {
  text-decoration: line-through
}

.acb {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid var(--g3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.acb.ck {
  background: var(--green-500);
  border-color: var(--green-500);
  color: #fff;
  font-size: 10px
}

.ai-txt {
  flex: 1;
  font-size: 13px;
  color: var(--g7)
}

.afix {
  padding: 4px 12px;
  border-radius: 14px;
  background: var(--green-50);
  color: var(--green-600);
  border: 1px solid var(--green-400);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap
}

.exp-bar {
  display: flex;
  gap: 10px;
  margin-top: 20px
}

.exp-btn {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px
}

.exp-btn.pdf {
  background: var(--red-50);
  color: var(--red-600);
  border: 1px solid var(--red-400)
}

.exp-btn.slides {
  background: var(--blue-50);
  color: var(--blue-600);
  border: 1px solid var(--blue-400)
}

/* TABLE AI CARD — wraps a table to make it chatable */
.table-ai-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #f5f0ff;
  border: 2px solid #c4b5fd;
  border-radius: 10px;
  margin: 16px 0;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s
}

.table-ai-card:hover {
  border-color: var(--purple);
  box-shadow: 0 4px 20px rgba(139, 92, 246, .35), 0 0 0 3px rgba(139, 92, 246, .12);
  transform: translateY(-2px)
}

.table-ai-card .data-table {
  margin: 0;
  width: 100%
}

.table-ai-card .data-table th {
  padding: 8px 16px
}

.table-ai-card .data-table td {
  padding: 8px 16px;
  cursor: default
}

.table-ai-card .data-table td:hover {
  background: none
}

.table-ai-card .data-table tbody tr:last-child td {
  border-bottom: none
}

.table-ai-card .mi-chat-bubble {
  position: absolute;
  bottom: -14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 3px 10px rgba(139, 92, 246, .4);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 2
}

.table-ai-card:hover .mi-chat-bubble {
  opacity: 1;
  transform: scale(1)
}

.table-ai-card .mi-input {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, opacity .25s ease;
  opacity: 0
}

.table-ai-card .mi-input.active {
  max-height: 80px;
  opacity: 1
}

.table-ai-card .mi-input-inner {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--g2);
  background: var(--g0)
}

.table-ai-card .mi-input-inner input {
  flex: 1;
  padding: 8px 14px;
  border: 2px solid var(--blue-200);
  border-radius: 20px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  background: var(--w)
}

.table-ai-card .mi-input-inner input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, .08);
  background: var(--w)
}

.table-ai-card .mi-input-inner input::placeholder {
  color: var(--g4)
}

.table-ai-card .mi-input-inner .send {
  width: 28px;
  height: 28px;
  font-size: 11px
}

/* SELECTABLE-ROW TABLE — rows are individually hoverable/clickable */
.selectable-row-table {
  background: var(--w);
  border: 1px solid var(--g2);
  border-radius: 10px;
  margin: 16px 0;
  overflow: hidden
}

.selectable-row-table .data-table {
  margin: 0;
  width: 100%
}

.selectable-row-table .data-table th {
  padding: 8px 16px
}

.selectable-row-table .data-table td {
  padding: 8px 16px;
  cursor: pointer;
  transition: background .15s
}

.selectable-row-table .data-table td:hover {
  background: none
}

.selectable-row-table .data-table tbody tr {
  cursor: pointer;
  transition: background .15s, box-shadow .15s
}

.selectable-row-table .data-table tbody tr:hover {
  background: #ede9fe
}

.selectable-row-table .data-table tbody tr:hover td {
  background: none
}

.selectable-row-table .data-table tbody tr:last-child td {
  border-bottom: none
}

/* SIDEBAR SUGGESTIONS — muted next-step pills */
.sidebar-suggestions {
  padding: 8px 20px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--g2);
  flex-shrink: 0
}

.suggest-pill {
  padding: 5px 10px;
  border-radius: 14px;
  background: var(--g1);
  border: 1px solid var(--g3);
  color: var(--g6);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  line-height: 1.3
}

.suggest-pill:hover {
  background: var(--g2);
  color: var(--g8)
}

/* SIDEBAR CTA — above chat input */
.sidebar-cta {
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--g2);
  flex-shrink: 0
}

.cta-pill {
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--purple);
  border: none;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
  white-space: nowrap
}

.cta-pill:hover {
  background: #7c3aed;
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(139, 92, 246, .35)
}

.cta-pill i {
  font-size: 13px
}

/* AI CARD — clickable hover */
.mi[data-ai-card] {
  cursor: pointer;
  position: relative;
  flex-wrap: wrap;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  background: #f5f0ff;
  border: 2px solid #c4b5fd
}

.mi[data-ai-card]:hover {
  border-color: var(--purple);
  box-shadow: 0 4px 20px rgba(139, 92, 246, .35), 0 0 0 3px rgba(139, 92, 246, .12);
  transform: translateY(-2px)
}

.mi-chat-bubble {
  position: absolute;
  bottom: -14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 3px 10px rgba(139, 92, 246, .4);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 2
}

.mi[data-ai-card]:hover .mi-chat-bubble {
  opacity: 1;
  transform: scale(1)
}

/* Inline card input (inside .mi) */
.mi-input {
  flex-basis: calc(100% + 32px);
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, opacity .25s ease;
  opacity: 0;
  margin: 0 -18px -16px;
  padding: 0
}

.mi-input.active {
  max-height: 80px;
  opacity: 1
}

.mi-input-inner {
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--g2)
}

.mi-input-inner input {
  flex: 1;
  padding: 8px 14px;
  border: 2px solid var(--blue-200);
  border-radius: 20px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  background: var(--g0)
}

.mi-input-inner input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, .08);
  background: var(--w)
}

.mi-input-inner input::placeholder {
  color: var(--g4)
}

.mi-input-inner .send {
  width: 28px;
  height: 28px;
  font-size: 11px
}

/* CHAT SIDEBAR — always pinned open */
.chat-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 30%;
  min-width: 340px;
  background: var(--w);
  border-left: 1px solid var(--g2);
  box-shadow: -4px 0 24px rgba(0, 0, 0, .06);
  z-index: 90;
  display: flex;
  flex-direction: column;
  transform: translateX(0)
}

/* Main content always shrunk to accommodate sidebar */
.mn {
  width: calc(70% - var(--sb-c))
}

.chat-sidebar-header {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--g2);
  flex-shrink: 0;
  background: var(--w);
  border-top: 3px solid var(--g3)
}

.chat-sidebar-header .mav {
  width: 30px;
  height: 30px;
  font-size: 12px
}

.chat-sidebar-header .mname {
  flex: 1;
  margin-bottom: 0
}

.chat-sidebar-close {
  background: none;
  border: none;
  color: var(--g5);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 6px;
  transition: background .15s, color .15s
}

.chat-sidebar-close:hover {
  background: var(--g1);
  color: var(--g8)
}

/* Sidebar context banner — purple theme */
.sidebar-context {
  padding: 10px 20px;
  background: white;
  border-bottom: 2px solid #c4b5fd;
  font-size: 11px;
  color: #7c3aed;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 44px;
  transition: background .2s, border-color .2s
}

.sidebar-context.has-context {
  background: #ede9fe;
  border-bottom-color: var(--purple);
  box-shadow: inset 0 -2px 8px rgba(139, 92, 246, .08)
}

.sidebar-context .ctx-items {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px
}

.sidebar-context .ctx-text {
  flex: 1;
  font-weight: 500;
  color: var(--g5);
  font-style: italic
}

.sidebar-context.has-context .ctx-text {
  color: #7c3aed;
  font-weight: 600;
  font-style: normal
}

.sidebar-context .ctx-tag {
  background: var(--w);
  border: 1px solid #c4b5fd;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
  color: #7c3aed
}

.sidebar-context .ctx-clear {
  background: none;
  border: none;
  color: #a78bfa;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px
}

.sidebar-context .ctx-clear:hover {
  color: var(--red-500)
}

/* Sidebar chat thread */
.chat-sidebar-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px
}

/* Sidebar input bar */
.chat-sidebar-bar {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--g2);
  flex-shrink: 0;
  background: var(--g0)
}

.chat-sidebar-bar .mav {
  width: 30px;
  height: 30px;
  font-size: 12px
}

.chat-sidebar-bar input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid var(--g3);
  border-radius: 22px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: var(--w)
}

.chat-sidebar-bar input:focus {
  border-color: var(--g5);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .04)
}

.chat-sidebar-bar input.flash-purple {
  animation: purpleFlash 1.5s ease-out
}

@keyframes purpleFlash {
  0% {
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .4)
  }
  50% {
    border-color: #a78bfa;
    box-shadow: 0 0 0 8px rgba(139, 92, 246, .2)
  }
  100% {
    border-color: var(--g5);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .04)
  }
}

.chat-sidebar-bar input::placeholder {
  color: var(--g4)
}

.chat-sidebar-bar .send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--g5);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

/* Chat messages */
.cm {
  display: flex;
  gap: 8px;
  max-width: 95%
}

.cm.user {
  margin-left: auto;
  flex-direction: row-reverse
}

.cm .bub {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6
}

.cm.molly .bub {
  background: var(--w);
  color: var(--g8);
  border: 1px solid var(--g2);
  border-bottom-left-radius: 3px
}

.cm.user .bub {
  background: var(--g6);
  color: #fff;
  border-bottom-right-radius: 3px
}

.cm .av {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700
}

.cm.molly .av {
  background: linear-gradient(135deg, var(--blue-500), var(--purple));
  color: #fff
}

.cm.user .av {
  background: var(--g3);
  color: var(--g7)
}

.chat-artifact {
  background: var(--w);
  border: 1px solid var(--g2);
  border-radius: 8px;
  padding: 10px;
  margin-top: 6px
}

.chat-artifact-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px
}

.chat-artifact-title i {
  color: var(--blue-500)
}

.typing-ind {
  display: flex;
  gap: 3px;
  padding: 4px 0
}

.typing-ind span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--g4);
  animation: tb 1.4s infinite
}

.typing-ind span:nth-child(2) {
  animation-delay: .2s
}

.typing-ind span:nth-child(3) {
  animation-delay: .4s
}

@keyframes tb {
  0%, 60%, 100% {
    transform: translateY(0)
  }
  30% {
    transform: translateY(-4px)
  }
}

/* Data point context menu */
.dp-menu {
  position: fixed;
  z-index: 200;
  background: var(--w);
  border: 1px solid var(--g2);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  padding: 4px;
  display: none;
  min-width: 200px
}

.dp-menu.on {
  display: block;
  animation: fadeIn .15s ease
}

.dp-menu-item {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--g7);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .1s
}

.dp-menu-item:hover {
  background: var(--blue-50);
  color: var(--blue-600)
}

.dp-menu-item i {
  width: 16px;
  text-align: center;
  color: var(--blue-500)
}

/* Modal */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 300;
  align-items: center;
  justify-content: center
}

.modal-bg.on {
  display: flex
}

.modal-box {
  background: var(--w);
  border-radius: 16px;
  padding: 32px;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .15);
  text-align: center
}

.modal-box h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy)
}

.modal-box p {
  font-size: 13px;
  color: var(--g6);
  margin-top: 8px;
  line-height: 1.6
}

.modal-box .price {
  font-size: 36px;
  font-weight: 800;
  color: var(--blue-500);
  margin-top: 14px
}

.modal-box .price span {
  font-size: 15px;
  color: var(--g5);
  font-weight: 500
}

.modal-box .features {
  text-align: left;
  margin-top: 14px
}

.modal-box .features div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
  color: var(--g7)
}

.modal-box .features i {
  color: var(--green-500);
  font-size: 13px;
  width: 18px
}

.modal-btns {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: center
}

.modal-btns .btn {
  padding: 10px 28px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none
}

.modal-btns .btn-primary {
  background: var(--blue-500);
  color: #fff
}

.modal-btns .btn-secondary {
  background: var(--g1);
  color: var(--g7)
}

/* Send button base — muted gray */
.send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--g5);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

/* BOTTOM CHAT (legacy — used by issue/convos/plan pages) */
.bottom-chat {
  position: fixed;
  bottom: 0;
  left: var(--sb-c);
  right: 0;
  z-index: 150;
  display: flex;
  justify-content: center;
  pointer-events: none
}

.bottom-chat-inner {
  width: 100%;
  max-width: calc(var(--content-max) + 80px);
  pointer-events: all;
  background: var(--w);
  border: 1px solid var(--g2);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, .1);
  overflow: hidden
}

.chat-bar {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px
}

.chat-bar .mav {
  width: 34px;
  height: 34px;
  font-size: 13px
}

.chat-bar input {
  flex: 1;
  padding: 10px 18px;
  border: 2px solid var(--blue-300);
  border-radius: 24px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: var(--w)
}

.chat-bar input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, .1)
}

.chat-bar input::placeholder {
  color: var(--g4)
}

.chat-bar .send {
  width: 32px;
  height: 32px
}

.chat-thread {
  max-height: 0;
  overflow-y: auto;
  transition: max-height .4s ease;
  border-top: 1px solid var(--g2)
}

.bottom-chat-inner.expanded .chat-thread {
  max-height: 400px
}

.chat-thread-inner {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px
}

.chat-toggle {
  background: none;
  border: none;
  color: var(--g4);
  cursor: pointer;
  font-size: 14px;
  padding: 2px
}

/* Chat context banner (legacy) */
.chat-context {
  padding: 8px 20px;
  background: var(--blue-50);
  border-top: 1px solid var(--blue-200);
  font-size: 11px;
  color: var(--blue-600);
  display: flex;
  align-items: center;
  gap: 8px
}

.chat-context .ctx-items {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px
}

.chat-context .ctx-tag {
  background: var(--w);
  border: 1px solid var(--blue-200);
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600
}

.chat-context .ctx-clear {
  background: none;
  border: none;
  color: var(--blue-400);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px
}

.chat-context .ctx-clear:hover {
  color: var(--red-500)
}

@media (max-width: 768px) {
  .sb {
    width: 0
  }

  .mn {
    margin-left: 0;
    width: 100%
  }

  .ct {
    padding: 0 16px 40px
  }

  .bottom-chat {
    left: 0
  }

  .chat-sidebar {
    display: none
  }
}
