:root{
  --bg: #0b1220;
  --bg2: #0d1830;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.09);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.72);
  --faint: rgba(255,255,255,0.55);
  --border: rgba(255,255,255,0.14);
  --border2: rgba(255,255,255,0.22);
  --shadow: 0 12px 40px rgba(0,0,0,0.28);
  --primary: #3b82f6;
  --primary2: #60a5fa;
  --primaryInk: #071427;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #22c55e;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: radial-gradient(1000px 700px at 15% 10%, rgba(59,130,246,0.36), transparent 60%),
              radial-gradient(900px 700px at 85% 20%, rgba(34,197,94,0.18), transparent 60%),
              radial-gradient(900px 700px at 20% 95%, rgba(34,197,94,0.10), transparent 65%),
              radial-gradient(1000px 800px at 80% 95%, rgba(59,130,246,0.22), transparent 65%),
              linear-gradient(180deg, var(--bg), var(--bg2));
}

body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.10) 1px, transparent 0);
  background-size: 36px 36px;
  opacity: 0.06;
  mix-blend-mode: overlay;
}

a{ color: var(--primary2); text-decoration: none; }
a:hover{ text-decoration: underline; }

.container{
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding: 18px 0 60px;
}

.nav{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(7, 12, 22, 0.66);
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.nav-inner{
  width: min(1180px, 92vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
.brand-badge{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59,130,246,1), rgba(96,165,250,1));
  box-shadow: 0 10px 30px rgba(59,130,246,0.24);
}
.brand-title{
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.1;
}
.brand-sub{
  font-size: 12px;
  color: var(--faint);
  margin-top: 2px;
}

.nav-links{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link{
  padding: 9px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,0.84);
  border: 1px solid transparent;
  transition: 120ms ease;
  font-weight: 600;
  font-size: 14px;
}
.nav-link:hover{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  text-decoration: none;
}
.nav-link.active{
  background: rgba(59,130,246,0.18);
  border-color: rgba(59,130,246,0.35);
  color: rgba(255,255,255,0.95);
}

.nav-version{
  font-family: var(--mono);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.74);
  background: rgba(255,255,255,0.04);
  user-select: none;
  white-space: nowrap;
}

.hero{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}
.hero h1{
  margin: 0 0 8px 0;
  font-size: clamp(22px, 3.1vw, 34px);
  letter-spacing: -0.2px;
}
.hero p{
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 15px;
}
.hero-card{
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.05));
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
}
.hero-card .kicker{
  font-size: 12px;
  color: var(--faint);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.hero-card .line{
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.pills{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.pill{
  font-family: var(--mono);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: rgba(255,255,255,0.86);
  background: rgba(255,255,255,0.05);
}

.pill-link{
  text-decoration: none;
  cursor: pointer;
}
.pill-link:hover{
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.20);
}

.section{
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.05);
  box-shadow: var(--shadow);
}

.section-header{
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.section-title{
  font-weight: 800;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}
.section-title .step{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: rgba(59,130,246,0.18);
  border: 1px solid rgba(59,130,246,0.35);
  color: rgba(255,255,255,0.92);
  font-weight: 900;
  font-size: 13px;
}
.section-sub{
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.4;
}
.section-body{
  padding: 14px 16px 16px;
}

.grid-2{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.grid-2.grid-2-21{
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.grid-2.align-start{
  align-items: start;
}

#measurementsActions{
  margin-top: 10px;
}

.author-grid{
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  align-items: center;
}

.author-photo-wrap{
  width: 180px;
  aspect-ratio: 4 / 5;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.22);
}

.author-photo{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
  display: block;
}

.author-list{
  margin: 10px 0 0;
  padding-left: 18px;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
}
.author-list li{
  margin: 6px 0;
}
@media (max-width: 920px){
  .hero{ grid-template-columns: 1fr; }
  .grid-2{ grid-template-columns: 1fr; }
  .author-grid{ grid-template-columns: 1fr; }
  .author-photo-wrap{ width: 140px; margin: 0 auto 8px; }
}

.card{
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 14px;
}

.card-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.card-title{
  font-weight: 900;
  letter-spacing: 0.2px;
}
.badges{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.badge{
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}
.badge.blue{ border-color: rgba(59,130,246,0.35); background: rgba(59,130,246,0.18); }
.badge.red{ border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.14); }
.badge.amber{ border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.14); }
.badge.green{ border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.14); }
.badge.mono{ font-family: var(--mono); }

