/* ==== Material-ish theme (dark, turquoise) ================================= */
:root{
  --bg:#0b1113;           /* slightly richer base for MD contrast */
  --bg2:#090e10;
  --surface:#0f1719;      /* surfaces (cards/panels) */
  --surface-2:#121d20;    /* higher elevation */
  --ink:#e7fffa;          /* on-surface text */
  --muted:#a7dcd2;
  --primary:#2dd4bf;      /* MD primary */
  --primary-600:#14b8a6;  /* hover */
  --primary-700:#0d9488;  /* active/pressed */
  --outline:#1f3f43;      /* outline/borders */
  --outline-2:#244a4e;
  --success:#22c55e;
  --warn:#eab308;
  --error:#ef4444;
  --brand-green: #0d3b2e;   /* your dark green */
  --brand-green-dark: #0a2a21;

  /* elevation (Google MD inspired) */
  --elev-1: 0 1px 2px rgba(0,0,0,.28), 0 1px 1px rgba(0,0,0,.2);
  --elev-2: 0 3px 6px rgba(0,0,0,.30), 0 2px 4px rgba(0,0,0,.22);
  --elev-3: 0 6px 12px rgba(0,0,0,.32), 0 3px 6px rgba(0,0,0,.24);
}

/* ==== Base ================================================================== */
*{box-sizing:border-box}
html,body{height:100%}

