/* =========================================================
   BIWWEC 2026 — Water Quality Awareness Dashboard
   Clean · modern · blue water palette
   ========================================================= */

:root {
  --navy: #0a2e4a;
  --navy-deep: #061f33;
  --blue: #0b6e99;
  --blue-mid: #1287b8;
  --cyan: #1ab0d4;
  --aqua: #3dd6f5;
  --sky: #e8f6fc;
  --mist: #f4fafc;
  --white: #ffffff;
  --ink: #1a2b3c;
  --muted: #5a7080;
  --line: #d5e6ef;
  --pass: #0d9f6e;
  --pass-bg: #e6faf2;
  --fail: #d64545;
  --fail-bg: #fdecec;
  --warn: #d97706;
  --warn-bg: #fff7e8;
  --soft: #64748b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 30px rgba(10, 46, 74, 0.08);
  --shadow-lg: 0 20px 50px rgba(10, 46, 74, 0.12);
  --font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Cascadia Code', 'SF Mono', Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--mist);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--blue);
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

/* ---------- Waves background ---------- */
.bg-waves {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(26, 176, 212, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(11, 110, 153, 0.12), transparent),
    linear-gradient(180deg, #f0f9fc 0%, var(--mist) 40%, #eef7fa 100%);
}

.bg-waves svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 180px;
  opacity: 0.35;
}

/* ---------- Shell ---------- */
.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(213, 230, 239, 0.8);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

/* ---- Hamburger menu ---- */
.menu-wrap {
  position: relative;
}

.hamburger {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--navy);
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  transition: background 0.2s;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hamburger:hover {
  background: var(--blue);
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(10, 46, 74, 0.18);
  min-width: 200px;
  padding: 0.4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 300;
}

.menu-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.menu-item:hover {
  background: var(--sky);
  color: var(--blue);
}

.menu-item.active {
  background: var(--blue);
  color: #ffffff;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

.sync-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
}

.sync-pill.live .dot {
  background: var(--pass);
  box-shadow: 0 0 0 3px rgba(13, 159, 110, 0.25);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(13, 159, 110, 0.35);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(13, 159, 110, 0);
  }
}

/* ---------- Partner logo ---------- */
.partner-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.partner-logo img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.partner-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

/* ---------- Views ---------- */
.view {
  display: none;
  padding-top: 1.75rem;
}

.view.active {
  display: block;
}

.view-header {
  margin-bottom: 1.5rem;
}

.view-header h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  color: var(--navy);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.view-header p {
  color: var(--muted);
  max-width: 42rem;
  font-size: 0.95rem;
}

/* ---------- Cards / panels ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.5rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .grid-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .grid-stats {
    grid-template-columns: 1fr 1fr;
  }
  .nav-tabs {
    width: 100%;
    overflow-x: auto;
  }
}

/* ---------- Stat tiles ---------- */
.stat-tile {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-tile::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at top right, rgba(26, 176, 212, 0.15), transparent 70%);
  pointer-events: none;
}

.stat-tile .label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-tile .value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: 0.25rem;
}

.stat-tile .hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.stat-tile.safe .value {
  color: var(--pass);
}
.stat-tile.unsafe .value {
  color: var(--fail);
}

/* ---------- Form ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--navy);
}

.field label .unit {
  font-weight: 500;
  color: var(--muted);
}

.field label .req {
  color: var(--fail);
}

.field input,
.field select {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  background: var(--mist);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--cyan);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(26, 176, 212, 0.2);
}

.field .help {
  font-size: 0.72rem;
  color: var(--muted);
}

.field-range {
  font-size: 0.72rem;
  color: var(--blue);
  font-weight: 600;
}

/* Guess block */
.guess-block {
  margin-top: 0.5rem;
  padding: 1.15rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eef8fc, #e8f4f9);
  border: 1px dashed var(--cyan);
}

.guess-block h3 {
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.guess-block p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.guess-options {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.guess-option {
  flex: 1;
  min-width: 140px;
  position: relative;
}

.guess-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.guess-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: var(--white);
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
  transition: 0.15s ease;
}

.guess-option input:checked + label {
  border-color: var(--blue);
  background: var(--sky);
  box-shadow: 0 0 0 3px rgba(11, 110, 153, 0.15);
}

.guess-option.safe input:checked + label {
  border-color: var(--pass);
  background: var(--pass-bg);
  color: var(--pass);
}

.guess-option.unsafe input:checked + label {
  border-color: var(--fail);
  background: var(--fail-bg);
  color: var(--fail);
}

/* Buttons */
.btn-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.4rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-mid), var(--blue));
  color: var(--white);
  box-shadow: 0 8px 20px rgba(11, 110, 153, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 10px 28px rgba(11, 110, 153, 0.4);
}

