/* ── CSS Variables ── */
:root {
  --blue: #1e5faa;
  --blue-dark: #174d8f;
  --blue-light: #dbeafe;
  --dark: #111827;
  --mid: #374151;
  --light: #6b7280;
  --border: #e5e7eb;
  --surface: #ffffff;
  --bg: #f1f5f9;
  --radius: 12px;
  --shadow-sm: none;
  --shadow-md: none;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--dark);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Dashboard Shell ── */
.dash { max-width: 860px; margin: 0 auto; padding: 32px 20px 48px; }

/* ── Header ── */
.dhead {
  background: linear-gradient(135deg, #0f3460 0%, var(--blue) 60%, #2d7dd2 100%);
  color: #fff;
  padding: 28px 32px;
  border-radius: var(--radius);
  margin-bottom: 20px;

  position: relative;
  overflow: hidden;
}
.dhead::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,.05);
  border-radius: 50%;
  pointer-events: none;
}
.dhead h1 { font-size: 20px; font-weight: 700; margin-bottom: 4px; letter-spacing: -.2px; }
.dhead p  { font-size: 13px; opacity: .8; font-weight: 400; }

/* ── Mode tabs ── */
.mode-tabs {
  display: flex;
  gap: 6px;
  margin-top: 18px;
}
.mode-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: 8px 8px 0 0;
  border: none;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.75);
  transition: background .18s, color .18s;
  position: relative;
}
.mode-tab:hover { background: rgba(255,255,255,.25); color: #fff; }
.mode-tab.active { background: #fff; color: var(--blue); }
.bulk-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f97316;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 99px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 7px;
  vertical-align: middle;
}

/* ── Bulk table ── */
.bulk-table-wrap {
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 2px;
}
.bulk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bulk-table thead tr { background: #f8fafc; }
.bulk-table th {
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1.5px solid #e2e8f0;
}
.bulk-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.bulk-table tbody tr:last-child td { border-bottom: none; }
.bulk-table td input,
.bulk-table td select {
  padding: 6px 10px;
  font-size: 12.5px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  width: 100%;
  background: #fafbfc;
  font-family: inherit;
}
.bulk-table td input:focus,
.bulk-table td select:focus {
  border-color: var(--blue);
  outline: none;
  background: #fff;
}
.bulk-table .row-num {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
}
.bulk-table .btn-del-row {
  background: none;
  border: none;
  cursor: pointer;
  color: #cbd5e1;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
}
.bulk-table .btn-del-row:hover { color: #dc2626; background: #fef2f2; }
.btn-add-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 7px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
}
.btn-add-row:hover { background: #dbeafe; }
.btn-add-row:disabled { opacity: .45; cursor: not-allowed; }

/* ── Bulk progress bar ── */
.bulk-progress-wrap {
  margin-top: 14px;
  display: none;
}
.bulk-progress-wrap.show { display: block; }
.bulk-progress-bar-track {
  background: #e2e8f0;
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.bulk-progress-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--blue), #3b82f6);
  border-radius: 99px;
  transition: width .4s ease;
  width: 0%;
}
.bulk-progress-status {
  font-size: 12px;
  color: var(--light);
}
.bulk-progress-status strong { color: var(--dark); }

/* ── Report divider between bulk reports ── */
.bulk-report-divider {
  border: none;
  border-top: 2px dashed #e2e8f0;
  margin: 32px 0;
}
.bulk-report-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #94a3b8;
  margin-bottom: 8px;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.card h2 {
  font-size: 11px;
  font-weight: 700;
  color: var(--light);
  margin-bottom: 22px;
  text-transform: uppercase;
  letter-spacing: .8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2::before {
  content: '';
  display: inline-block;
  width: 3px; height: 14px;
  background: var(--blue);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Layout helpers ── */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.row1 { margin-bottom: 16px; }
.fg   { display: flex; flex-direction: column; gap: 6px; }

/* ── Form labels ── */
label {
  font-size: 11px;
  font-weight: 700;
  color: var(--light);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ── Inputs & selects ── */
input, select {
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .18s;
  width: 100%;
  background: #fafbfc;
  color: var(--dark);
}
input:focus, select:focus {
  border-color: var(--blue);
  background: #fff;
}
input::placeholder { color: #b0b8c4; }
/* Gender select: grey when showing placeholder, normal when a value is chosen */
select#gender:invalid,
select#gender option[value=""] { color: #b0b8c4; }
select#gender:not(:invalid) { color: var(--dark); }

/* ── Date preset pills ── */
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pbtn {
  padding: 7px 16px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  color: var(--light);
  cursor: pointer;
  transition: .15s;
  font-family: inherit;
}
.pbtn:hover  { border-color: var(--blue); color: var(--blue); background: #f0f6ff; }
.pbtn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.custom-dates { display: none; }
.custom-dates.show {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}
.range-label { font-size: 12px; color: var(--light); margin-top: 4px; min-height: 18px; }

/* ── Field hints & optional labels ── */
.field-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.5;
}
/* ── Gender recommendation hint ── */
.gender-hint {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  margin-top: 5px;
  line-height: 1.4;
  color: #94a3b8;
  font-weight: 400;
}
.gender-hint.show { display: flex; }
.gender-hint-icon {
  font-size: 13px;
  flex-shrink: 0;
  color: #94a3b8;
}
.gender-hint strong { color: #475569; font-weight: 600; }
.gender-hint-change {
  margin-left: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  background: #e2e8f0;
  border-radius: 4px;
  padding: 1px 6px;
  cursor: pointer;
  border: none;
  line-height: 1.6;
}
.gender-hint-change:hover { background: #cbd5e1; }
/* low-confidence hint */
.gender-hint.low { color: #b45309; }
.gender-hint.low strong { color: #92400e; }
/* ── Field-level validation errors ── */
.field-error {
  display: none;
  font-size: 11px;
  font-weight: 600;
  color: #dc2626;
  margin-top: 4px;
  line-height: 1.4;
}
.field-error.show {
  display: flex;
  align-items: center;
  gap: 4px;
}
.field-error.show::before {
  content: '⚠';
  font-size: 11px;
  flex-shrink: 0;
}
input.input-error,
select.input-error {
  border-color: #dc2626 !important;
  background: #fff5f5 !important;
}
input.input-error:focus,
select.input-error:focus {
  border-color: #dc2626 !important;
}
.opt-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  background: #f1f5f9;
  border-radius: 99px;
  padding: 2px 8px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
  vertical-align: middle;
}

/* ── Compare block ── */
.compare-block {
  margin-top: 24px;
  padding: 18px 20px;
  border: 1.5px solid #bfdbfe;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fbff 0%, #f0f6ff 100%);
}
.compare-block-header { display: flex; align-items: flex-start; }
.compare-toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  width: 100%;
}
.compare-toggle-label input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}
.compare-toggle-text { flex: 1; }
.compare-toggle-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.4;
  text-transform: none;
  letter-spacing: normal;
}
.compare-toggle-sub {
  display: block;
  font-size: 11px;
  color: var(--light);
  margin-top: 2px;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: normal;
}

/* ── Action buttons ── */
.btn {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 6px;
  transition: transform .15s, background .15s;
  letter-spacing: .1px;
}
.btn:active { transform: scale(.98); }
.btn-blue {
  background: linear-gradient(135deg, var(--blue) 0%, #2d7dd2 100%);
  color: #fff;
}
.btn-blue:hover    { background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%); }
.btn-blue:disabled { background: #cbd5e1; cursor: not-allowed; color: #94a3b8; }
.btn-green {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
  display: none;
  margin-top: 10px;
}
.btn-green:hover { background: linear-gradient(135deg, #047857 0%, #059669 100%); }

/* ── Section toggles ── */
.section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stog {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: .15s;
  user-select: none;
  background: #fafbfc;
}
.stog:hover   { border-color: var(--blue); background: #f0f6ff; }
.stog.on      { border-color: var(--blue); background: #eff6ff; }
.scheck {
  width: 17px; height: 17px;
  border-radius: 5px;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .15s;
  background: #fff;
}
.stog.on .scheck { background: var(--blue); border-color: var(--blue); }
.schk {
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 1px;
  display: none;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.stog.on .schk { display: block; }
.slabel { font-size: 12px; font-weight: 600; color: var(--mid); }
.stog.on .slabel { color: var(--blue); }
.snum {
  font-size: 10px; font-weight: 700;
  color: #94a3b8;
  background: #f1f5f9;
  border-radius: 99px;
  padding: 2px 7px;
  flex-shrink: 0;
  margin-left: auto;
}
.stog.on .snum { background: #dbeafe; color: var(--blue); }

/* ── Progress bar ── */
.progress {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: none;
}
.progress.show { display: block; }
.plabel {
  font-size: 12px; font-weight: 700;
  color: var(--mid); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: .4px;
}
.pbar { height: 5px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-bottom: 10px; }
.pfill { height: 100%; background: linear-gradient(90deg, var(--blue), #2d7dd2); border-radius: 99px; transition: width .4s ease; width: 0%; }

.psteps  { display: flex; flex-direction: column; gap: 5px; }
.step    { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #94a3b8; }
.step.active { color: var(--blue); font-weight: 600; }
.step.done   { color: #10b981; }
.stepicon {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; flex-shrink: 0;
}
.step.active .stepicon { border-color: var(--blue); }
.step.done   .stepicon { background: #10b981; border-color: #10b981; color: #fff; }

.spinsm {
  width: 10px; height: 10px;
  border: 2px solid #e2e8f0;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Status bar ── */
.sbar {
  display: none; align-items: center; gap: 10px;
  background: var(--surface); padding: 12px 16px; border-radius: 10px;
  margin-bottom: 16px; font-size: 13px;
}
.sbar.show { display: flex; }
.sbar.ok   { border-left: 4px solid #10b981; }
.sbar.err  { border-left: 4px solid #ef4444; }

/* ── Report output container ── */
#rout { display: none; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
#rout.show { display: block; }

/* ── Responsive (dashboard) ── */
@media (max-width: 600px) {
  .row2               { grid-template-columns: 1fr; }
  .section-grid       { grid-template-columns: 1fr; }
  .custom-dates.show  { grid-template-columns: 1fr; }
  .dash               { padding: 16px 12px 32px; }
  .card               { padding: 18px 16px; }
}

/* ═══════════════════════════════════════════════════
   REPORT STYLES
═══════════════════════════════════════════════════ */
.rw {
  max-width: 100%;
  margin: 0 auto;
  padding: 14mm 12mm;
  background: #fafbfc;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.7;
  color: #374151;
}

/* Report header */
.rw .hs {
  border-top: 4px solid #1e5faa;
  text-align: center;
  margin-bottom: 28px;
  background: linear-gradient(to bottom, #fff, #f9fafb);
  padding: 22px 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.rw h1.rt    { font-size: 24px; font-weight: 700; color: #1e5faa; margin: 10px 0 5px; }
.rw .rs      { font-size: 12px; color: #6b7280; font-weight: 500; margin: 4px 0 0; }

/* Section headings */
.rw h2 {
  font-size: 15px; font-weight: 700; color: #1e5faa;
  margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.rw h3 { font-size: 12px; font-weight: 700; color: #4b5563; margin: 16px 0 8px; text-transform: uppercase; letter-spacing: .6px; }
.rw h4 { font-size: 11px; font-weight: 700; color: #4b5563; margin: 10px 0 6px; text-transform: uppercase; letter-spacing: .5px; }

/* Body text */
.rw p      { font-size: 13px; line-height: 1.7; margin: 8px 0; }
.rw strong { font-weight: 600; color: #1a1a2e; }

/* Section block */
.rw .sec {
  background: #fff;
  padding: 20px 22px;
  border-radius: 6px;
  box-shadow: 0 1px 5px rgba(0,0,0,.05);
  margin-bottom: 16px;
  page-break-inside: avoid;
}
.rw .ps { border-left: 3px solid #1e5faa; padding-left: 20px; }

/* Stat card */
.rw .sc {
  background: #f8faff;
  padding: 14px 16px;
  border-radius: 6px;
  margin: 10px 0;
  border: 1px solid #e8f0fb;
}

/* Section number badge */
.rw .sn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: #1e5faa; color: #fff;
  border-radius: 50%;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}

/* Comparison section — star badge gets a teal accent */
.rw .sec h2 .sn-compare {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: #0f766e; color: #fff;
  border-radius: 50%;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.rw .sec-compare { border-left: 4px solid #0f766e; }

/* Lists */
.rw ul                  { margin: 8px 0 !important; padding-left: 14px !important; list-style: none !important; }
.rw ul li               { margin: 5px 0 !important; padding-left: 16px !important; position: relative; list-style: none !important; font-size: 13px; }
.rw ul li::before       { content: '•'; position: absolute; left: 0; color: #1e5faa; font-weight: bold; font-size: 14px; line-height: 1.5; }

/* Tables */
.rw .tbl-wrap {
  overflow-x: auto;
  margin: 14px 0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(30,95,170,.10);
}
.rw .tbl { width: 100%; border-collapse: collapse; font-size: 12px; background: #fff; }
.rw .tbl thead tr { background: linear-gradient(90deg, #1e5faa 0%, #2d7dd2 100%); }
.rw .tbl th {
  padding: 10px 13px;
  text-align: left; font-weight: 600; color: #fff;
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  white-space: nowrap; border: none;
}
.rw .tbl td {
  padding: 8px 13px; color: #374151;
  vertical-align: middle; line-height: 1.4;
  border-bottom: 1px solid #f0f4f8;
}
.rw .tbl tbody tr:nth-child(even) td  { background: #f5f9ff; }
.rw .tbl tbody tr:nth-child(odd)  td  { background: #fff; }
.rw .tbl tbody tr:last-child      td  { border-bottom: none; }
.rw .tbl tbody tr:hover           td  { background: #dbeafe !important; }
.rw .tbl td:first-child               { font-weight: 600; color: #1e3a5f; }

/* Footer */
.rw .foot {
  text-align: center; margin-top: 28px;
  padding: 14px 0; border-top: 2px solid #e5e7eb;
  color: #6b7280; font-size: 11px; font-weight: 500;
}

/* ── Insight boxes ── */
.rw .insight-box {
  background: #f0f6ff;
  border-left: 4px solid #1e5faa;
  border-radius: 0 6px 6px 0;
  padding: 13px 16px;
  margin: 14px 0;
}
.rw .insight-box.correlation {
  background: #f0fdf4;
  border-left-color: #16a34a;
}
.rw .insight-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #1e5faa;
  margin-bottom: 5px;
}
.rw .insight-box.correlation .insight-label { color: #16a34a; }
.rw .insight-box p {
  font-size: 12.5px;
  line-height: 1.7;
  color: #374151;
  margin: 0;
}
.rw .insight-box ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.rw .insight-box ul li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 5px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #374151;
}
.rw .insight-box ul li:last-child { margin-bottom: 0; }
.rw .insight-box ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 0;
  color: #1e5faa;
  font-weight: 700;
}
.rw .insight-box.correlation ul li::before { color: #16a34a; }

/* ── SG colour classes ── */
.rw .sg-pos { color: #16a34a; font-weight: 600; }
.rw .sg-neg { color: #dc2626; font-weight: 600; }

/* ── Metric grid (SG overview cards) ── */
.rw .metric-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 14px 0;
}
@media (max-width: 600px) {
  .rw .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
.rw .sg-card {
  padding: 12px 10px;
  border-radius: 8px;
  text-align: center;
  border: 1.5px solid transparent;
}
.rw .sg-card-pos { background: #f0fdf4; border-color: #bbf7d0; }
.rw .sg-card-neg { background: #fef2f2; border-color: #fecaca; }
.rw .sg-card-neu { background: #f3f4f6; border-color: #e5e7eb; }
.rw .sg-card-val {
  font-size: 18px; font-weight: 700; line-height: 1.2; margin-bottom: 4px;
}
.rw .sg-card-pos .sg-card-val { color: #16a34a; }
.rw .sg-card-neg .sg-card-val { color: #dc2626; }
.rw .sg-card-neu .sg-card-val { color: #374151; }
.rw .sg-card-label { font-size: 10px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .4px; }

/* ── Badges ── */
.rw .badge { padding: 3px 9px; border-radius: 12px; font-size: 12px; font-weight: 700; display: inline-block; }
.rw .badge-pos { background: #dcfce7; color: #16a34a; }
.rw .badge-neg { background: #fee2e2; color: #dc2626; }
.rw .badge-neu { background: #f3f4f6; color: #6b7280; }

/* ── Focus badges ── */
.rw .focus-badge { padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 700; display: inline-block; margin-left: 6px; text-transform: uppercase; letter-spacing: .4px; }
.rw .focus-primary   { background: #fee2e2; color: #dc2626; }
.rw .focus-secondary { background: #fef3c7; color: #d97706; }
.rw .focus-additional{ background: #f3f4f6; color: #6b7280; }

/* ── Print ── */
@media print {
  body { background: #fff; }
  .dash > *:not(#rout) { display: none !important; }
  #rout { display: block !important; box-shadow: none; }
  .rw   { padding: 8mm; }
}

/* ═══════════════════════════════════════════════════════════════
   COMPARISON VISUALISATIONS
═══════════════════════════════════════════════════════════════ */

/* ── Winner banner ── */
.cmp-winner-banner {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: linear-gradient(135deg, #0f766e 0%, #1e5faa 100%);
  border-radius: 10px; padding: 16px 20px; margin-bottom: 20px; color: #fff;
  text-align: center;
}
.cmp-winner-banner .cw-name  { font-size: 20px; font-weight: 800; letter-spacing: .3px; }
.cmp-winner-banner .cw-sub   { font-size: 12px; opacity: .85; margin-top: 2px; }
.cmp-winner-banner .cw-badge { background: rgba(255,255,255,.2); border-radius: 8px; padding: 6px 14px; }
.cmp-winner-banner .cw-diff  { font-size: 24px; font-weight: 900; }
.cmp-winner-banner .cw-label { font-size: 11px; opacity: .8; text-transform: uppercase; letter-spacing: .5px; }

/* ── SG Radar chart ── */
.cmp-radar-wrap {
  display: flex;
  justify-content: center;
  margin: 16px 0 24px;
  overflow: visible;
}
.cmp-radar-wrap svg {
  display: block;
  width: 100%;
  max-width: 440px;
  overflow: visible;
}

/* ── Horizontal duel bar ── */
.cmp-duel { margin: 18px 0; }
.cmp-duel-title { font-size: 12px; font-weight: 700; color: #374151; text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 12px; padding-bottom: 6px;
  border-bottom: 2px solid #e5e7eb; }
.cmp-bar-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px;
  align-items: center; margin-bottom: 8px; }
.cmp-bar-label { font-size: 11px; font-weight: 600; color: #6b7280;
  text-transform: uppercase; letter-spacing: .3px; text-align: center;
  padding: 2px 0 8px; grid-column: 1/-1; }
.cmp-bar-name-left  { font-size: 11px; font-weight: 700; color: #1e5faa; text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-bar-name-right { font-size: 11px; font-weight: 700; color: #0f766e; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Back-to-back horizontal bar */
.cmp-btb { display: grid; grid-template-columns: 1fr minmax(80px,auto) 1fr;
  align-items: center; gap: 6px; margin-bottom: 7px; }
.cmp-btb-metric { font-size: 11px; color: #374151; font-weight: 600; text-align: center;
  background: #f3f4f6; border-radius: 4px; padding: 3px 8px; white-space: nowrap; overflow: visible; }
.cmp-btb-left-bar  { display: flex; justify-content: flex-end; align-items: center; height: 22px; gap: 5px; }
.cmp-btb-right-bar { display: flex; justify-content: flex-start; align-items: center; height: 22px; gap: 5px; }
.cmp-btb-val-left  { font-size: 10px; font-weight: 700; color: #1e5faa; white-space: nowrap; flex-shrink: 0; }
.cmp-btb-val-right { font-size: 10px; font-weight: 700; color: #ea580c; white-space: nowrap; flex-shrink: 0; }
.cmp-btb-fill-left {
  height: 22px; border-radius: 4px 0 0 4px;
  background: linear-gradient(to left, #1e5faa, #3b82f6);
  flex-shrink: 0; min-width: 4px;
  transition: width .3s;
}
.cmp-btb-fill-right {
  height: 22px; border-radius: 0 4px 4px 0;
  background: linear-gradient(to right, #ea6c0a, #f97316);
  flex-shrink: 0; min-width: 4px;
  transition: width .3s;
}
.cmp-btb-fill-win-left  { background: linear-gradient(to left,  #1d4ed8, #2563eb); }
.cmp-btb-fill-win-right { background: linear-gradient(to right, #c2550a, #ea580c); }

/* ── Scorecard grid ── */
.cmp-scorecard { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px; margin: 14px 0; }
.cmp-sc-card { border-radius: 8px; padding: 12px 10px; text-align: center;
  border: 1.5px solid #e5e7eb; }
.cmp-sc-card-title { font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: #9ca3af; margin-bottom: 8px; }
.cmp-sc-row { display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; margin-bottom: 4px; }
.cmp-sc-p1 { color: #1e5faa; font-weight: 700; }
.cmp-sc-p2 { color: #ea580c; font-weight: 700; }
.cmp-sc-metric { font-size: 10px; color: #6b7280; flex: 1; text-align: center; }
.cmp-sc-winner-p1 { background: #eff6ff; border-color: #bfdbfe; }
.cmp-sc-winner-p2 { background: #fff7ed; border-color: #fed7aa; }
.cmp-sc-tied      { background: #f9fafb; border-color: #e5e7eb; }

/* ── Putting arc chart wrapper ── */
.cmp-putt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.cmp-putt-arc  { text-align: center; }
.cmp-putt-arc-label { font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: #6b7280; margin-bottom: 6px; }
.cmp-putt-arc svg { display: block; margin: 0 auto; }

/* ── Legend strip ── */
.cmp-legend { display: flex; gap: 18px; margin: 8px 0 14px; justify-content: center; }
.cmp-leg-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block;
  margin-right: 5px; vertical-align: middle; }
.cmp-leg-label { font-size: 11px; color: #374151; font-weight: 600; vertical-align: middle; }

/* ── Section divider ── */
.cmp-divider { border: none; border-top: 1.5px solid #e5e7eb; margin: 20px 0; }

/* ── Responsive (comparison) ── */
@media (max-width: 560px) {
  .cmp-putt-grid { grid-template-columns: repeat(2,1fr); }
  .cmp-scorecard { grid-template-columns: 1fr 1fr; }
}

/* ── Player History Suggestion Dropdown ── */
.ph-sugg-box {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
  max-height: 260px;
  overflow-y: auto;
  font-size: 13px;
}
.ph-sugg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background .12s;
  position: relative;
}
.ph-sugg-item:last-child { border-bottom: none; }
.ph-sugg-item:hover { background: #f0f7ff; }
.ph-sugg-name {
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-sugg-uid {
  font-size: 11px;
  color: #94a3b8;
  font-family: monospace;
  white-space: nowrap;
}
.ph-sugg-gender {
  font-size: 10px;
  font-weight: 700;
  color: #1e5faa;
  background: #dbeafe;
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}
.ph-sugg-del {
  background: none;
  border: none;
  cursor: pointer;
  color: #cbd5e1;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}
.ph-sugg-del:hover { color: #dc2626; background: #fef2f2; }
