:root{
  --bg:#0b1220;
  --card:#0f1b33;
  --card2:#0c1730;
  --text:#e5e7eb;
  --muted:#9aa4b2;
  --line:#1f2a44;
  --btn:#1f2a44;
  --btn2:#2b3a60;
  --accent:#8ab4ff;
  --danger:#b91c1c;
  --radius:14px;
}

*{box-sizing:border-box}

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

header{
  padding:10px 12px;
  background:#081025;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

header.sticky-header{
  position:sticky;
  top:0;
  z-index:5;
}

header h1{
  margin:0;
  font-size:14px;
  font-weight:900;
  letter-spacing:.2px;
}

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

.pill{
  font-size:12px;
  font-weight:800;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(138,180,255,.12);
  color:var(--accent);
  border:1px solid rgba(138,180,255,.25);
}

a.btnlink{
  font-size:12px;
  color:var(--muted);
  text-decoration:none;
  border:1px solid var(--line);
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.03);
}

main{
  padding:12px;
  max-width:860px;
  margin:0 auto;
}

main.main-wide{
  max-width:980px;
}

.card{
  background:linear-gradient(180deg,var(--card),var(--card2));
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:12px;
  margin-bottom:10px;
}

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

.row > *{
  flex:1;
  min-width:180px;
}

.row-wide .row > *{
  min-width:220px;
}

.row .full-row{
  flex-basis:100%;
  min-width:220px;
}

label{
  display:block;
  font-size:11px;
  color:var(--muted);
  margin-bottom:6px;
}

select,
input,
textarea{
  width:100%;
  padding:10px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--text);
  outline:none;
  font-size:14px;
}

input[type="range"]{
  padding:0;
}

textarea{
  min-height:140px;
  font-family:ui-monospace,Menlo,Consolas,monospace;
}

.btnbar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:center;
  margin-top:10px;
}

.btnbar.primary,
.btnbar.controls{
  flex-wrap:nowrap;
}

.btnbar.primary .btn,
.btnbar.controls .btn{
  flex:1 1 0;
  min-width:0;
}

.btn{
  border:1px solid var(--line);
  background:var(--btn);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:900;
}

.btn.jumbo{
  font-size:clamp(18px, 4vw, 30px);
  padding:clamp(14px, 3vw, 22px) clamp(18px, 5vw, 30px);
}

.btn-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:1.2em;
  margin-right:8px;
}

.btn-label{
  display:inline-block;
}

.btn.secondary{background:var(--btn2)}

.btn.success{
  background:rgba(22,163,74,.35);
  border-color:rgba(22,163,74,.6);
}

.btn.danger{
  background:rgba(185,28,28,.25);
  border-color:rgba(185,28,28,.45);
}

.btn:disabled{
  background:rgba(148,163,184,.25);
  border-color:rgba(148,163,184,.4);
  color:rgba(226,232,240,.6);
  cursor:not-allowed;
}

.big{
  font-weight:950;
  font-size:16px;
  text-align:center;
}

#titleLine{
  font-size:clamp(20px, 5vw, 34px);
}

#subtitleLine{
  font-size:clamp(14px, 3vw, 20px);
}

#progressLine{
  font-size:clamp(16px, 4vw, 24px);
}

.muted{
  color:var(--muted);
  font-size:12px;
  text-align:center;
  margin-top:4px;
}

.progress{
  color:var(--muted);
  font-size:12px;
  text-align:center;
  margin-top:8px;
}

.hide{display:none!important}

.tips{
  font-size:12px;
  color:var(--muted);
  line-height:1.4;
}

.kbd{
  font-family:ui-monospace,Menlo,Consolas,monospace;
  background:rgba(255,255,255,.06);
  border:1px solid var(--line);
  border-radius:8px;
  padding:2px 6px;
}

.note{
  font-size:12px;
  color:var(--muted);
  line-height:1.4;
}

.faq{
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  background:rgba(255,255,255,.03);
}

.faq + .faq{
  margin-top:10px;
}

.faq summary{
  cursor:pointer;
  font-weight:800;
}

.faq-body{
  margin-top:8px;
  color:var(--text);
}

.title{
  font-weight:950;
  text-align:center;
}

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

.segItem{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px 10px;
  border-radius:14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  cursor:pointer;
  user-select:none;
  min-height:46px;
  text-align:center;
}

.segItem span{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
  font-weight:800;
}

.segItem input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.segItem:has(input:checked){
  background: rgba(99,102,241,.22);
  border-color: rgba(99,102,241,.55);
  box-shadow: 0 0 0 1px rgba(99,102,241,.35) inset;
}

@media (max-width: 420px){
  .seg{
    grid-template-columns: 1fr;
  }

  .segItem span{
    text-overflow:clip;
    overflow:visible;
    white-space:normal;
  }
}

.mt-0{margin-top:0}
.mt-6{margin-top:6px}
.mt-8{margin-top:8px}
.mt-10{margin-top:10px}
.mt-12{margin-top:12px}

.text-center{text-align:center}
.justify-start{justify-content:flex-start}
.w-100{width:100%}

.divider{
  border:0;
  border-top:1px solid var(--line);
  margin:12px 0;
}
