:root{
  --bg:#ffffff;
  --panel:#ffffff;
  --panelSoft:#fbfbfd;
  --text:#0f172a;
  --muted:#64748b;
  --border:#e5e7ef;
  --shadow:0 14px 34px rgba(15,23,42,.06);
  --shadow2:0 8px 22px rgba(15,23,42,.08);
  --radius:20px;
  --radius2:16px;
  --accent:#c6631a;
  --accent2:#e07a2f;
  --pill:#f3f4f8;
  --pillActive:#1f2937;
  --focus:rgba(198,99,26,.18);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji";
  background:var(--bg);
  color:var(--text);
  line-height:1.45;
}

a{color:inherit;text-decoration:none}
button,input,select{font:inherit}

.shell{
  max-width:1240px;
  margin:32px auto 48px;
  padding:0 20px;
}

.page{
  padding:28px 0 44px;
}

.hero{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:28px 24px 24px;
}

.hero-meta{
  margin-bottom:18px;
}

.hero-eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--accent);
  margin-bottom:8px;
}

.hero-title{
  margin:0 0 10px;
  font-size:34px;
  line-height:1.08;
  letter-spacing:-0.02em;
}

.hero-subtitle{
  margin:0;
  color:var(--muted);
  max-width:760px;
  font-size:15px;
  line-height:1.6;
}

.toolbar{
  margin-top:24px;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.controls{
  padding:20px;
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:var(--panelSoft);
  box-shadow:var(--shadow);
}

.control-group{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.control-label-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.label{
  font-size:13px;
  font-weight:700;
  color:var(--text);
}

.chip-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.belief-chips{
  margin-bottom:2px;
}

.intent-row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.intent-input{
  flex:1 1 360px;
  width:100%;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  outline:none;
  font-size:14px;
  padding:12px 14px;
}

.intent-input:focus{
  border-color:rgba(198,99,26,.45);
  box-shadow:0 0 0 4px var(--focus);
}

.pill{
  border:none;
  border-radius:999px;
  padding:10px 14px;
  background:var(--pill);
  color:var(--text);
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  transition:transform .06s ease,background .12s ease,box-shadow .12s ease,color .12s ease;
}

#popularTags .pill{
  font-weight:400;
}

#intentChipsMount .pill{
  font-weight:400;
  color:var(--accent);
}

.pill:hover{
  box-shadow:var(--shadow2);
}

.pill.active{
  background:var(--pillActive);
  color:#fff;
}

.btn{
  border:none;
  border-radius:14px;
  padding:10px 14px;
  font-weight:700;
  cursor:pointer;
  transition:transform .06s ease,background .12s ease,box-shadow .12s ease,border-color .12s ease;
}

.btn:active{transform:translateY(1px)}

.btn-primary{
  background:var(--accent);
  color:#fff;
  box-shadow:0 10px 24px rgba(198,99,26,.22);
}

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

.btn-secondary,
.btn-ghost{
  background:#fff;
  border:1px solid var(--border);
  color:var(--text);
}

.btn-secondary:hover,
.btn-ghost:hover{
  box-shadow:var(--shadow2);
}

.link-button{
  border:none;
  background:transparent;
  color:var(--accent);
  font-weight:700;
  padding:0;
  cursor:pointer;
}

.results{
  margin-top:26px;
  padding:20px;
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:var(--panel);
  box-shadow:var(--shadow);
}

.results-list{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.item{
  display:flex;
  justify-content:space-between;
  gap:18px;
  padding:18px;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  cursor:pointer;
  transition:box-shadow .12s ease,transform .06s ease,border-color .12s ease;
}

.item:hover{
  box-shadow:var(--shadow2);
}

.leftCol{
  display:flex;
  gap:14px;
  min-width:0;
  flex:1 1 auto;
}

.rightCol{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  justify-content:flex-start;
  gap:10px;
  flex:0 0 auto;
}

.mediaIcon{
  width:44px;
  height:44px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--panelSoft);
  border:1px solid var(--border);
  font-size:18px;
  flex:0 0 auto;
}