.btn-ghost {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--blue);
}

.btn-danger {
  background: var(--fail-bg);
  color: var(--fail);
  border: 1.5px solid #f5c2c2;
}

.btn-danger:hover {
  background: #fad4d4;
}

/* ---------- Result reveal modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 31, 51, 0.55);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-hero {
  text-align: center;
  padding: 1rem 0 1.25rem;
}

.modal-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 0.85rem;
  display: grid;
  place-items: center;
  font-size: 2rem;
}

.modal-badge.correct {
  background: var(--pass-bg);
  color: var(--pass);
}

.modal-badge.wrong {
  background: var(--fail-bg);
  color: var(--fail);
}

.modal-hero h3 {
  font-size: 1.35rem;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.modal-hero p {
  color: var(--muted);
  font-size: 0.92rem;
}

.verdict-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.verdict-chip.safe {
  background: var(--pass-bg);
  color: var(--pass);
}

.verdict-chip.unsafe {
  background: var(--fail-bg);
  color: var(--fail);
}

.param-checks {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 1.15rem 0;
}

.param-check {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--mist);
  font-size: 0.85rem;
}

.param-check .name {
  font-weight: 650;
  color: var(--navy);
}

.param-check .val {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink);
}

.param-check .status {
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.param-check .status.pass {
  background: var(--pass-bg);
  color: var(--pass);
}
.param-check .status.fail {
  background: var(--fail-bg);
  color: var(--fail);
}
.param-check .status.soft {
  background: var(--warn-bg);
  color: var(--warn);
}
.param-check .status.missing {
  background: #eef2f6;
  color: var(--soft);
}

/* ---------- Dashboard feed ---------- */
.feed-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.feed-toolbar .filters {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-chip {
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

.filter-chip.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.submission-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sub-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem 1.25rem;
  align-items: start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sub-card:hover {
  box-shadow: var(--shadow-lg);
}

.sub-card .who {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--cyan), var(--blue));
  color: white;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.who-text .name {
  font-weight: 750;
  color: var(--navy);
  font-size: 1rem;
}

.who-text .meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.sub-verdicts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.mini-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.mini-chip.safe {
  background: var(--pass-bg);
  color: var(--pass);
}
.mini-chip.unsafe {
  background: var(--fail-bg);
  color: var(--fail);
}
.mini-chip.guess-ok {
  background: #eef2ff;
  color: #4338ca;
}
.mini-chip.guess-miss {
  background: var(--warn-bg);
  color: var(--warn);
}

.param-pills {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  font-size: 0.72rem;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  background: var(--mist);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
}

.pill.pass {
  border-color: #b8ebd6;
  background: var(--pass-bg);
  color: #0a7a55;
}
.pill.fail {
  border-color: #f5c2c2;
  background: var(--fail-bg);
  color: #b33a3a;
}
.pill.soft {
  border-color: #fde68a;
  background: var(--warn-bg);
  color: #b45309;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
}

.empty-state .icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.empty-state h3 {
  color: var(--navy);
  margin-bottom: 0.35rem;
}

/* ---------- Standards table ---------- */
.standards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.std-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--cyan);
}

.std-card h3 {
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.std-card .range {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.02em;
  margin: 0.5rem 0;
}

.std-card p {
  font-size: 0.85rem;
  color: var(--muted);
}

.std-card .std-explain {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.55;
}

.std-card .std-trivia {
  margin-top: 0.75rem;
  padding: 0.65rem 0.8rem;
  background: #fef9ec;
  border-radius: var(--radius-sm);
  border-left: 3px solid #f59e0b;
  font-size: 0.78rem;
  color: #92400e;
  line-height: 1.5;
}

.std-card .std-trivia .trivia-label {
  display: block;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #d97706;
  margin-bottom: 0.2rem;
}

.std-card .src {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--blue-mid);
}

