/* =========================
   PureMine Design System
   - Single source of truth for typography/colors/radius/shadows
   - No duplicated blocks
   ========================= */

:root{
  --pm-font: "Calibri", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;

  --bg: #f6f5ff;
  --bg2: #f8f8fc;
  --card: rgba(255,255,255,0.92);

  --ink: #241B49;
  --muted: #6B6585;

  --border: rgba(224, 221, 251, 0.95);      /* subtle border */
  --border-strong: rgba(202, 198, 236, 1);  /* inputs */
  --ring: rgba(90, 63, 216, 0.16);

  --accent: #5A3FD8;
  --accent2:#9A70FF;

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.10);
  --shadow: 0 24px 60px rgba(25, 16, 70, 0.18);
}

*{ box-sizing:border-box; }

html, body{
  margin:0;
  padding:0;
  font-family: var(--pm-font);
  color: var(--ink);
  background: radial-gradient(900px 600px at 20% 0%, #efeaff 0%, var(--bg) 60%, var(--bg2) 100%);
}

a{ color: inherit; text-decoration: none; }

/* =========================
   Header (premium pill-nav)
   ========================= */
.site-header{
  position: sticky;
  top:0;
  z-index: 2000;
  backdrop-filter: blur(12px);
  background: radial-gradient(circle at top left, #efe9ff 0, #e7e4ff 42%, rgba(231, 228, 255, 0.9) 100%);
  border-bottom: 1px solid rgba(208, 201, 255, 0.7);
}

.site-header-inner{
  max-width: 1200px;
  margin:0 auto;
  padding: 12px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
}

.brand-logo{
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 10px 22px rgba(58, 41, 130, 0.18);
  background: rgba(255,255,255,0.7);
}

.brand-text{
  display:flex;
  flex-direction:column;
  line-height: 1.1;
}

.brand-name{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #1e153d;
}

.brand-tag{
  font-size:12px;
  color: #837fa7;
  margin-top: 2px;
}

/* pill container around nav links */
.nav{
  display:flex;
  align-items:center;
  gap: 6px;
}

.nav-pillwrap{
  display:inline-flex;
  align-items:center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(25,16,70,0.12);
}

.nav-link{
  font-size: 13px;
  color: #6B6585;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover{
  background: #f2eeff;
  color: #392879;
}

.nav-link.active{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(90, 63, 216, 0.55);
}

.header-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.plan-pill{
  font-size: 11px;
  color:#4b4b73;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(214, 210, 255, 0.9);
  padding: 6px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 880px){
  .nav{ display:none; }
}

/* =========================
   Page shell
   ========================= */
.page{ padding: 18px 0 40px; }
.page-shell{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 18px;
}

/* =========================
   Hero / Cards / Grid
   ========================= */
.hero{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 14px;
}

.hero h1{ margin:0 0 6px; font-size: 22px; }
.hero p{ margin:0; color:var(--muted); font-size: 13px; line-height:1.45; }
.hero-right{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid rgba(217, 212, 255, 0.95);
  background: rgba(246,245,255,0.95);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  color:#3b2f66;
}

.btn{
  border:none;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor:pointer;
  transition: transform 0.06s ease, box-shadow 0.15s ease, filter 0.15s ease;
  font-family: inherit;
}

.btn-primary{
  background: var(--accent);
  color:#fff;
  box-shadow: 0 12px 25px rgba(90, 63, 216, 0.28);
}
.btn-primary:hover{ filter: brightness(1.06); transform: translateY(-1px); }
.btn-primary:active{ transform: translateY(0); }

.btn-ghost{
  background:#fff;
  border:1px solid rgba(217, 212, 255, 0.95);
  color:#3c335c;
  box-shadow: 0 10px 22px rgba(25,16,70,0.05);
}
.btn-ghost:hover{ box-shadow: 0 12px 26px rgba(25,16,70,0.08); transform: translateY(-1px); }
.btn-ghost:active{ transform: translateY(0); }

.grid{
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  align-items: start; 
}
@media (max-width: 950px){
  .grid{ grid-template-columns: 1fr; }
  .hero{ flex-direction:column; align-items:flex-start; }
}

.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
}
.card h2{ margin:0 0 8px; font-size: 16px; }
.card .sub{ margin:0 0 10px; color:var(--muted); font-size: 12px; }

/* =========================
   Inputs / Filters (real focus states)
   ========================= */
.filter-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-bottom: 10px;
}