.meta{
  min-width:0;
}

.proofBadge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:11px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--accent);
  margin-bottom:8px;
}

.t{
  margin:0 0 8px;
  font-size:19px;
  font-weight:800;
  line-height:1.25;
  letter-spacing:-0.01em;
}

.s{
  margin:0 0 12px;
  color:var(--muted);
  font-size:14px;
  line-height:1.55;
}

.tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.tag{
  border:none;
  border-radius:999px;
  padding:8px 12px;
  background:var(--pill);
  color:var(--text);
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}

.typeChip{
  border:1px solid var(--border);
  background:var(--panelSoft);
  color:var(--text);
  border-radius:999px;
  padding:8px 12px;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}

.empty-state{
  display:none;
}

.empty-card{
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--panelSoft);
  padding:24px;
}

.empty-card h3{
  margin:0 0 8px;
  font-size:20px;
}

.empty-card p{
  margin:0;
  color:var(--muted);
}

.overlay.hidden{
  display:none;
}

.overlay{
  position:fixed;
  inset:0;
  z-index:80;
  display:grid;
  place-items:center;
}

.overlay-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.48);
  backdrop-filter:blur(4px);
}

.modal{
  position:relative;
  z-index:1;
  width:min(960px, calc(100vw - 32px));
  max-height:calc(100vh - 32px);
  overflow:auto;
  border-radius:24px;
  background:#fff;
  border:1px solid var(--border);
  box-shadow:0 30px 90px rgba(15,23,42,.22);
  padding:22px;
}

.modal-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}

.modal-label{
  font-size:24px;
  font-weight:800;
  line-height:1.2;
  letter-spacing:-0.02em;
}

.modal-close{
  border:none;
  background:transparent;
  font-size:32px;
  line-height:1;
  cursor:pointer;
  color:var(--muted);
}

.modal-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.modal-body{
  margin-top:18px;
}

.modal-viewer{
  border:1px solid var(--border);
  border-radius:20px;
  background:var(--panelSoft);
  padding:14px;
  min-height:240px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.modal-viewer img,
.modal-viewer video{
  max-width:100%;
  max-height:72vh;
  border-radius:14px;
  display:block;
}

.modal-viewer audio{
  width:100%;
}

.modal-viewer-fallback{
  margin-top:12px;
  padding:14px;
  border-radius:14px;
  background:var(--panelSoft);
  color:var(--muted);
  border:1px solid var(--border);
}

.modal-meta{
  margin-top:14px;
  color:var(--muted);
  font-size:13px;
}

.modal-footer{
  margin-top:20px;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.modal-nav{
  display:flex;
  justify-content:space-between;
  gap:12px;
}

.modal-bridge{
  border:1px solid var(--border);
  background:var(--panelSoft);
  border-radius:18px;
  padding:18px;
}

.bridge-title{
  margin:0 0 8px;
  font-size:20px;
  line-height:1.2;
}

.bridge-copy{
  margin:0;
  color:var(--muted);
  line-height:1.55;
}

.bridge-actions{
  margin-top:14px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

@media (max-width: 820px){
  .hero-title{
    font-size:28px;
  }

  .item{
    flex-direction:column;
    align-items:flex-start;
  }

  .rightCol{
    align-items:flex-start;
  }

  .modal{
    padding:18px;
  }
}

@media (max-width: 560px){
  .shell{
    margin:20px auto 34px;
    padding:0 14px;
  }

  .page{
    padding:14px 0 28px;
  }

  .hero,
  .results{
    padding:18px 16px;
  }

  .controls{
    padding:16px;
  }

  .intent-row{
    flex-direction:column;
    align-items:stretch;
  }

  .intent-input{
    flex:1 1 auto;
  }

  .modal-label{
    font-size:21px;
  }

  .modal-nav{
    flex-direction:column;
  }

  .bridge-actions{
    flex-direction:column;
  }

  .bridge-actions .btn{
    width:100%;
    text-align:center;
  }
}