body.bg{
  margin:0;
  color:var(--ink);
  font: 400 14px/1.45 ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial;
  background:
    radial-gradient(1200px 600px at 20% -10%, #0d3b3f55, transparent 60%),
    radial-gradient(900px 500px at 80% -20%, #0b2e314d, transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  transition: opacity 0.3s ease;
}

body.loaded{
  opacity: 1;
}

.app-container{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==== Brand Header ========================================================== */
.brand-header{
  padding:24px 16px 16px;
  background: linear-gradient(135deg, rgba(45,212,191,.08), rgba(20,184,166,.04));
  border-bottom: 1px solid var(--outline);
}
.brand-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.brand-content{
  display:flex; align-items:center; justify-content:center;
  position:relative;
  flex: 1;
}

.brand-text{
  text-align:center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.brand-title{
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  letter-spacing: -0.5px;
}

.brand-tagline{
  color:var(--muted); margin:0; font-size:14px; font-weight:500;
  letter-spacing:.3px; text-transform:uppercase;
}

.logout-btn{
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--outline);
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.logout-btn:hover{
  background: var(--error);
  color: white;
  border-color: var(--error);
  transform: translateY(-1px);
  box-shadow: var(--elev-1);
}

.logout-icon{
  font-size: 16px;
}

.logout-text{
  font-size: 13px;
}

/* ==== Hero / Header ========================================================= */
.hero{ padding:48px 16px 40px }
.hero-inner{ max-width:980px; margin:0 auto; text-align:center }
.hero-title{ font-size:48px; letter-spacing:.2px; margin:0 0 8px; font-weight:800 }
.hero-sub{ color:var(--muted); margin:0 0 24px }

/* ==== Results Header ======================================================= */
.results-header{ 
  padding:20px 16px; 
  background: var(--surface);
  border-bottom: 1px solid var(--outline);
  box-shadow: var(--elev-1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.results-bar{
  max-width:1100px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between; gap:20px;
  flex-wrap: wrap;
}

.header-left{
  display: flex;
  align-items: center;
  gap: 16px;
}


.back{ 
  color:var(--muted); 
  text-decoration:none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.back:hover{
  color: var(--ink);
  background: var(--surface-2);
}

.back-icon{
  font-size: 16px;
  font-weight: 600;
}

.back-text{
  font-size: 14px;
  font-weight: 500;
}

.query-info{
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
}

.query-label{
  color: var(--muted);
  font-size: 14px;
}

.query-term{
  font-weight: 600;
}

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

.cta{
  appearance:none; border:0; cursor:pointer; user-select:none;
  background:var(--primary); color:#01201c; font-weight:800;
  padding:12px 20px; border-radius:12px; letter-spacing:.25px;
  box-shadow: var(--elev-2);
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cta:hover{ 
  background:var(--primary-600); 
  box-shadow: var(--elev-3);
  transform: translateY(-1px);
}

.cta:active{ 
  transform: translateY(0); 
  background:var(--primary-700);
}

.cta:disabled{
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.cta.ready{
  animation: pulse 2s infinite;
  position: relative;
}

.cta.ready::after{
  content: "✨";
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 12px;
  animation: sparkle 1.5s ease-in-out infinite;
}

/* PDF Button specific styling */
.pdf-btn {
  background: var(--success);
  color: #01201c;
}

.pdf-btn:hover {
  background: #16a34a;
  box-shadow: var(--elev-3);
  transform: translateY(-1px);
}

.pdf-btn:active {
  transform: translateY(0);
  background: #15803d;
}

.pdf-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  background: var(--outline);
  color: var(--muted);
}

@keyframes pulse {
  0% { box-shadow: var(--elev-2); }
  50% { box-shadow: 0 0 0 4px rgba(45,212,191,.2), var(--elev-2); }
  100% { box-shadow: var(--elev-2); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.btn-icon{
  font-size: 16px;
}

.btn-text{
  font-size: 14px;
  font-weight: 600;
}
.pill{
  display:inline-flex; align-items:center; gap:8px;
  background:rgba(45,212,191,.14); color:var(--primary);
  border:1px solid var(--outline);
  padding:4px 10px; border-radius:999px; font-weight:700;
}
.pill-okay{ background:rgba(34,197,94,.14); color:var(--success) }
.pill-warn{ background:rgba(234,179,8,.14); color:var(--warn) }
.pill-bad { background:rgba(239,68,68,.16); color:#ffb4b4 }

/* ==== Tabs (Material-like with indicator) =================================== */
.tabbar{
  position:relative; display:inline-flex; gap:2px;
  background:var(--surface); border:1px solid var(--outline); border-radius:999px; padding:6px;
  box-shadow: var(--elev-1);
}
.tab{
  position:relative; appearance:none; background:transparent; border:0; cursor:pointer;
  color:var(--muted); padding:10px 18px; border-radius:999px; font-weight:600;
  transition: background .15s ease, color .15s ease;
}
.tab:hover{ background:rgba(255,255,255,.04) }
.tab.active{ color:#00100f; background:var(--primary-700) }
.tab.disabled{ opacity:.5; cursor:not-allowed }

/* ==== Inputs (MUI Outlined-ish) ============================================ */
.search-row{
  display:flex; flex-wrap:wrap; gap:12px; justify-content:center; align-items:center; margin-top:16px;
}
.input-wrap{ flex:1 1 460px; min-width:320px }
.input{
  width:100%; padding:14px 16px; border-radius:12px; color:var(--ink);
  background:var(--surface); border:1px solid var(--outline);
  outline:2px solid transparent; outline-offset:2px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:hover{ border-color:var(--outline-2) }
.input:focus{
  border-color:var(--primary-600);
  box-shadow:0 0 0 4px rgba(20,184,166,.18);
}

.phone-wrap{ display:flex; gap:10px; align-items:center }
.toggle, .select{
  background:var(--surface); color:var(--ink);
  border:1px solid var(--outline); border-radius:10px; padding:10px 12px;
}

/* ==== Buttons (contained + elevation) ====================================== */
.cta{
  appearance:none; border:0; cursor:pointer; user-select:none;
  background:var(--primary); color:#01201c; font-weight:800;
  padding:12px 20px; border-radius:12px; letter-spacing:.25px;
  box-shadow: var(--elev-2);
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
}
.cta:hover{ background:var(--primary-600); box-shadow: var(--elev-3) }
.cta:active{ transform: translateY(1px); background:var(--primary-700) }
.credit-note{ color:var(--muted); margin-top:10px }
.hidden{ display:none }

/* ==== Progress (Circular) =================================================== */
.spinner{
  display:inline-block; margin-left:10px; color:var(--muted);
  font-size:14px; position:relative; padding-left:22px;
}
.spinner::before{
  content:""; position:absolute; left:0; top:50%; width:14px; height:14px; margin-top:-7px;
  border:2px solid var(--outline); border-top-color:var(--primary);
  border-radius:50%; animation:spin 1s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg) } }

/* ==== Layout / Sections ===================================================== */
.results-main{ max-width:1100px; margin:0 auto; padding:10px 16px 60px }
.section{ margin:20px 0 10px }
.section-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.section-title-group{
  flex: 1;
}

.section-head h2{ 
  margin:0 0 8px; 
  letter-spacing:.2px;
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
}
.section-description{
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.trust-close-btn{
  background: var(--surface-2);
  border: 1px solid var(--outline);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.trust-close-btn:hover{
  background: var(--surface);
  border-color: var(--primary);
  transform: scale(1.05);
}

.trust-close-btn:active{
  transform: scale(0.95);
}

.close-icon{
  font-size: 20px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}

.trust-close-btn:hover .close-icon{
  color: var(--ink);
}

/* ==== Chips ================================================================= */
.chips{ 
  display:grid; 
  grid-template-columns:1fr 1fr; 
  gap:20px;
}

.chip-group{
  background: var(--surface-2);
  border: 1px solid var(--outline);
  border-radius: 12px;
  padding: 16px;
}

.sub{ 
  margin:0 0 12px; 
  color:var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.count{ 
  color:var(--primary);
  font-weight: 700;
}
.chip-row{ display:flex; flex-wrap:wrap; gap:8px }
.chip{
  display:inline-flex; align-items:center; gap:8px;
  background:var(--surface);
  border:1px solid var(--outline);
  color:var(--ink);
  padding:6px 10px; border-radius:14px;
  box-shadow: var(--elev-1);
}

/* ==== Cards & Grids (Material elevation) =================================== */
.card-grid{
  display:grid; 
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap:20px; 
  align-items:stretch;
}
.card{
  background:var(--surface);
  border:1px solid var(--outline);
  border-radius:16px;
  padding:0;
  box-shadow: var(--elev-1);
  width:100%; 
  min-width:0; 
  overflow:hidden;
  display:flex; 
  flex-direction:column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  min-height: 400px;
  max-height: 500px;
}
.card:hover{ 
  box-shadow: var(--elev-2);
  transform: translateY(-2px);
}
.card *{ min-width:0 }

.card-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:16px 20px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-bottom:1px solid var(--outline);
}
.card-title{ font-weight:800; font-size:18px; letter-spacing:.2px }
.card-cta{ display:flex; align-items:center; gap:10px }
.card-cta .visit{ color:var(--ink); opacity:.9; text-decoration:none; font-weight:600 }
.card-cta .visit:hover{ opacity:1; text-decoration:underline }
.avatar{
  width:56px; height:56px; border-radius:50%; object-fit:cover; border:1px solid var(--outline);
}

/* Key–value grid (labels left, values right; robust wrapping) */
.kv-grid{
  display:grid; grid-template-columns:auto 1fr; gap:12px 20px;
  max-width:100%; overflow:hidden; padding:16px 20px 20px;
  flex: 1;
  overflow-y: auto;
}
.kv-row{ display:contents }
.kv-label{ 
  color:var(--muted); 
  font-size:13px; 
  white-space:nowrap; 
  padding-right:8px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.3px;
}
.kv-value{
  font-size:14px; 
  font-weight:500; 
  word-break:break-word; 
  overflow-wrap:anywhere; 
  hyphens:auto;
  line-height:1.4;
  color:var(--ink);
}
.divider{ 
  height:1px; 
  background:rgba(255,255,255,.06); 
  margin:8px 20px 0;
}

/* ==== Panels (for checkers) ================================================= */
.panel-grid{
  display:grid; grid-template-columns: repeat(auto-fit, minmax(340px,1fr));
  gap:20px;
}
.panel{
  background:var(--surface);
  border:1px solid var(--outline);
  border-radius:16px; overflow:hidden;
  box-shadow: var(--elev-1);
  transition: box-shadow 0.2s ease;
}
.panel:hover{
  box-shadow: var(--elev-2);
}
.panel-head{ 
  background:rgba(17,56,58,.35); 
  padding:14px 16px; 
  font-weight:700;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.panel-body{ 
  padding:16px; 
  display:flex; 
  flex-wrap:wrap; 
  gap:10px;
}

/* ==== Account Presence Report ============================================== */
.summary-panel{
  background: linear-gradient(135deg, rgba(45,212,191,.08), rgba(20,184,166,.04));
  border: 2px solid rgba(45,212,191,.2);
}

.summary-header{
  background: transparent !important;
  padding: 20px !important;
}

.summary-title{
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 16px;
}

.summary-stats{
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.stat-item{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-value{
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-label{
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-name{
  font-weight: 700;
  color: var(--ink);
}

.platform-count{
  background: var(--primary);
  color: #01201c;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

/* ==== Account Details Summary ============================================== */
.account-summary{
  background: linear-gradient(135deg, rgba(45,212,191,.05), rgba(20,184,166,.02));
  border: 1px solid rgba(45,212,191,.15);
  margin-bottom: 32px;
}

.account-stats{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 32px;
  padding: 24px 20px;
  text-align: center;
}

.account-stats .stat-item{
  display: flex;
  flex-direction: column;
  align-items: center;
}

.account-stats .stat-value{
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.account-stats .stat-label{
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==== Status Indicators =================================================== */
.status-indicators{
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--outline);
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.status-badge{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-badge.verified{
  background: rgba(34,197,94,.14);
  color: var(--success);
  border: 1px solid rgba(34,197,94,.3);
}

.status-badge.active{
  background: rgba(45,212,191,.14);
  color: var(--primary);
  border: 1px solid rgba(45,212,191,.3);
}

/* ==== Clickable Cards ====================================================== */
.clickable-card{
  cursor: pointer;
  transition: all 0.2s ease;
}

.clickable-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--elev-3);
  border-color: var(--primary);
}

.clickable-card.active{
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(45,212,191,.2);
  transform: translateY(-2px);
}

/* ==== Modal Styles ========================================================= */
.modal-overlay{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
}

.modal-content{
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 16px;
  box-shadow: var(--elev-3);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--outline);
  background: var(--surface-2);
}

.modal-title{
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.modal-close{
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover{
  background: var(--outline);
  color: var(--ink);
}

.modal-body{
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-account-info{
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.modal-avatar-section{
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface-2);
  border-radius: 12px;
  border: 1px solid var(--outline);
}

.modal-avatar{
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--outline);
}

.modal-avatar-placeholder{
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: #01201c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  border: 2px solid var(--outline);
}

.modal-platform-info h3{
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 4px;
}

.modal-platform-info p{
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.modal-section{
  margin-bottom: 24px;
}

.modal-section-title{
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--outline);
}

.modal-data-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.modal-kv-row{
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--outline);
  align-items: start;
  transition: background 0.2s ease;
}

.modal-kv-row:hover{
  background: var(--surface);
}

.modal-kv-row.priority-row{
  background: rgba(45,212,191,.05);
  border-color: rgba(45,212,191,.2);
}

.modal-kv-row.priority-row:hover{
  background: rgba(45,212,191,.1);
}

.modal-kv-label{
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.modal-kv-value{
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  word-break: break-word;
  line-height: 1.4;
}

.modal-kv-value a{
  color: var(--primary);
  text-decoration: none;
}

.modal-kv-value a:hover{
  text-decoration: underline;
}

/* Responsive modal */
@media (max-width: 768px){
  .modal-overlay{
    padding: 10px;
  }
  
  .modal-content{
    max-height: 95vh;
  }
  
  .modal-header{
    padding: 16px 20px;
  }
  
  .modal-body{
    padding: 20px;
  }
  
  .modal-kv-row{
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .modal-kv-label{
    margin-bottom: 4px;
  }
  
  .modal-avatar-section{
    flex-direction: column;
    text-align: center;
  }
}

/* ==== Tiles (HIBP) ========================================================== */
.tile-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px }
.tile{
  display:block; text-decoration:none; color:var(--ink);
  background:var(--surface);
  border:1px solid var(--outline);
  border-radius:12px; padding:10px;
  box-shadow: var(--elev-1);
}
.tile:hover{ box-shadow: var(--elev-2) }
.tile .title{ font-weight:700 }
.tile .date{ color:var(--muted); font-size:12px }
.tile-row{ display:flex; align-items:center; gap:8px }
.tile-logo{
  width:28px; height:28px; border-radius:6px; background:#0a2022;
  object-fit:cover; border:1px solid var(--outline);
}

/* ==== Images (masonry) ====================================================== */
.image-grid{ columns:5 220px; column-gap:10px }
.image{
  break-inside:avoid; display:block; background:var(--surface);
  border:1px solid var(--outline); border-radius:12px; margin:0 0 10px; overflow:hidden;
  box-shadow: var(--elev-1);
}
.image img{ width:100%; height:auto; display:block }

/* ==== Debug ================================================================ */
.debug{ color:var(--muted) }
.pre{
  white-space:pre-wrap; word-break:break-word; background:var(--surface);
  border:1px solid var(--outline); border-radius:12px; padding:10px;
}

/* ==== Responsive tweak ====================================================== */
@media (max-width: 560px){
  .kv-grid{ grid-template-columns: 1fr }
  .kv-label{ margin-top:8px }
  .brand-content{ flex-direction:column; text-align:center; position:relative }
  .brand-text{ text-align:center; gap: 12px; }
  .brand-inner{ flex-direction: column; gap: 16px; }
  .logout-btn{ align-self: center; }
}

/* ==== Trust Score Styles ================================================== */
#trust-section{
  background: linear-gradient(135deg, rgba(45,212,191,.05), rgba(20,184,166,.02));
  border: 2px solid rgba(45,212,191,.2);
  border-radius: 16px;
  margin: 24px 0;
  padding: 24px;
}

#trust-section.hidden{
  display: none;
}

#trust-section:not(.hidden){
  display: block;
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.trust-score-card{
  background:var(--surface);
  border:1px solid var(--outline);
  border-radius:16px;
  padding:24px;
  box-shadow: var(--elev-2);
  max-width:100%;
}

.trust-summary{
  margin-bottom:32px;
  padding-bottom:24px;
  border-bottom:1px solid var(--outline);
}

.trust-header{
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:20px;
}

.trust-title{
  font-size:28px; font-weight:800; margin:0;
  color:var(--ink);
}

.review-btn{
  background:var(--primary); color:#01201c; border:none;
  padding:8px 16px; border-radius:8px; font-weight:600;
  cursor:pointer; transition:background .15s ease;
}

.review-btn:hover{ background:var(--primary-600); }

.trust-metrics{
  display:flex; justify-content:center; gap:24px;
  margin-bottom:20px;
}

.trust-metric{
  text-align:center;
}

.metric-label{
  color:var(--muted); font-size:14px; margin-bottom:8px;
  text-transform:uppercase; letter-spacing:.5px;
}

.metric-value{
  font-size:36px; font-weight:800; color:var(--ink);
}

.score-high{ color:var(--success); }
.score-medium{ color:var(--warn); }
.score-low{ color:var(--error); }

.trust-overview{
  background:rgba(45,212,191,.08); padding:16px; border-radius:12px;
  border:1px solid rgba(45,212,191,.2);
}

.overview-text{
  color:var(--ink); font-weight:600; margin-bottom:8px;
}

.rationale-text{
  color:var(--muted); font-size:14px;
}

.section-title{
  font-size:18px; font-weight:700; margin:0 0 16px;
  color:var(--ink); letter-spacing:.2px;
}

.section-scores{
  margin-bottom:32px; padding-bottom:24px; border-bottom:1px solid var(--outline);
}

.section-scores-grid{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));
  gap:16px;
}

.section-score-row{
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 16px; background:var(--surface-2);
  border:1px solid var(--outline); border-radius:8px;
}

.section-score-label{
  color:var(--ink); font-weight:600;
}

.section-score-value{
  font-weight:800; font-size:18px;
}

.top-reasons{
  margin-bottom:32px; padding-bottom:24px; border-bottom:1px solid var(--outline);
}

.reasons-list{
  display:flex; flex-direction:column; gap:12px;
}

.reason-item{
  display:flex; flex-direction:column; gap:4px;
  padding:12px; background:var(--surface-2);
  border:1px solid var(--outline); border-radius:8px;
}

.reason-code{
  font-weight:700; color:var(--primary); font-size:14px;
  text-transform:uppercase; letter-spacing:.5px;
}

.reason-text{
  color:var(--ink); font-size:14px;
}

.good-signals{
  margin-bottom:32px; padding-bottom:24px; border-bottom:1px solid var(--outline);
}

.good-signals-chips{
  display:flex; flex-wrap:wrap; gap:8px;
}

.good-signal-chip{
  background:rgba(34,197,94,.14); color:var(--success);
  border:1px solid rgba(34,197,94,.3);
  padding:6px 12px; border-radius:16px; font-size:13px;
  font-weight:600;
}
.risk-chip {
  background: rgba(239, 68, 68, 0.14);   /* light red background */
  color: rgb(239, 68, 68);               /* red text */
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.action-chip {
  background: rgba(234, 179, 8, 0.14);   /* light yellow background */
  color: rgb(234, 179, 8);               /* yellow text */
  border: 1px solid rgba(234, 179, 8, 0.3);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.trust-summary {
  max-width: 420px;
  margin: 40px auto;           /* centers the card */
  padding: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
}
.trust-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.metric-value {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--success);
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.decision-pill {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  font-size: 14px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.overview-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.5;
}

.rationale-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.score-green {
  color: rgb(34, 197, 94); 
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
  border-color: rgba(34, 197, 94, 0.4) !important;
  background: rgba(34, 197, 94, 0.15) !important;
}

.score-yellow {
  color: rgb(234, 179, 8);
  text-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
  border-color: rgba(234, 179, 8, 0.4) !important;
  background: rgba(234, 179, 8, 0.15) !important;
}

.score-red {
  color: rgb(239, 68, 68);
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.4) !important;
  background: rgba(239, 68, 68, 0.15) !important;
}

.evidence-section{
  margin-bottom:32px; padding-bottom:24px; border-bottom:1px solid var(--outline);
}

.evidence-list{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));
  gap:12px;
  min-height:60px; /* Ensure section has minimum height */
}

.evidence-item{
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 16px; background:var(--surface-2);
  border:1px solid var(--outline); border-radius:8px;
  min-height:48px; /* Ensure items have minimum height */
}

.evidence-platform{
  font-weight:700; color:var(--ink);
  flex:1;
}

.evidence-info{
  color:var(--muted); font-size:13px;
  text-align:right;
  flex:1;
}

.model-info{
  background:rgba(45,212,191,.05); padding:16px; border-radius:8px;
  border:1px solid rgba(45,212,191,.1);
}

.model-name{
  font-weight:700; color:var(--primary); margin-bottom:8px;
  font-size:14px;
}

.disclaimer{
  color:var(--muted); font-size:13px; line-height:1.4;
}

/* Responsive adjustments */
@media (max-width: 768px){
  .trust-metrics{ justify-content:center; gap:16px; }
  .section-scores-grid{ grid-template-columns:1fr; }
  .evidence-list{ grid-template-columns:1fr; }
  .trust-header{ flex-direction:column; gap:12px; align-items:stretch; }
  .review-btn{ align-self:center; }
}

/* ==== Login Page Styles ================================================ */
.login-container{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
}

.login-card{
  background: var(--surface);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--elev-4);
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--outline);
}

.login-header{
  text-align: center;
  margin-bottom: 32px;
}

.login-title{
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}

.login-subtitle{
  color: var(--muted);
  font-size: 16px;
  margin: 0;
  font-weight: 500;
}

.login-form{
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label{
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}

.form-input{
  padding: 12px 16px;
  border: 2px solid var(--outline);
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.2s ease;
  background: var(--surface);
  color: var(--ink);
}

.form-input:focus{
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
}

.form-input.error{
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.password-input-wrapper{
  position: relative;
}

.password-toggle{
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.password-toggle:hover{
  background: var(--surface-2);
}

.toggle-icon{
  font-size: 18px;
  display: block;
}

.form-options{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0;
}

.checkbox-wrapper{
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"]{
  display: none;
}

.checkbox-custom{
  width: 18px;
  height: 18px;
  border: 2px solid var(--outline);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: var(--surface);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom{
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom::after{
  content: '✓';
  color: white;
  font-weight: bold;
  font-size: 12px;
}

.checkbox-label{
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}

.forgot-link{
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.forgot-link:hover{
  color: var(--primary-600);
  text-decoration: underline;
}

.login-btn{
  background: var(--primary);
  color: var(--primary-900);
  border: none;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.login-btn:hover:not(:disabled){
  background: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: var(--elev-2);
}

.login-btn:disabled{
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner{
  animation: spin 1s linear infinite;
}

@keyframes spin{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}


.field-error{
  color: var(--error);
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}

.error-message{
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-icon{
  font-size: 16px;
  flex-shrink: 0;
}

.error-text{
  color: var(--error);
  font-size: 14px;
  font-weight: 500;
}

/* Login page responsive */
@media (max-width: 480px){
  .login-container{
    padding: 16px;
  }
  
  .login-card{
    padding: 24px;
  }
  
  .login-title{
    font-size: 28px;
  }
  
  .form-options{
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

/* ==== Footer =============================================================== */
.results-footer{
  background: var(--surface-2);
  border-top: 1px solid var(--outline);
  margin-top: auto;
  padding: 24px 16px;
}

.footer-content{
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.footer-content p{
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.footer-content .disclaimer{
  font-size: 12px;
  opacity: 0.8;
}


/* ==== Responsive Improvements ============================================= */
@media (max-width: 768px){
  .results-bar{
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .header-left{
    order: 1;
    justify-content: center;
    width: 100%;
  }
  
  .query-info{
    order: 2;
    flex: none;
  }
  
  .header-actions{
    order: 3;
  }
  
  
  .chips{
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .chip-group{
    padding: 12px;
  }
  
  .section-head{
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .trust-close-btn{
    align-self: flex-end;
    width: 36px;
    height: 36px;
  }
  
  .close-icon{
    font-size: 18px;
  }
}

/* CREDIT BOX STYLES */
.credit-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  backdrop-filter: blur(4px);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  margin-top: 12px;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 0 6px rgba(255,255,255,0.3);
}

/* When user has 0 credits */
.credit-box.empty {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 0, 0, 0.5);
  color: #ff4444;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

/* Little animated red pulse when empty */
.credit-box.empty {
  animation: pulseRed 1.2s ease-in-out infinite;
}

@keyframes pulseRed {
  0% { box-shadow: 0 0 6px rgba(255, 0, 0, 0.3); }
  50% { box-shadow: 0 0 14px rgba(255, 0, 0, 0.6); }
  100% { box-shadow: 0 0 6px rgba(255, 0, 0, 0.3); }
}

/* Green glow when credits are above 10 */
.credit-box.good {
  background: rgba(0, 255, 120, 0.18);
  border-color: rgba(0, 255, 145, 0.5);
  color: #00ff9d;
  box-shadow: 0 0 10px rgba(0, 255, 120, 0.5);
}

/* Smooth number update */
#creditValue {
  font-size: 18px;
  font-weight: 700;
}
.brand-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.credit-box {
    margin-right: 20px;  /* The gap you want */
}

.header-actions {
    margin-left: 20px;   /* Same size gap for balance */
}
.header-controls {
    display: flex;
    align-items: center;
    gap: 20px; /* Equal space between elements */
}


/* Utility */
.hidden{ display:none !important }