.input, select, textarea{
  height: 36px;
  border-radius: 999px;
  border:1px solid var(--border-strong);
  padding: 0 12px;
  font-size: 12.5px;
  background: #fff;
  outline: none;
  font-family: inherit;
  color: var(--ink);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

select{
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236B6585' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

textarea{
  height: auto;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.input:focus, select:focus, textarea:focus{
  border-color: rgba(90, 63, 216, 0.55);
  box-shadow: 0 0 0 4px var(--ring);
}

/* =========================
   Alert list
   ========================= */
.alert{
  border:1px solid rgba(227, 224, 250, 0.95);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px 12px;
  box-shadow: 0 10px 22px rgba(25,16,70,0.05);
}
.alert + .alert{ margin-top: 10px; }

.alert-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}

.alert-title{
  font-weight:900;
  font-size: 13px;
  margin:0 0 3px;
}

.alert-meta{
  color: var(--muted);
  font-size: 11.5px;
}

.badges{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:8px;
}

.badge{
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(227, 224, 250, 0.95);
  background: rgba(246,245,255,0.95);
  color:#3b2f66;
  font-family: inherit;
}

.badge-soft{
  background: rgba(126, 87, 194, 0.12);
  border: 1px solid rgba(126, 87, 194, 0.22);
}

.sev{
  min-width: 92px;
  text-align:center;
  font-weight: 900;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(227, 224, 250, 0.95);
  background: linear-gradient(135deg, #ffffff, #f3f2ff);
}
.sev small{ display:block; font-weight:700; color:var(--muted); }

.a-link{
  color: var(--accent);
  text-decoration: underline;
  font-size: 12px;
}

/* =========================
   Context / Accordion / KV
   ========================= */
.context-box{
  font-size: 13.5px;
  line-height: 1.65;
  color: #2C2346;
  background: rgba(126, 87, 194, 0.06);
  border: 1px solid rgba(126, 87, 194, 0.18);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Frameless (Signal sentence / Article context / Exposure / Mechanism) */
.context-wrap{
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;

  font-size: 13.5px;
  line-height: 1.65;
  color: #2C2346;

  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.acc{
  border: 1px solid rgba(44, 35, 70, 0.10);
  border-radius: 14px;
  background: rgba(255,255,255,0.70);
  padding: 10px 12px;
  width: 100%;
}

.acc-head{
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  color: #2C2346;
}

.acc-head::-webkit-details-marker{ display:none; }

.acc-body{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(44, 35, 70, 0.08);
}

.kv{
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
  padding: 8px 0;
}

.kv-k{
  font-weight: 800;
  color: #2C2346;
  opacity: 0.85;
  font-size: 13px;
}

.kv-v{
  color: #2C2346;
  font-size: 13px;
  line-height: 1.6;
}

/* Summary emphasis */
.kv-summary .kv-k{ font-weight: 900; font-size: 13.5px; }
.kv-summary .kv-v{ font-weight: 400; font-size: 14px; line-height: 1.55; }

.bullets, .steps{ margin: 0; padding-left: 18px; }
.bullets-small{ font-size: 12.5px; line-height: 1.55; }

/* =========================
   Footer
   ========================= */
.site-footer{
  border-top:1px solid rgba(236,233,255,0.9);
  background: rgba(246,245,255,0.85);
}

.site-footer-inner{
  max-width: 1200px;
  margin:0 auto;
  padding: 14px 18px;
  display:flex;
  justify-content:space-between;
  gap: 12px;
  color: #4c446a;
  font-size: 12px;
}

.muted{ color: var(--muted); }

/* =========================
   Settings: compact subscription row
   ========================= */
.compact-row{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 10px;
}

.compact-row .field{
  display:flex;
  flex-direction:column;
  gap: 6px;
  min-width: 190px;
}

.compact-row .field-label{
  margin:0;
  font-size: 12px;
  color: var(--muted);
}

.threshold-input{
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  padding: 0 12px;
  font-size: 12.5px;
  background: #fff;
  outline: none;
  font-family: inherit;
  color: var(--ink);
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: textfield;
  text-align: center;
  width: 90px;
}

/* Remove number input spinners in Chrome/Safari */
.threshold-input::-webkit-inner-spin-button,
.threshold-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.threshold-input:focus{
  border-color: rgba(90, 63, 216, 0.55);
  box-shadow: 0 0 0 4px var(--ring);
}

.compact-row .helper{
  margin:0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.2;
}

.compact-row .actions{
  display:flex;
  align-items:flex-end;
  padding-bottom: 1px;
}

/* ------- Choices.js: align with system ------- */
.choices{ font-family: inherit; }

.choices__inner{
  min-height: 36px !important;
  padding: 6px 12px !important;
  border-radius: 999px !important;
  border: 1px solid var(--border-strong) !important;
  background: #fff !important;
  box-shadow: none !important;
}

.choices__item--selectable{
  font-size: 12.5px !important;
  color: var(--ink) !important;
}

.choices.is-focused .choices__inner,
.choices.is-open .choices__inner{
  border-color: rgba(90, 63, 216, 0.55) !important;
  box-shadow: 0 0 0 4px var(--ring) !important;
}

.choices__list--dropdown,
.choices__list[aria-expanded]{
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border) !important;
  background: var(--card) !important;
  box-shadow: var(--shadow-soft) !important;
  padding: 10px !important;
}

.choices__list--dropdown .choices__input{
  height: 34px !important;
  border-radius: 999px !important;
  border: 1px solid var(--border-strong) !important;
  padding: 0 12px !important;
  font-size: 12.5px !important;
}

/* =========================================================
   Evidence completeness tooltip (click toggle, no JS)
   ========================================================= */
.kv-tip{
  position: relative;
}

.help-tip-toggle{
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: 0;
}

.help-tip{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(120, 90, 200, 0.35);
  background: rgba(120, 90, 200, 0.08);
  color: inherit;
  user-select: none;
}

.help-tip:focus{
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

.help-tip-pop{
  display: none;
  position: absolute;
  z-index: 5000;
  top: calc(100% + 8px);
  left: 0;

  max-width: 360px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(120, 90, 200, 0.25);

  background: #ffffff;
  opacity: 1;

  box-shadow: 0 16px 40px rgba(0,0,0,0.14);
  color: #1f1f1f;

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 500;
  line-height: 1.35;
}

.help-tip-toggle:checked ~ .help-tip-pop{
  display: block;
}

.help-tip-pop-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 6px;
}

.help-tip-pop-title{
  font-weight: 700;
  font-size: 12.5px;
  color:#1e153d;
}

.help-tip-close{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid rgba(120, 90, 200, 0.25);
  background: #fff;
  color:#2C2346;
  font-size: 14px;
  line-height: 1;
}

.help-tip-pop-body{
  font-size: 12.5px;
  color:#2a2440;
}

@media (max-width: 640px){
  .help-tip-pop{ max-width: 92vw; }
}

/* =========================================================
   Plain text block (no box, no border, no fill)
   ========================================================= */
.plain-block{
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  color: #2C2346;
  font-size: 13.5px;
  line-height: 1.65;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* =========================================================
   Card head helpers (makes sections look like your screenshot)
   ========================================================= */
.card-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.card-title{ margin:0; font-size: 16px; }
.card-meta{ color: var(--muted); font-weight: 800; }
.card-rule{
  height: 1px;
  background: rgba(44,35,70,0.06);
  margin: 10px 0 12px;
}

/* Slightly tighter KV in Evidence */
.kv-evidence{ padding: 10px 0; }
.kv-evidence .kv-k{
  display:flex;
  align-items:center;
  gap: 6px;
}

/* =========================================================
   Decision readiness v4 (dr4)
   - One “scale” only (no duplicated bars)
   - No invented numbers (no % shown)
   - Chips + checkmarks (designed)
   - State snapping via drStateWeak/Medium/Strong
   ========================================================= */
.dr4{
  padding: 2px 0 2px;
}

.dr4-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.dr4-left{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap:wrap;
}

/* small status badge (not your old big “Strong pill”) */
.dr4-status{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(217, 212, 255, 0.95);
  background: rgba(246,245,255,0.95);
  color: #2C2346;
}

.drStateWeak   .dr4-status{ border-color: rgba(202,198,236,1); background: rgba(255,255,255,0.92); color:#5f5a78; }
.drStateMedium .dr4-status{ border-color: rgba(90,63,216,0.20); background: rgba(90,63,216,0.08); }
.drStateStrong .dr4-status{ border-color: rgba(90,63,216,0.24); background: rgba(90,63,216,0.10); }

/* Scale container */
.dr4-scale{
  position: relative;
  padding-bottom: 18px; /* room for tick labels */
}

/* 3-zone track */
.dr4-track{
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(36,27,73,0.10);
  background: rgba(36,27,73,0.06);
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.dr4-zone{ height: 100%; opacity: 0.95; }

.dr4-zone-weak{
  background: linear-gradient(90deg, rgba(36,27,73,0.06), rgba(36,27,73,0.08));
}
.dr4-zone-medium{
  background: linear-gradient(90deg, rgba(90,63,216,0.10), rgba(90,63,216,0.14));
}
.dr4-zone-strong{
  background: linear-gradient(90deg, rgba(90,63,216,0.18), rgba(154,112,255,0.26));
}

/* Marker snap (no %; only indicates the backend label position) */
.dr4-marker{
  position:absolute;
  top: -4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid rgba(90,63,216,0.85);
  box-shadow: 0 10px 22px rgba(25,16,70,0.12);
  transform: translateX(-50%);
  left: 16.6%;
}

.drStateWeak   .dr4-marker{ left: 16.6%; border-color: rgba(120,110,160,0.75); }
.drStateMedium .dr4-marker{ left: 50%;   border-color: rgba(90,63,216,0.75); }
.drStateStrong .dr4-marker{ left: 83.4%; border-color: rgba(90,63,216,0.90); }

/* Tick labels */
.dr4-ticks{
  position:absolute;
  left:0;
  right:0;
  top: 16px;
  display:flex;
  justify-content:space-between;
  pointer-events:none;
}

.dr4-tick{
  font-size: 12px;
  font-weight: 800;
  color: #6B6585;
}

.drStateWeak   .dr4-tick:nth-child(1){ color:#2C2346; }
.drStateMedium .dr4-tick:nth-child(2){ color:#2C2346; }
.drStateStrong .dr4-tick:nth-child(3){ color:#2C2346; }

/* Explanatory note (from backend) */
.dr4-note{
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #2C2346;
  opacity: 0.90;
}

/* Checks row: chips + check */
.dr4-checks{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin-top: 10px;
}

.dr4-chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(217, 212, 255, 0.95);
  background: rgba(255,255,255,0.92);
  color: #5f5a78;
}

.dr4-chip.isOn{
  border-color: rgba(90,63,216,0.22);
  background: rgba(90,63,216,0.08);
  color: #2C2346;
}
.dr4-chip.isOff{ opacity: 0.55; }

/* Check icon (CSS only) */
.dr4-icon{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(120, 90, 200, 0.28);
  background: rgba(120, 90, 200, 0.06);
  position: relative;
  flex: 0 0 18px;
}

.dr4-chip.isOn .dr4-icon{
  border-color: rgba(90,63,216,0.30);
  background: rgba(90,63,216,0.10);
}
.dr4-chip.isOn .dr4-icon::after{
  content:"";
  position:absolute;
  left: 5px;
  top: 3px;
  width: 6px;
  height: 10px;
  border-right: 2px solid rgba(90,63,216,0.95);
  border-bottom: 2px solid rgba(90,63,216,0.95);
  transform: rotate(45deg);
}

.dr4-chip.isOff .dr4-icon::after{
  content:"";
  position:absolute;
  inset:0;
  margin:auto;
  width: 8px;
  height: 2px;
  background: rgba(120,110,160,0.55);
  border-radius: 2px;
}

/* Optional: keep driver block from looking like a nested card */
.dr4-subtle{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(44,35,70,0.08);
}
.kv-drivers{ padding: 0; }
.kv-drivers .kv-k{ opacity: 0.85; }

@media (max-width: 640px){
  .dr4-tick{ font-size: 11.5px; }
  .dr4-note{ font-size: 13px; }
}
/* =========================================================
   Decision readiness (drx3) — DISCRETE 3-LEVEL (INLINE HEAD+GRAPH)
   目标：
   - Decision readiness 与 graph 同一行
   - 三段颜色：Weak 最浅 / Med 中紫 / Strong 最深
   - graph 上方不显示任何 level 标签（Strong 那个）
   ========================================================= */

.drx.drx3{
  padding: 2px 0 2px;

  /* 关键：两列布局，让 head(左) + bar(右) 同行 */
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 14px;
  align-items: start; /* 顶部对齐更像你截图 */
}

/* 头部放左列 */
.drx.drx3 .drx-head{
  grid-column: 1;
  display:flex;
  align-items:center;           /* 让标题和 ? 在一条线上 */
  justify-content:flex-start;
  gap: 10px;
  margin: 0;                    /* 取消原来的 margin-bottom:10px，避免把 graph 往下顶 */
}

/* title 内部不换行（否则左列高度变大，会影响对齐观感） */
.drx.drx3 .drx-title{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: nowrap;
}

/* Stage pill 保留（如你还在用） */
.drx.drx3 .drx-pill-ghost{
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(217, 212, 255, 0.95);
  color: #5f5a78;
  font-weight: 800;
  display:inline-flex;
  align-items:center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 1;
}

/* 右侧 Strong 标签：你要求 graph 上面不要任何标签 -> 直接隐藏 */
.drx.drx3 .drx-level,
.drx.drx3 .drx-level-text{
  display: none !important;
}

/* ---- Graph 放右列，并且顶到同一行 ---- */
.drx3-bar{
  grid-column: 2;
  margin: 0;                    /* 原来 margin:6px 0 10px 会让它下沉 */
  padding-top: 2px;             /* 微调：让 bar 和标题视觉上更齐（可 0~4px 调） */
}

/* 3-step segmented bar */
.drx3-track{
  position: relative;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;

  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 3px;

  /* track 外围底色与边线（更“干净”） */
  background: rgba(36,27,73,0.05);
  box-shadow: inset 0 0 0 1px rgba(36,27,73,0.08);
}

/* 三段固定深浅（不靠 is-on 渐变来“假装”） */
.drx3-seg{
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(90,63,216,0.10);
}

/* Weak：最浅紫 */
.drx3-seg:nth-child(1){
  background: rgba(90,63,216,0.16);
}

/* Med：中紫 */
.drx3-seg:nth-child(2){
  background: rgba(90,63,216,0.34);
}

/* Strong：最深紫 */
.drx3-seg:nth-child(3){
  background: rgba(90,63,216,0.62);
}

/* 如果你还会给命中的段加 .is-on：只做“轻微强调”，不要改变深浅逻辑 */
.drx3-seg.is-on{
  filter: saturate(1.05);
  box-shadow:
    inset 0 0 0 1px rgba(90,63,216,0.18),
    0 8px 16px rgba(90,63,216,0.10);
}

/* Indicator dot pinned to segment centers (categorical) */
.drx3-ind{
  position:absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid rgba(90, 63, 216, 0.90);
  box-shadow: 0 10px 18px rgba(90, 63, 216, 0.16);
}

/* Centers: 1/6, 3/6, 5/6 */
.drx3-ind-1{ left: 16.66%; }
.drx3-ind-2{ left: 50%; }
.drx3-ind-3{ left: 83.33%; }

/* labels 也归到右列（跟 graph 对齐） */
.drx3-labels{
  grid-column: 2;               /* 关键：labels 也在右列 */
  display:flex;
  justify-content:space-between;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  padding: 0 2px;
}

/* Meaning line（backend note）：占满整行，放到下一行更自然 */
.drx.drx3 .drx-meaning{
  grid-column: 1 / -1;
  color: #2C2346;
  opacity: 0.85;
  font-size: 12.5px;
  line-height: 1.45;
  margin: 8px 0 10px;
}

/* Chips 也占满整行 */
.drx-chips{
  grid-column: 1 / -1;
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  align-items:center;
}

/* ---- 你原来的 chip 样式保留即可（下面这段你可以原样不动） ---- */
.drx-chip{
  position: relative;
  display:inline-flex;
  align-items:center;
  padding: 6px 10px 6px 28px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(217, 212, 255, 0.95);
  background: rgba(246,245,255,0.85);
  color: #4a4164;
}

.drx-chip::before{
  content: "";
  position:absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(36,27,73,0.10);
  background: rgba(36,27,73,0.06);
}

.drx-chip::after{
  content: "";
  position:absolute;
  left: 12px;
  top: 50%;
  width: 8px;
  height: 4px;
  border-left: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: translateY(-55%) rotate(-45deg);
  opacity: 0;
}

.drx-chip.is-on{
  border-color: rgba(90, 63, 216, 0.22);
  background: rgba(90, 63, 216, 0.08);
  color: #2C2346;
}

.drx-chip.is-on::before{
  background: rgba(90, 63, 216, 0.14);
  box-shadow: inset 0 0 0 1px rgba(90, 63, 216, 0.22);
}

.drx-chip.is-on::after{
  border-left-color: rgba(90, 63, 216, 0.95);
  border-bottom-color: rgba(90, 63, 216, 0.95);
  opacity: 1;
}

.drx-chip.is-off{ opacity: 0.55; }

/* 小屏自动换行：标题和 graph 竖排更合理 */
@media (max-width: 720px){
  .drx.drx3{
    grid-template-columns: 1fr;
    row-gap: 8px;
  }
  .drx.drx3 .drx-head{ grid-column: 1; }
  .drx3-bar{ grid-column: 1; padding-top: 0; }
  .drx3-labels{ grid-column: 1; }
}

/* =========================================================
   Drivers (trigger hits) — clean, no nested boxes
   - 一行概览 + 可展开小节
   - 不再画内层框：只用留白 + 细竖线引导层级
   ========================================================= */

.kv-drivers{ padding-top: 2px; }

.drv{
  display:flex;
  flex-direction:column;
  gap: 10px;
}

/* 顶部概览 pills（轻量，不像 badge 那么“重”） */
.drv-summary{
  display:flex;
  flex-wrap:wrap;
  gap: 6px;
  margin-top: 2px;
}

.drv-pill{
  display:inline-flex;
  align-items:center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  color: #4a4164;
  background: rgba(36,27,73,0.04);
  box-shadow: inset 0 0 0 1px rgba(36,27,73,0.08);
}

/* 小节：不画框，不填充背景 */
.drv-sec{
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
}

.drv-sec > summary::-webkit-details-marker{ display:none; }

.drv-head{
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  cursor:pointer;

  font-weight: 900;
  color: #2C2346;
  padding: 2px 0;
}

/* 标题左侧 + 右侧 count */
.drv-title{
  font-size: 12.5px;
  letter-spacing: 0.2px;
}

.drv-meta{
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
}

/* 右侧小箭头（不增加框，只提示可展开） */
.drv-head::after{
  content: "▾";
  font-size: 12px;
  color: rgba(44,35,70,0.55);
  margin-left: 10px;
  transform: rotate(-90deg);
  transition: transform 0.12s ease;
}
.drv-sec[open] > .drv-head::after{ transform: rotate(0deg); }

/* 内容区：用细竖线做层级，不是“框” */
.drv-body{
  margin-top: 6px;
  padding-left: 12px;
  border-left: 2px solid rgba(90,63,216,0.12);
}

/* 结构化行：Tag hits / Metal hits / Country hits */
.drv-row{
  display:grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
  padding: 6px 0;
}

.drv-row-k{
  font-size: 12.5px;
  font-weight: 900;
  color: rgba(44,35,70,0.88);
}

.drv-row-v{
  min-width: 0;
}

.drv-chips{
  display:flex;
  flex-wrap:wrap;
  gap: 6px;
  margin-top: 0;
}

/* Boost/Soft list：更紧凑，更像“解释条目” */
.drv-list{
  margin: 0;
  padding-left: 18px;
}

.drv-list li{
  margin: 6px 0;
}

.drv-key{
  font-weight: 900;
  color: #2C2346;
}

.drv-snippet{
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 小屏优化 */
@media (max-width: 720px){
  .drv-row{ grid-template-columns: 1fr; }
  .drv-row-k{ opacity: 0.85; }
}

/* ===== Drivers scheme A: one-line summary, expandable ===== */
.drvA{
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
}

.drvA > summary::-webkit-details-marker{ display:none; }

.drvA-sum{
  list-style:none;
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  padding: 2px 0;
}

.drvA-label{
  font-weight: 900;
  color: rgba(44,35,70,0.88);
  white-space: nowrap;
}

.drvA-chev{
  margin-left:auto;
  color: rgba(44,35,70,0.55);
  transform: rotate(-90deg);
  transition: transform 0.12s ease;
}

.drvA[open] .drvA-chev{ transform: rotate(0deg); }

.drvA-body{
  margin-top: 8px;
}

/* hero second-line meta */
.hero-meta2{
  margin-top: 6px;
}

/* Trigger evidence tabs (gray style, reuse badge visuals) */
.drvTabs{ margin-top: 2px; }

.drvTab-input{
  position:absolute;
  width:1px; height:1px;
  overflow:hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.drvTabbar{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  align-items:center;
  margin: 2px 0 10px;
}

/* labels are badges; just make them clickable */
.drvTab{ cursor:pointer; user-select:none; }

/* panel container: keep your “no nested box” vibe */
.drvPanels{
  margin-top: 2px;
  padding-left: 12px;
  border-left: 2px solid rgba(90,63,216,0.12);
}

/* default hidden; shown by the uid-scoped <style> block */
.drvPanel{ display:none; }

.drvGrid{
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.drvRow{
  display:grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items:start;
}

.drvKey{
  font-size: 13px;
  font-weight: 900;
  color: rgba(44,35,70,0.90);
}

.drvVal{ min-width:0; }

.drvSnippet{
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.drvSubhead{
  font-size: 12px;
  font-weight: 900;
  color: rgba(44,35,70,0.85);
  margin-bottom: 6px;
}

.drv-hint{
  margin-top: 6px;
  margin-bottom: 6px;
  color: rgba(20,20,20,0.42);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;   
  max-width: none;       
}



.drvList{ margin:0; padding-left:18px; }
.drvList li{ margin: 6px 0; }
.drvKeyInline{ font-weight: 900; color: #2C2346; }

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

/* optional */
.price {
  font-weight: 900;
  font-size: 22px;
}
.price small {
  font-weight: 700;
  color: var(--muted);
}
.fb-group{
  margin-top:10px;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.fb-btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(130,110,255,.20);
  background:rgba(255,255,255,.70);
  color:#2A2550;
  font-weight:800;
  font-size:12px;
  cursor:pointer;
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}

.fb-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 16px rgba(30, 20, 70, .08);
}

.fb-btn.is-active{
  border-color:rgba(130,110,255,.55);
  background:linear-gradient(180deg, rgba(130,110,255,.18), rgba(130,110,255,.10));
  box-shadow:0 10px 22px rgba(90,63,216,.12);
}

.fb-btn--relevant.is-active{ border-color: rgba(46, 204, 113, .55); background: linear-gradient(180deg, rgba(46,204,113,.18), rgba(46,204,113,.10)); }
.fb-btn--noise.is-active{ border-color: rgba(243, 156, 18, .65); background: linear-gradient(180deg, rgba(243,156,18,.22), rgba(243,156,18,.10)); }
.fb-btn--missed.is-active{ border-color: rgba(231, 76, 60, .55); background: linear-gradient(180deg, rgba(231,76,60,.18), rgba(231,76,60,.10)); }

.fb-status{
  font-size:11px;
  color:#6C6393;
  font-weight:800;
  padding-left:6px;
}

/* =========================
   Dashboard: Today-by-metal tiles
   ========================= */
.daily-tiles{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.metal-tile{
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(246,245,255,0.70);
}

.metal-tile-top{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.metal-name{
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
}

.metal-date{
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.metal-counts{
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid rgba(217, 212, 255, 0.95);
  background: #fff;
}

/* Strong / Watch */
.chip-strong{
  border-color: rgba(231,76,60,0.25);
  background: rgba(231,76,60,0.06);
  color: #b42318;
}
.chip-watch{
  border-color: rgba(243,156,18,0.30);
  background: rgba(243,156,18,0.07);
  color: #b45309;
}