.note-box {
  margin-top: 1.25rem;
  padding: 1rem 1.2rem;
  background: var(--sky);
  border-radius: var(--radius);
  border-left: 4px solid var(--cyan);
  font-size: 0.88rem;
  color: var(--ink);
}

/* ---------- Live wall (fullscreen-ish dashboard) ---------- */
.wall-banner {
  background: linear-gradient(120deg, var(--navy-deep), var(--blue) 55%, var(--cyan));
  color: white;
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.wall-banner::before {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.wall-banner h2 {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
}

.wall-banner p {
  opacity: 0.88;
  margin-top: 0.25rem;
  position: relative;
  font-size: 0.95rem;
}

/* ---------- Manual entry hint ---------- */
.mode-hint {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  background: var(--sky);
  border-radius: var(--radius-sm);
  margin-bottom: 1.15rem;
  font-size: 0.85rem;
  color: var(--navy);
}

.mode-hint strong {
  display: block;
  margin-bottom: 0.15rem;
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1280px;
  margin: 2rem auto 0;
  padding: 1.25rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--blue);
  font-weight: 600;
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* GSAP will control these starts */
.gsap-hide {
  opacity: 0;
  transform: translateY(16px);
}

/* ---------- Scale visualization ---------- */
.scale-row {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--mist);
  margin-bottom: 0.65rem;
}

.scale-row:last-child {
  margin-bottom: 0;
}

.scale-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.scale-name {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.88rem;
  flex: 1;
}

.scale-reading {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
}

.scale-reading.pass {
  color: var(--pass);
}
.scale-reading.fail {
  color: var(--fail);
}

.scale-status {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.scale-status.pass {
  background: var(--pass-bg);
  color: var(--pass);
}
.scale-status.fail {
  background: var(--fail-bg);
  color: var(--fail);
}
.scale-status.missing {
  background: #eef2f6;
  color: var(--soft);
}

.scale-track {
  position: relative;
  height: 28px;
  background: #eef2f6;
  border-radius: 8px;
  overflow: visible;
  margin-bottom: 0.35rem;
}

.scale-zone-out {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--fail-bg) 0%, transparent 0%, transparent 100%, var(--fail-bg) 100%);
  border-radius: 8px;
}

.scale-band {
  position: absolute;
  top: 0;
  height: 100%;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border: 2px solid #6ee7b7;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.scale-band-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: #047857;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.scale-marker {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 3px;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scale-marker.pass {
  background: var(--pass);
}
.scale-marker.fail {
  background: var(--fail);
}

.scale-marker-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid var(--white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  position: relative;
  top: -3px;
}

.scale-marker.pass .scale-marker-pin {
  background: var(--pass);
}
.scale-marker.fail .scale-marker-pin {
  background: var(--fail);
}

.scale-marker-val {
  position: absolute;
  bottom: -20px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--navy);
  background: var(--white);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.scale-axis {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
  padding: 0 0.15rem;
}

.scale-axis-ok {
  font-size: 0.65rem;
  color: var(--pass);
  font-weight: 700;
  text-align: center;
}

/* ---------- Scale compact variant (Live Board cards) ---------- */
.sub-scales {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

@media (max-width: 640px) {
  .sub-scales {
    grid-template-columns: 1fr;
  }
}

.scale-compact {
  padding: 0.5rem 0.65rem;
  margin-bottom: 0;
  border-radius: 8px;
}

.scale-compact .scale-head {
  margin-bottom: 0.35rem;
}

.scale-compact .scale-name {
  font-size: 0.75rem;
}

.scale-compact .scale-reading {
  font-size: 0.72rem;
}

.scale-compact .scale-status {
  font-size: 0.6rem;
  padding: 0.1rem 0.3rem;
}

.scale-compact .scale-track {
  height: 18px;
  border-radius: 6px;
}

.scale-compact .scale-band {
  border-radius: 6px;
}

.scale-compact .scale-band-label {
  font-size: 0.55rem;
}

.scale-compact .scale-marker-pin {
  width: 10px;
  height: 10px;
  border-width: 2px;
}

.scale-compact .scale-marker-val {
  font-size: 0.58rem;
  bottom: -16px;
}

.scale-compact .scale-axis {
  font-size: 0.58rem;
}

.scale-compact .scale-axis-ok {
  font-size: 0.55rem;
}
