/* Connie Chan AI-detection project
   Colour: one sequential blue hue, ordinal steps 250/450/650 from the
   validated ramp (light-mode, white surface). Verdict is an ordered bucket of
   the same magnitude -- fraction of the email that reads as AI -- so it gets
   one hue stepped light->dark, never separate categorical hues. */

.cc-root {
  --surface:        #ffffff;
  --surface-2:      #f7f6f4;
  --rule:           #e4e2dd;
  --rule-strong:    #d3d0c9;

  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #85837c;

  /* ordinal ramp: human -> mixed -> ai */
  --v-human:        #86b6ef;
  --v-mixed:        #2a78d6;
  --v-ai:           #104281;
  --track:          #ecebe7;

  --link:           #2a78d6;

  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 80px;
  color: var(--text-primary);
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* ---------- header ---------- */

.cc-back {
  display: inline-block;
  margin: 28px 0 24px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
}
.cc-back:hover { color: var(--link); }

.cc-title {
  font-size: 40px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  max-width: 20ch;
}

.cc-dek {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 68ch;
  margin: 0 0 14px;
}
.cc-dek strong { color: var(--text-primary); font-weight: 600; }
.cc-dek a, .cc-note a, .cc-foot a { color: var(--link); }

.cc-note {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 76ch;
  margin: 0 0 6px;
}

/* ---------- stat row ---------- */

.cc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  margin: 32px 0 8px;
}
.cc-stat { background: var(--surface); padding: 18px 20px; }
.cc-stat-value {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.cc-stat-label {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* ---------- distribution bar ---------- */

.cc-figure { margin: 36px 0 8px; }
.cc-figure-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}
.cc-figure-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.cc-dist {
  display: flex;
  gap: 2px;
  height: 46px;
  margin-bottom: 12px;
}
.cc-dist-seg {
  border-radius: 4px;
  position: relative;
  cursor: default;
  transition: filter .12s ease;
}
.cc-dist-seg:hover { filter: brightness(1.08); }
.cc-dist-seg[data-v="Human"] { background: var(--v-human); }
.cc-dist-seg[data-v="Mixed"] { background: var(--v-mixed); }
.cc-dist-seg[data-v="AI"]    { background: var(--v-ai); }

.cc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: var(--text-secondary);
}
.cc-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.cc-swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
  flex: 0 0 12px;
}
.cc-swatch[data-v="Human"] { background: var(--v-human); }
.cc-swatch[data-v="Mixed"] { background: var(--v-mixed); }
.cc-swatch[data-v="AI"]    { background: var(--v-ai); }

/* ---------- controls ---------- */

.cc-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 40px 0 14px;
}
.cc-chip {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  height: auto;
  line-height: 1.3;
  padding: 6px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}
.cc-chip:hover { border-color: var(--text-muted); }
.cc-chip[aria-pressed="true"] {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #fff;
}
.cc-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- table ---------- */

.cc-table-wrap { overflow-x: auto; }

.cc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.cc-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 12px 9px;
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}
.cc-table th.cc-sortable { cursor: pointer; user-select: none; }
.cc-table th.cc-sortable:hover { color: var(--text-primary); }
.cc-table th .cc-arrow { opacity: 0; margin-left: 3px; }
.cc-table th[aria-sort] .cc-arrow { opacity: 1; }

.cc-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.cc-table tbody tr:hover { background: var(--surface-2); }

.cc-date { white-space: nowrap; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.cc-subject { min-width: 260px; }
.cc-subject a { color: var(--text-primary); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.cc-subject a:hover { color: var(--link); border-bottom-color: var(--link); }
.cc-sender { display: block; font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.cc-words { text-align: right; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }

.cc-verdict { white-space: nowrap; }
.cc-verdict-inner { display: inline-flex; align-items: center; gap: 7px; }

/* meter: track + fill, 4px rounded data-end anchored at the left baseline */
.cc-meter { min-width: 150px; }
.cc-meter-row { display: flex; align-items: center; gap: 10px; }
.cc-track {
  display: block;
  flex: 1 1 auto;
  height: 10px;
  min-width: 80px;
  background: var(--track);
  border-radius: 4px;
  overflow: hidden;
}
.cc-fill { display: block; height: 100%; border-radius: 4px; }
.cc-fill[data-v="Human"] { background: var(--v-human); }
.cc-fill[data-v="Mixed"] { background: var(--v-mixed); }
.cc-fill[data-v="AI"]    { background: var(--v-ai); }
.cc-pct {
  flex: 0 0 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.cc-copy {
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  height: auto;
  line-height: 1.3;
  padding: 5px 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.cc-copy:hover { border-color: var(--text-muted); color: var(--text-primary); }

/* ---------- footer ---------- */

.cc-foot {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 76ch;
}
.cc-foot h2 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0 0 10px; }
.cc-foot ul { padding-left: 20px; }
.cc-foot li { margin-bottom: 7px; }

@media (max-width: 700px) {
  .cc-root { padding: 0 16px 60px; }
  .cc-title { font-size: 30px; }
  .cc-dek { font-size: 16px; }
  .cc-words, .cc-sender { display: none; }
}
