/* --- Liquid Glass Premium Theme --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  --bg1: #0f172a;
  --bg2: #020617;
  --glass: rgba(15, 23, 42, 0.6);
  --glassBorder: rgba(255, 255, 255, 0.08);
  --muted: rgba(148, 163, 184, 0.9);
  --text: rgba(248, 250, 252, 0.95);
  --shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.6);
  --pillBg: rgba(0, 0, 0, 0.3);
  --danger: #f43f5e;
  --warn: #fbbf24;
  --good: #10b981;
  --brand: #3b82f6;
  --brandGradient: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
}

:root.light-mode {
  --bg1: #f1f5f9;
  --bg2: #e2e8f0;
  --glass: rgba(255, 255, 255, 0.85);
  --glassBorder: rgba(0, 0, 0, 0.15);
  --muted: rgba(71, 85, 105, 0.9);
  --text: rgba(15, 23, 42, 0.95);
  --shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.15);
  --pillBg: rgba(0, 0, 0, 0.08);
  --danger: #e11d48;
  --warn: #d97706;
  --good: #059669;
  --brand: #2563eb;
  --brandGradient: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.1));
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: radial-gradient(800px circle at 15% 20%, rgba(59, 130, 246, 0.12), transparent 50%),
    radial-gradient(600px circle at 85% 60%, rgba(139, 92, 246, 0.12), transparent 50%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  overflow-x: hidden;
}

/* tiny utility fallback so we don't depend on Tailwind */
.hidden {
  display: none !important;
}

.mono {
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 18px 40px
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand small {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6)
}

.chipRow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end
}

.chip {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
}

.btn {
  cursor: pointer;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--brandGradient);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: none;
}

.btn.primary:hover {
  background: var(--brandGradient);
  box-shadow: none;
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glassBorder);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.card {
  border-radius: 18px;
  padding: 16px
}

.grid {
  display: grid;
  gap: 14px
}

.topGrid {
  grid-template-columns: 1.2fr 0.8fr
}

@media (max-width: 980px) {
  .topGrid {
    grid-template-columns: 1fr
  }
}

.scoreBig {
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.02em
}

.scoreSub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px
}

.scoreHint {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px
}

.scoreHint b {
  color: white
}

.kpiGrid {
  grid-template-columns: repeat(3, 1fr)
}

@media (max-width: 980px) {
  .kpiGrid {
    grid-template-columns: repeat(2, 1fr)
  }
}

.tabular-head {
  display: grid;
  grid-template-columns: 2.5fr 1.5fr 3.5fr 1fr;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin: 32px 0 16px 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.tabular-row {
  display: grid;
  grid-template-columns: 2.5fr 1.5fr 3.5fr 1fr;
  gap: 20px;
  align-items: center;
  padding-bottom: 20px;
  font-family: inherit;
}

@media (max-width: 760px) {

  .tabular-head,
  .tabular-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .tabular-head>div:nth-child(3),
  .tabular-head>div:nth-child(4) {
    display: none;
  }
}

.section-title {
  font-weight: 900;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.target-pct-label {
  color: #fff;
}

.metric-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.metric-name.bad {
  color: var(--danger);
}

.metric-name.warn {
  color: var(--warn);
}

.metric-name.good {
  color: var(--good);
}

.metric-name.great {
  color: #8b5cf6;
}

.metric-nums {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  text-align: right;
}

.metric-nums b {
  color: white;
  font-weight: 700;
}

.metric-nums.bad b {
  color: var(--danger);
}

.metric-nums.warn b {
  color: var(--warn);
}

.metric-nums.good b {
  color: var(--good);
}

.metric-nums.great b {
  color: #8b5cf6;
}

.bulletGraph {
  height: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
}

.bulletPaceBg {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  z-index: 1;
}

.bulletFill {
  position: relative;
  height: 6px;
  margin-left: 2px;
  border-radius: 4px;
  background: var(--brand);
  z-index: 2;
  transition: width 0.3s ease;
}

.bulletFill.bad {
  background: var(--danger);
}

.bulletFill.warn {
  background: var(--warn);
}

.bulletFill.good {
  background: var(--good);
}

.bulletFill.great {
  background: #8b5cf6;
}

.bulletTick {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 2px;
  background: #fff;
  transform: translateX(-1px);
  z-index: 3;
}

.bulletLine {
  position: absolute;
  top: -24px;
  bottom: -16px;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(-0.5px);
  z-index: 0;
}

.pts-col {
  font-weight: 700;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  text-align: right;
}

.pts-col.bad,
.pts-col.warn {
  color: rgba(255, 255, 255, 0.3);
  font-weight: 400;
}

.pts-col.good,
.pts-col.great {
  color: rgba(255, 255, 255, 0.95);
}

.footer {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap
}

/* Modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 50
}

.modal {
  width: min(720px, 100%);
  border-radius: 18px;
  padding: 16px
}

.modal h2 {
  margin: 0 0 10px 0;
  font-size: 18px
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

@media (max-width: 680px) {
  .row {
    grid-template-columns: 1fr
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0
}

.field label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 800
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  outline: none;
}

input:focus,
textarea:focus {
  border-color: rgba(251, 191, 36, 0.45)
}

textarea {
  min-height: 120px;
  resize: vertical
}

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px
}

.hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65)
}

.help-doc {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.warnBox {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(251, 113, 133, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.25);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  margin-top: 10px
}

/* Light Mode Overrides */
.light-mode .scoreHint {
  color: rgba(15, 23, 42, 0.8);
}

.light-mode .scoreHint b {
  color: #0f172a;
}

.light-mode .tabular-head {
  color: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.light-mode .metric-nums {
  color: rgba(15, 23, 42, 0.6);
}

.light-mode .metric-nums b {
  color: #0f172a;
}

.light-mode .bulletGraph {
  background: rgba(0, 0, 0, 0.08);
}

.light-mode .bulletPaceBg {
  background: rgba(0, 0, 0, 0.08);
}

.light-mode .bulletTick {
  background: #000;
}

.light-mode .bulletLine {
  background: rgba(0, 0, 0, 0.15);
}

.light-mode .pts-col.bad,
.light-mode .pts-col.warn {
  color: rgba(15, 23, 42, 0.4);
}

.light-mode .pts-col.good,
.light-mode .pts-col.great {
  color: rgba(15, 23, 42, 0.95);
}

.light-mode .footer {
  color: rgba(15, 23, 42, 0.6);
}

.light-mode .hint {
  color: rgba(15, 23, 42, 0.65);
}

.light-mode .help-doc {
  color: rgba(15, 23, 42, 0.85);
}

.light-mode .field label {
  color: rgba(15, 23, 42, 0.7);
}

.light-mode input,
.light-mode select,
.light-mode textarea {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: rgba(15, 23, 42, 0.95);
}

.light-mode input:focus,
.light-mode textarea:focus {
  border-color: var(--brand);
}

.light-mode .warnBox {
  color: rgba(15, 23, 42, 0.86);
  background: rgba(225, 29, 72, 0.1);
}

.light-mode .section-title {
  color: rgba(15, 23, 42, 0.75);
}

.light-mode .target-pct-label {
  color: #0f172a;
}

.light-mode .chip {
  color: rgba(15, 23, 42, 0.85);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .brand .hint {
  color: rgba(15, 23, 42, 0.65);
}