:root{
  --navy:#0f2341;
  --navy2:#142c52;
  --navy3:#203a66;
  --gold:#c9a84c;
  --gold2:#e4c86e;
  --cream:#f7f4eb;
  --cream2:#efe7d6;
  --white:#ffffff;
  --bg:#fbfcff;
  --line:#d9e2ef;
  --line2:#edf2f8;
  --text:#212633;
  --muted:#657083;
  --success:#1a6b3c;
  --danger:#b54738;
  --shadow:0 12px 40px rgba(15,35,65,.08);
  --shadow2:0 20px 50px rgba(15,35,65,.10);
  --radius:24px;
  --radius2:18px;
  --radius3:14px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  margin:0;
  font-family:"Source Sans 3",system-ui,sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at top right, rgba(201,168,76,.12), transparent 25%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 260px);
  line-height:1.68;
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%;display:block}
button,input,select{font:inherit}
.page{max-width:1180px;margin:0 auto;padding:18px 12px 56px}
.hero{
  background:linear-gradient(145deg,var(--navy2) 0%,var(--navy) 58%,var(--navy3) 100%);
  color:var(--white);
  border:1px solid rgba(255,255,255,.08);
  border-radius:28px;
  box-shadow:var(--shadow2);
  padding:18px 16px 20px;
  position:relative;
  overflow:hidden;
}
.hero::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 90% 18%, rgba(201,168,76,.17), transparent 28%),
    radial-gradient(circle at 8% 85%, rgba(201,168,76,.08), transparent 30%);
  pointer-events:none;
}
.hero > *{position:relative;z-index:1}
.hero-brand{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:16px;
}
.hero-logo{
  width:74px;
  height:74px;
  object-fit:contain;
  flex:0 0 auto;
}
.hero-brand-copy{min-width:0}
.hero-kicker{
  margin:0 0 4px;
  font-family:"Space Mono",monospace;
  font-size:.72rem;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:rgba(255,255,255,.72);
}
.hero-credit{
  margin:0;
  font-family:"EB Garamond",serif;
  font-size:1.32rem;
  font-weight:600;
  color:var(--gold2);
}
.hero h1{
  margin:0 0 12px;
  font-family:"EB Garamond",serif;
  font-size:clamp(1.9rem,5vw,3rem);
  line-height:1.08;
  letter-spacing:-.02em;
}
.hero-body{
  margin:0;
  max-width:900px;
  color:rgba(255,255,255,.82);
  font-size:1rem;
}
.hero-stats{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:18px;
}
.hero-stat{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:0 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);
  color:rgba(255,255,255,.92);
  font-size:.86rem;
  font-weight:700;
}
.toolbar{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:12px;
  margin:16px 0 18px;
  padding:14px;
  background:rgba(255,255,255,.96);
  border:1px solid var(--line2);
  border-radius:22px;
  box-shadow:var(--shadow);
  position:sticky;
  top:0;
  z-index:20;
  backdrop-filter:blur(12px);
}
.toolbar-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.toolbar-label{
  font-size:.74rem;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}
