/* IG Protocol Glaucoma Tool — v4
   Goal: cleaner layout + more auditable output.
*/

:root{
  --bg: #f4f4f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #4CAF50;
  --danger: #f44336;
  --shadow: 0 6px 18px rgba(0,0,0,0.10);
  --radius: 14px;
}

*{ box-sizing: border-box; }
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.app-header{
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(90deg, var(--accent), #2e8b57);
  color: white;
  padding: 14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.app-title h1{
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}
.subtitle{
  margin: 2px 0 0 0;
  font-size: 12px;
  opacity: 0.9;
}

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

.pill{
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  display:flex;
  align-items:center;
  gap: 8px;
}

.app{
  max-width: 980px;
  margin: 16px auto 60px auto;
  padding: 0 12px;
}

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

.card{
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.card-head{
  margin-bottom: 10px;
}
.card-head h2{
  margin: 0 0 4px 0;
  font-size: 16px;
}
.hint{
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.divider{
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

.field{
  display:grid;
  grid-template-columns: 220px 1fr;
  gap: 10px;
  align-items:start;
  margin: 10px 0;
}
.field.inline{
  grid-template-columns: 220px 1fr;
}

.field label{
  font-weight: 700;
  font-size: 13px;
}

.options{
  display:flex;
  flex-wrap:wrap;
  gap: 6px;
}

.option-button{
  border: 2px solid #ddd;
  border-radius: 12px;
  padding: 8px 10px;
  background: #f9fafb;
  cursor:pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-size: 13px;
}
.option-button:hover{
  background:#eef2f7;
}
.option-button.selected{
  border-color: #111827;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  transform: scale(1.02);
}
.option-button:focus{
  outline: 3px solid rgba(76,175,80,0.35);
  outline-offset: 2px;
}

.dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display:inline-block;
}
.dot.green{ background:#4CAF50; }
.dot.yellow{ background:#FFD700; }
.dot.red{ background:#FF6347; }

.inline{
  margin-top: 8px;
}
.progression-container{
  display:none;
  margin-top: 8px;
}
.checkbox{
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
}

.nested{
  display:none;
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #fbfbfd;
  border: 1px solid var(--line);
}
.nested-head{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 13px;
}

.small{
  font-size: 12px;
  color: var(--muted);
}
.warning{
  color: #b91c1c;
}

.actions{
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: rgba(244,244,249,0.92);
  backdrop-filter: blur(6px);
  padding: 10px 0 14px 0;
  display:flex;
  justify-content:center;
  gap: 10px;
}

.btn{
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor:pointer;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transition: transform 0.08s ease, box-shadow 0.15s ease;
  display:flex;
  align-items:center;
  gap: 8px;
}
.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.14);
}
.btn.primary{ background: var(--accent); color: white; }
.btn.danger{ background: var(--danger); color: white; }
.btn.ghost{
  background: rgba(255,255,255,0.18);
  color: white;
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.25);
}
.btn.ghost:hover{
  transform:none;
  box-shadow:none;
  background: rgba(255,255,255,0.24);
}

/* Callout (OHT question) */
.callout{
  border: 2px solid rgba(76,175,80,0.55);
}
.callout.highlight{
  border-color: #ef4444;
}
.callout-head{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap: 10px;
  margin-bottom: 8px;
}

/* Results */
.results h3{
  margin: 0 0 8px 0;
  font-size: 16px;
}
.results .diag{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1px solid rgba(76,175,80,0.35);
  margin-bottom: 10px;
}
.results .diag strong{
  font-size: 15px;
}
.results ul{
  margin: 8px 0 0 18px;
}
.results details{
  margin-top: 10px;
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
.results summary{
  cursor:pointer;
  font-weight: 800;
}
.results .tag{
  background: #111827;
  color: white;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  white-space:nowrap;
}

/* Modal */
.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 16px;
  z-index: 50;
}
.modal-content{
  max-width: 560px;
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.modal-actions{
  margin-top: 12px;
  display:flex;
  justify-content:flex-end;
}

@media (max-width: 700px){
  .field{
    grid-template-columns: 1fr;
  }
  .actions{
    padding: 10px 0 18px 0;
  }
}


/* --- v4 additions: stronger disclaimer + evidence chips --- */

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

.modal-body{
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fafb;
  max-height: 55vh;
  overflow: auto;
}

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

.check{
  display:flex;
  align-items:flex-start;
  gap: 10px;
  font-size: 0.95rem;
}

.check input{
  margin-top: 3px;
}

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

.ev-chip{
  display:inline-block;
  margin-left: 8px;
  margin-top: 4px;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.80rem;
  text-decoration:none;
  color: var(--text);
  background: #fff;
  vertical-align: middle;
}

.ev-chip:hover{
  border-color: var(--accent);
}

.modal-actions{
  gap: 8px;
  flex-wrap: wrap;
}




/* --- Site-wide additions (v1 static site) --- */

.brand-link{
  color: inherit;
  text-decoration: none;
}
.brand-link:hover{ text-decoration: underline; }

.header-right{
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer{
  max-width: 980px;
  margin: 18px auto 40px auto;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.footer a{ color: inherit; }
.footer .footer-row{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  align-items:center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.page-hero{
  padding: 14px 0 2px 0;
}
.page-hero h2{
  margin: 0 0 4px 0;
  font-size: 22px;
}
.page-hero p{
  margin: 0;
  color: var(--muted);
}

.toc{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin-top: 10px;
}
.toc a{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-decoration: none;
}
.toc a:hover{
  border-color: rgba(0,0,0,0.22);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.evidence-section{
  scroll-margin-top: 110px; /* sticky header offset */
}
.evidence-section .meta{
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}
.evidence-links{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin-top: 10px;
}
.evidence-links a.btn{
  text-decoration:none;
}

details.embed{
  margin-top: 10px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fbfbfd;
}
details.embed summary{
  cursor: pointer;
  font-weight: 700;
}
details.embed iframe{
  width: 100%;
  height: 520px;
  border: 0;
  margin-top: 10px;
  border-radius: 10px;
}

.notice{
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #7c2d12;
  font-size: 13px;
}

.smallcaps{
  font-variant: all-small-caps;
  letter-spacing: 0.06em;
}

