/* Mobile-first, iPhone friendly */
:root{
  --bg:#0b0f14;
  --card:#0f1722;
  --text:#e8eef7;
  --muted:#a8b3c3;
  --border:#223043;
  --accent:#7aa7ff;
  --danger:#ff6b6b;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap{
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 12px 24px;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11,15,20,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(34,48,67,.55);
  padding-top: env(safe-area-inset-top);
}

.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.brand__dot{
  width:12px;height:12px;border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(122,167,255,.15);
}
.brand__title{font-weight: 800; letter-spacing:.2px}
.brand__subtitle{font-size:.9rem;color:var(--muted)}

.iconbtn{
  border: 1px solid rgba(34,48,67,.75);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 20px;
  line-height: 1;
}

.card{
  background: var(--card);
  border: 1px solid rgba(34,48,67,.75);
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}

h2,h3{margin: 0 0 10px}
.muted{color:var(--muted)}
.fine{font-size:.92rem; line-height:1.35}

.progress{margin-bottom: 14px}
.progress__label{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.progress__bar{
  height: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(34,48,67,.75);
  border-radius: 999px;
  overflow:hidden;
}
.progress__fill{
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .25s ease;
}

.qa__q{
  font-weight: 900;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.hint{
  margin: 0 0 12px 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(122,167,255,.35);
  background: rgba(122,167,255,.08);
  color: var(--text);
  font-weight: 750;
  line-height: 1.25;
}

.options{
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.opt{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(34,48,67,.85);
  background: rgba(255,255,255,.03);
  min-height: 52px; /* big tap target */
}

.opt input{transform: scale(1.15)}
.opt strong{font-weight:900}

.nav{
  display:flex;
  gap: 10px;
  margin-top: 14px;
}
.btn{
  flex:1;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 950;
  background: var(--accent);
  color: #07101c;
}
.btn:disabled{opacity:.45}
.btn.secondary{
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(34,48,67,.85);
}

.mini-actions{
  display:flex;
  justify-content: space-between;
  margin-top: 10px;
}
.linkbtn{
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 10px 6px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.result{
  border: 1px dashed rgba(34,48,67,.95);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.02);
}
.result .big{font-size:1.05rem;font-weight:950;margin:0 0 6px}
.result ul{margin:8px 0 0 18px}

.docs{margin: 8px 0 0 18px}
.actions{display:flex;flex-direction: column;gap: 10px;margin-top: 12px}

.info{
  margin-top: 10px;
  border: 1px solid rgba(34,48,67,.85);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.03);
}
.info h3{margin:0 0 8px}
.info ul{margin: 8px 0 0 18px}

.tree{
  white-space: pre-wrap;
  line-height: 1.25;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(34,48,67,.85);
  border-radius: 14px;
  padding: 12px;
  overflow:auto;
}

.chips{display:flex;flex-direction:column;gap:10px;margin:6px 0 14px}
.chip{
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(34,48,67,.85);
  background: rgba(255,255,255,.03);
  color: var(--text);
  line-height: 1.25;
}
.chip strong{font-weight:950}

/* Bottom sheet */
.sheet.hidden{display:none}
.sheet{
  position: fixed; inset: 0;
  z-index: 60;
}
.sheet__backdrop{
  position: absolute; inset:0;
  background: rgba(0,0,0,.55);
}
.sheet__panel{
  position: absolute; left:0; right:0; bottom:0;
  background: var(--card);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  border: 1px solid rgba(34,48,67,.85);
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(0,0,0,.5);
}
.sheet__handle{
  width: 56px; height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  margin: 6px auto 10px;
}
.sheet__item{
  width:100%;
  text-align:left;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(34,48,67,.85);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-weight: 900;
  margin: 8px 0;
}
.sheet__item.danger{border-color: rgba(255,107,107,.55); color: #ffd2d2}

/* Print */
@media print{
  :root{--bg:#fff;--card:#fff;--text:#000;--muted:#222;--border:#999;--accent:#000}
  body{background:#fff;color:#000}
  .topbar, .nav, .mini-actions, .sheet{display:none !important}
  .card{border:0;box-shadow:none}
  .actions{display:none}
}