.toolbar input,
.toolbar select{
  width:100%;
  min-height:48px;
  border:1px solid var(--line);
  border-radius:16px;
  padding:0 14px;
  color:var(--text);
  background:var(--white);
}
.toolbar input:focus,
.toolbar select:focus{
  outline:none;
  border-color:var(--gold);
  box-shadow:0 0 0 4px rgba(201,168,76,.16);
}
.toolbar-actions{
  display:flex;
  align-items:flex-end;
}
.primary-btn,
.ghost-btn,
.tab-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:48px;
  border-radius:16px;
  border:1px solid var(--line);
  background:var(--white);
  color:var(--text);
  cursor:pointer;
  transition:all .18s ease;
}
.primary-btn{
  width:100%;
  padding:0 16px;
  background:var(--navy);
  border-color:var(--navy);
  color:var(--white);
  font-weight:700;
}
.primary-btn:hover{background:var(--navy3)}
.ghost-btn{
  padding:0 14px;
  font-weight:700;
}
.ghost-btn:hover,
.tab-btn:hover{border-color:var(--gold)}
.content{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:18px;
}
.results-pane,
.detail-pane{
  background:var(--white);
  border:1px solid var(--line2);
  border-radius:26px;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.pane-head{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:18px 16px 14px;
  border-bottom:1px solid var(--line2);
  background:linear-gradient(180deg,#fdfefe 0%,#f8fbff 100%);
}
.pane-kicker{
  margin:0 0 4px;
  font-size:.73rem;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--gold);
}
.pane-head h2{
  margin:0;
  font-size:1.12rem;
  letter-spacing:-.02em;
  color:var(--navy);
}
.pane-head p{
  margin:0;
  color:var(--muted);
  font-size:.92rem;
}
.results-list{
  display:flex;
  flex-direction:column;
  max-height:52vh;
  overflow:auto;
}
.result-btn{
  text-align:left;
  width:100%;
  border:0;
  border-bottom:1px solid var(--line2);
  background:var(--white);
  padding:14px 16px;
  cursor:pointer;
  transition:background .18s ease, box-shadow .18s ease;
}
.result-btn:hover,
.result-btn.active{background:#f9fbff}
.result-btn.active{box-shadow:inset 4px 0 0 var(--gold)}
.result-btn:last-child{border-bottom:0}
.result-top{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:8px;
}
.result-top h3{
  margin:0;
  font-size:1rem;
  line-height:1.32;
  color:var(--navy);
}
.result-subtitle{
  margin:0;
  font-size:.84rem;
  color:var(--muted);
  font-weight:600;
}
.result-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 8px;
}
.chip{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:0 10px;
  border-radius:999px;
  background:#f5f8fc;
  color:#455165;
  font-size:.76rem;
  font-weight:700;
}
.result-copy{
  margin:0;
  color:#384253;
  font-size:.92rem;
  line-height:1.58;
}
.empty-state{
  padding:16px;
  color:var(--muted);
}
.detail-shell{
  min-height:420px;
  padding:18px 16px 26px;
  position:relative;
}
.detail-empty{
  min-height:360px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:var(--muted);
}
.detail-empty-kicker{
  margin:0 0 8px;
  font-size:.78rem;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--gold);
}
.detail-empty h2{
  margin:0 0 10px;
  font-family:"EB Garamond",serif;
  font-size:2rem;
  line-height:1.05;
  color:var(--navy);
}
.detail-top{
  display:flex;
  flex-direction:column;
  gap:14px;
  padding-bottom:16px;
  border-bottom:1px solid var(--line2);
}
.detail-brand{
  display:flex;
  align-items:flex-start;
  gap:12px;
}
.detail-logo{
  width:60px;
  height:60px;
  object-fit:contain;
  flex:0 0 auto;
}
.detail-kicker{
  margin:0 0 5px;
  font-size:.75rem;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--gold);
}
.detail-top h2{
  margin:0 0 8px;
  font-family:"EB Garamond",serif;
  font-size:clamp(1.45rem,4vw,2.2rem);
  line-height:1.12;
  color:var(--navy);
}
.detail-summary{
  margin:0;
  color:#3d4757;
  font-size:1rem;
}
.detail-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.tab-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:18px 0 14px;
}
.tab-btn{
  min-width:150px;
  padding:0 14px;
  font-weight:700;
}
.tab-btn.active{
  background:var(--navy);
  border-color:var(--navy);
  color:var(--white);
}
.tab-panel{display:none}
.tab-panel.active{display:block}
.answer-card{
  padding:18px 16px;
  border:1px solid var(--line2);
  border-radius:22px;
  background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);
  margin-bottom:16px;
}
.answer-card.quick{
  border-left:5px solid var(--gold);
}
.answer-card.research{
  border-left:5px solid var(--navy);
}
.answer-label{
  margin:0 0 8px;
  font-size:.76rem;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--muted);
}
.answer-copy{
  margin:0;
  font-size:1rem;
  color:var(--text);
}
.grid{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:14px;
}
.table-card,
.section-card,
.source-card,
.action-card{
  border:1px solid var(--line2);
  border-radius:22px;
  background:var(--white);
  box-shadow:0 4px 18px rgba(15,35,65,.04);
}
.table-card{overflow:hidden}
.card-head{
  padding:14px 16px;
  border-bottom:1px solid var(--line2);
  background:#fbfcff;
}
.card-head h3{
  margin:0;
  font-size:1rem;
  color:var(--navy);
}
.card-head p{
  margin:5px 0 0;
  color:var(--muted);
  font-size:.9rem;
}
.detail-table{
  width:100%;
  border-collapse:collapse;
}
.detail-table th,
.detail-table td{
  padding:12px 16px;
  border-bottom:1px solid var(--line2);
  vertical-align:top;
  text-align:left;
}
.detail-table tr:last-child th,
.detail-table tr:last-child td{border-bottom:0}
.detail-table th{
  width:34%;
  color:var(--navy);
  font-size:.88rem;
}
.detail-table td{
  color:#364051;
  font-size:.95rem;
}
.sections{
  display:grid;
  gap:12px;
}
.section-card{
  padding:16px;
}
.section-card h4{
  margin:0 0 8px;
  font-size:1rem;
  color:var(--navy);
}
.section-card p{
  margin:0;
  color:#364051;
}
.action-card{padding:16px}
.action-list{
  margin:0;
  padding-left:18px;
  color:#364051;
}
.action-list li{margin-bottom:8px}
.action-list li:last-child{margin-bottom:0}
.source-card{padding:16px}
.source-list{
  display:grid;
  gap:12px;
}
.source-item{
  padding:12px 14px;
  border:1px solid var(--line2);
  border-radius:16px;
  background:#fbfcff;
}
.source-item p{
  margin:0 0 6px;
  color:#2b3444;
  font-weight:600;
}
.source-item a{
  color:var(--navy3);
  text-decoration:none;
  word-break:break-word;
}
.source-item a:hover{text-decoration:underline}
.related-wrap{
  margin-top:16px;
}
.related-list{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.related-btn{
  min-height:40px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:#354052;
  cursor:pointer;
  font:inherit;
  font-size:.86rem;
  font-weight:700;
}
.related-btn:hover{
  border-color:var(--gold);
  background:#fffdf8;
}
@media (min-width: 720px){
  .page{padding:26px 22px 70px}
  .toolbar{
    grid-template-columns:minmax(0,1fr) 240px 170px;
    align-items:end;
  }
  .content{grid-template-columns:360px minmax(0,1fr)}
  .results-list{max-height:calc(100vh - 270px)}
  .grid.two-col{grid-template-columns:1.05fr .95fr}
}
@media (min-width: 980px){
  .hero{padding:24px 24px 24px}
  .pane-head{flex-direction:row;align-items:end;justify-content:space-between}
  .detail-shell{padding:24px 22px 30px}
}
@media print{
  @page{size:A4 portrait;margin:14mm}
  body{background:#fff !important;font-size:10pt}
  .page{max-width:none;padding:0}
  .hero,
  .toolbar,
  .results-pane,
  .detail-actions,
  .tab-row,
  .related-wrap{display:none !important}
  .detail-pane{
    box-shadow:none;
    border:0;
    border-radius:0;
  }
  .detail-shell{
    padding:0;
    position:relative;
    z-index:1;
  }
  .detail-shell::before{
    content:"";
    position:absolute;
    inset:0;
    background-image:url('https://mmsxauthority.com/MMSX_logo.png');
    background-repeat:repeat-y;
    background-position:center 24mm;
    background-size:180mm auto;
    opacity:.10;
    pointer-events:none;
    z-index:0;
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }
  .detail-shell > *{
    position:relative;
    z-index:1;
  }
  .answer-card,
  .table-card,
  .section-card,
  .source-card,
  .action-card{break-inside:avoid}
}