.field-row{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.field-row.two{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 560px){
  .field-row{ grid-template-columns: 1fr; }
}

.field{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.2px;
}
.input, select{
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(9, 16, 28, 0.55);
  color: rgba(255,255,255,0.94);
  border-radius: 12px;
  padding: 10px 10px;
  outline: none;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.input:focus, select:focus{
  border-color: rgba(59,130,246,0.42);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.18);
}
.help{
  font-size: 12px;
  color: var(--faint);
  line-height: 1.35;
}

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

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

#measurementsActions{
  margin-top: 10px;
}
@media (max-width: 560px){
  #measurementsActions{ margin-top: 0px; }
}
.btn{
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.94);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 900;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: 120ms ease;
  font-size: 14px;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,0.09); }
.btn:active{ transform: translateY(0px); }
.btn.primary{
  background: rgba(59,130,246,0.22);
  border-color: rgba(59,130,246,0.42);
}
.btn.primary:hover{ background: rgba(59,130,246,0.28); }
.btn.danger{
  background: rgba(239,68,68,0.18);
  border-color: rgba(239,68,68,0.35);
}
.btn.ghost{
  background: transparent;
}
.btn.small{
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 12px;
}
.btn:disabled{
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.divider{
  height: 1px;
  background: rgba(255,255,255,0.10);
  margin: 12px 0;
}

.results{
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.card[data-eye-card][data-has-result="0"] .results{
  display: none;
}

.kv{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 560px){
  .kv{ grid-template-columns: 1fr; }
}
.kv-item{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 10px 10px;
}

.kv-item.full{
  grid-column: 1 / -1;
}
.kv-k{
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.kv-v{
  margin-top: 4px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.kv-item.kv-final{
  border-color: rgba(34,197,94,0.30);
  background: rgba(34,197,94,0.08);
}

.kv-v.final{
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(34,197,94,0.28);
  background: rgba(34,197,94,0.12);
}

.kv-v.final-none{
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.02);
}

.scale-wrap{
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
  border-radius: 14px;
  padding: 10px 10px 12px;
  margin-top: 10px;
}
.scale-axis{
  position: relative;
  height: 18px;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,0.70);
}
.tick{
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.tick .line{
  width: 1px;
  height: 7px;
  background: rgba(255,255,255,0.25);
}
.tick .lab{
  white-space: nowrap;
}

.scale{
  position: relative;
  height: 62px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}
.segment{
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-weight: 900;
  font-size: 12px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.segment .sub{
  font-weight: 800;
  font-size: 11px;
  color: rgba(255,255,255,0.92);
  opacity: 0.95;
  margin-top: 2px;
}
.indicator{
  position: absolute;
  top: 0;
  height: 100%;
  width: 2px;
  background: rgba(239,68,68,0.95);
  box-shadow: 0 0 0 2px rgba(239,68,68,0.18);
}
.indicator-cap{
  position: absolute;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(239,68,68,0.95);
  background: rgba(0,0,0,0.5);
  transform: translate(-50%, -30%);
}
.scale-meta{
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.note{
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  padding: 12px 12px;
  height: 96px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  color: rgba(255,255,255,0.84);
  font-size: 13px;
}
.note .muted{ color: var(--muted); }

.note-line{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.25;
}

.note-pearl{
  font-size: 12.5px;
  line-height: 1.3;
}

.table{
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
}
.table th, .table td{
  padding: 10px 10px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.table th{
  text-align: left;
  color: rgba(255,255,255,0.82);
  font-weight: 900;
  background: rgba(255,255,255,0.06);
}
.table td{
  color: rgba(255,255,255,0.90);
}
.table tr:last-child td{ border-bottom: 0; }
.mono{ font-family: var(--mono); }

.callout{
  border: 1px solid rgba(59,130,246,0.35);
  background: rgba(59,130,246,0.14);
  border-radius: 16px;
  padding: 12px 12px;
  margin-top: 12px;
}
.callout h3{
  margin: 0 0 6px 0;
  font-size: 14px;
  letter-spacing: 0.2px;
}
.callout p{ margin: 0; color: var(--muted); line-height: 1.4; font-size: 13px; }

.footer{
  margin-top: 18px;
  color: rgba(255,255,255,0.60);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  padding-bottom: 20px;
}

.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.70);
  backdrop-filter: blur(6px);
  display: none;
  z-index: 100;
}
.modal{
  width: min(920px, 92vw);
  max-height: min(84vh, 760px);
  margin: 7vh auto 0;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(7, 12, 22, 0.92);
  box-shadow: 0 22px 70px rgba(0,0,0,0.55);
  overflow: hidden;
}
.modal-header{
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.modal-title{
  font-weight: 900;
  letter-spacing: 0.2px;
}
.modal-body{
  padding: 0;
}
.modal-scroll{
  max-height: min(62vh, 560px);
  overflow: auto;
  padding: 14px 16px;
  color: rgba(255,255,255,0.84);
  line-height: 1.45;
  font-size: 13px;
}
.modal-footer{
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.10);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.checkbox{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: rgba(255,255,255,0.84);
  font-size: 13px;
  line-height: 1.35;
}
.checkbox input{ margin-top: 2px; }

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

.consent-tile{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  user-select: none;
}
.consent-tile:hover{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.22);
}
.consent-tile input{
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: rgba(96,165,250,1);
}
.consent-tile strong{
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: rgba(255,255,255,0.92);
  margin-bottom: 4px;
}
.consent-tile .muted{
  display: block;
  font-size: 12.5px;
  line-height: 1.4;
}

.consent-tile.is-disabled{
  opacity: 0.60;
  cursor: not-allowed;
}
.consent-tile.is-disabled:hover{
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.14);
  transform: none;
}
.consent-tile.is-disabled input{
  pointer-events: none;
}

.toast{
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7,12,22,0.9);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.35);
  color: rgba(255,255,255,0.92);
  display: none;
  z-index: 120;
  width: min(720px, 92vw);
}

.print-sheet{
  display: none;
  color: #111827;
  font-family: var(--sans);
}

@media print{
  body{
    background: white !important;
    color: #111827 !important;
  }
  .nav, .hero, .section, .footer, .toast, .modal-backdrop{ display: none !important; }
  .print-sheet{
    display: block !important;
  }
  .print-page{
    padding: 0;
  }
  .print-card{
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 10px;
    margin-bottom: 10px;
  }
  .print-title{
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 6px 0;
  }
  .print-meta{
    font-size: 12px;
    color: #374151;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  .print-table{
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
  }
  .print-table th, .print-table td{
    border: 1px solid #e5e7eb;
    padding: 6px 6px;
    font-size: 11.5px;
    vertical-align: top;
  }
  .print-table th{
    background: #f3f4f6;
    text-align: left;
    font-weight: 800;
  }
  .print-h2{
    font-size: 13px;
    font-weight: 800;
    margin: 8px 0 6px 0;
  }
  .print-note{
    font-size: 11.5px;
    color: #374151;
    line-height: 1.35;
  }
  .print-badge{
    display: inline-block;
    font-family: var(--mono);
    font-size: 11px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 2px 8px;
    margin-right: 6px;
  }
  @page{
    margin: 10mm;
  }
}

.attention{
  outline: 2px solid rgba(59,130,246,0.65);
  box-shadow: 0 0 0 8px rgba(59,130,246,0.16);
  animation: attentionPulse 1.15s ease-out 0s 2;
}

@keyframes attentionPulse{
  0%{ box-shadow: 0 0 0 0 rgba(59,130,246,0.22); }
  100%{ box-shadow: 0 0 0 14px rgba(59,130,246,0); }
}
