:root{
      --bg:#0b0f14;
      --panel:#0f1621;
      --panel-2:#111b29;
      --text:#f5f7fb;
      --muted:#b9c2d3;
      --accent:#7dd3fc;
      --accent-2:#a78bfa;
      --ok:#86efac;
      --warn:#fbbf24;
      --danger:#f87171;
      --radius:18px;
      --shadow: 0 10px 30px rgba(0,0,0,.35);
      --focus: 0 0 0 3px rgba(125,211,252,.25);
    }
    *{box-sizing:border-box}

    body{
      margin:0;
      font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Vazirmatn", Arial, sans-serif;
      background:
        radial-gradient(1200px 600px at 10% 10%, rgba(167,139,250,.12), transparent 60%),
        radial-gradient(900px 500px at 90% 20%, rgba(125,211,252,.12), transparent 60%),
        linear-gradient(180deg, #070a0f, var(--bg));
      color:var(--text);
      min-height:100vh;
      display:flex;
      align-items:center;
      justify-content:center;
      padding:20px;
    }

    .app{
      width:min(1040px, 100%);
      display:grid;
      grid-template-columns: 360px 1fr;
      gap:16px;
    }
    @media (max-width: 900px){
      .app{grid-template-columns: 1fr}
    }

    .side{
      background: linear-gradient(135deg, rgba(125,211,252,.08), rgba(167,139,250,.08));
      border:1px solid rgba(255,255,255,.06);
      border-radius: var(--radius);
      padding:22px 20px;
      box-shadow: var(--shadow);
      overflow:hidden;
    }
    .brand{
      display:flex;
      align-items:center;
      gap:10px;
      margin-bottom:12px;
    }
    .dot{
      width:12px;height:12px;border-radius:50%;
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      box-shadow: 0 0 18px rgba(167,139,250,.55);
    }
    .title{
      font-size:20px;
      font-weight:800;
      letter-spacing:.2px;
    }
    .subtitle{
      color:var(--muted);
      font-size:12.5px;
      line-height:1.7;
      margin:8px 0 18px;
    }
    .steps{
      display:grid;
      gap:10px;
      margin-top:10px;
      max-height: 56vh;
      overflow:auto;
      padding-right:2px;
    }
    .step-pill{
      display:flex;
      align-items:center;
      gap:10px;
      padding:10px 12px;
      border-radius:12px;
      background: rgba(255,255,255,.03);
      border:1px solid rgba(255,255,255,.05);
      color:var(--muted);
      font-size:12.5px;
      transition: .2s ease;
    }
    .step-pill.active{
      color:var(--text);
      border-color: rgba(125,211,252,.35);
      background: linear-gradient(90deg, rgba(125,211,252,.08), rgba(167,139,250,.06));
    }
    .step-pill.done{
      color: #eafff2;
      border-color: rgba(134,239,172,.35);
      background: linear-gradient(90deg, rgba(134,239,172,.08), rgba(125,211,252,.05));
    }
    .step-index{
      width:22px;height:22px;border-radius:7px;
      display:grid;place-items:center;
      background: rgba(255,255,255,.06);
      font-weight:600;
      font-size:11px;
      color:var(--muted);
      flex:0 0 22px;
    }
    .step-pill.active .step-index{
      color:var(--text);
      background: rgba(125,211,252,.18);
    }
    .step-pill.done .step-index{
      color: #0b1610;
      background: rgba(134,239,172,.85);
    }

    .main{
      background: linear-gradient(180deg, var(--panel), var(--panel-2));
      border:1px solid rgba(255,255,255,.06);
      border-radius: var(--radius);
      padding:24px 24px 18px;
      box-shadow: var(--shadow);
      min-height: 560px;
      display:flex;
      flex-direction:column;
      gap:16px;
    }
    .head-row{
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:12px;
      flex-wrap:wrap;
    }
    .head-row h1{
      margin:0;
      font-size:22px;
      font-weight:800;
    }
    .head-row .hint{
      color:var(--muted);
      font-size:12.2px;
      line-height:1.6;
      margin-top:6px;
    }
    .progress{
      height:8px;
      background: rgba(255,255,255,.06);
      border-radius:999px;
      overflow:hidden;
      border:1px solid rgba(255,255,255,.04);
    }
    .progress-bar{
      height:100%;
      width:0%;
      background: linear-gradient(90deg, var(--accent), var(--accent-2));
      transition: width .25s ease;
    }

    .question-card{
      background: rgba(255,255,255,.03);
      border:1px solid rgba(255,255,255,.06);
      border-radius: 14px;
      padding:18px 18px 14px;
    }
    .q-title{
      font-size:16px;
      font-weight:750;
      margin:0 0 10px;
    }
    .q-desc{
      color:var(--muted);
      font-size:11.8px;
      margin:0 0 14px;
    }
    .inline-badge{
      display:inline-flex;
      align-items:center;
      gap:6px;
      padding:3px 8px;
      border-radius:999px;
      font-size:10px;
      font-weight:600;
      border:1px solid rgba(255,255,255,.08);
      background: rgba(255,255,255,.04);
      color: var(--muted);
      margin-right:6px;
    }

    .options{
      display:grid;
      grid-template-columns: repeat(2, minmax(0,1fr));
      gap:10px;
    }
    @media (max-width: 560px){
      .options{grid-template-columns: 1fr;}
    }
    .opt{
      appearance:none;
      border:1px solid rgba(255,255,255,.08);
      background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
      color:var(--text);
      padding:12px 12px 12px 14px;
      border-radius: 12px;
      cursor:pointer;
      text-align:right;
      font-size:13.5px;
      line-height:1.35;
      transition: .18s ease;
    }
    .opt:hover{
      transform: translateY(-1px);
      border-color: rgba(125,211,252,.35);
      background: linear-gradient(90deg, rgba(125,211,252,.08), rgba(167,139,250,.06));
    }
    .opt.selected{
      border-color: rgba(125,211,252,.55);
      background: linear-gradient(90deg, rgba(125,211,252,.14), rgba(167,139,250,.09));
    }
    .opt:focus-visible{ outline:none; box-shadow: var(--focus); }
    .opt small{
      display:block;
      color:var(--muted);
      font-size:10.8px;
      margin-top:3px;
    }

    .controls{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      margin-top:auto;
      padding-top:4px;
    }
    .left-controls, .right-controls{
      display:flex;
      gap:8px;
      flex-wrap:wrap;
    }
    .btn{
      appearance:none;
      border:1px solid rgba(255,255,255,.08);
      background: rgba(255,255,255,.04);
      color:var(--text);
      padding:10px 14px;
      border-radius: 12px;
      cursor:pointer;
      font-size:12.6px;
      font-weight:650;
      transition:.18s ease;
    }
    .btn:hover{transform: translateY(-1px); border-color: rgba(255,255,255,.18)}
    .btn:focus-visible{outline:none; box-shadow: var(--focus)}
    .btn.primary{
      background: linear-gradient(90deg, rgba(125,211,252,.18), rgba(167,139,250,.18));
      border-color: rgba(125,211,252,.45);
    }
    .btn.ghost{ background: transparent; }
    .btn.danger{
      border-color: rgba(248,113,113,.45);
      background: rgba(248,113,113,.08);
    }
    .btn.ok{
      border-color: rgba(134,239,172,.5);
      background: rgba(134,239,172,.08);
    }
    .btn.small{
      padding:7px 10px;
      font-size:11px;
      border-radius:10px;
    }

    .summary{
      display:none;
      animation: fadeIn .25s ease;
    }
    .summary.show{display:block;}
    @keyframes fadeIn{
      from{opacity:0; transform: translateY(6px)}
      to{opacity:1; transform: translateY(0)}
    }
    .summary-grid{
      display:grid;
      grid-template-columns: 1fr 1fr;
      gap:10px;
    }
    @media (max-width: 680px){
      .summary-grid{grid-template-columns: 1fr;}
    }
    .kv{
      background: rgba(255,255,255,.035);
      border:1px solid rgba(255,255,255,.06);
      border-radius: 12px;
      padding:12px 12px;
    }
    .kv .k{ color:var(--muted); font-size:11px; margin-bottom:6px; }
    .kv .v{ font-size:13.5px; font-weight:750; }

    .log-box{
      margin-top:8px;
      background: rgba(0,0,0,.25);
      border:1px dashed rgba(255,255,255,.12);
      border-radius: 12px;
      padding:14px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
      font-size:11.2px;
      line-height:1.55;
      color: #eaf2ff;
      white-space: pre-wrap;
      word-break: break-word;
    }
    .meta-row{
      display:flex;
      gap:8px;
      flex-wrap:wrap;
      margin-top:10px;
    }
    .tag{
      font-size:10.5px;
      color:var(--muted);
      padding:6px 8px;
      border-radius:999px;
      border:1px solid rgba(255,255,255,.08);
      background: rgba(255,255,255,.03);
    }
    .divider{
      height:1px;
      background: rgba(255,255,255,.06);
      margin: 14px 0;
    }
    .checklist{ display:grid; gap:8px; margin-top:8px; }
    .check{
      display:flex;
      gap:10px;
      align-items:flex-start;
      padding:10px 11px;
      border-radius: 10px;
      border:1px solid rgba(255,255,255,.06);
      background: rgba(255,255,255,.03);
      font-size:12.4px;
      color: var(--text);
    }
    .check input{
      margin-top:2px;
      accent-color: #8ab4ff;
      transform: scale(1.05);
    }

    .toast{
      position: fixed;
      bottom: 18px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(10,14,22,.92);
      border:1px solid rgba(255,255,255,.1);
      padding:10px 14px;
      border-radius: 12px;
      box-shadow: var(--shadow);
      font-size:12px;
      color:var(--text);
      opacity:0;
      pointer-events:none;
      transition: .2s ease;
      z-index: 9999;
    }
    .toast.show{opacity:1; transform: translateX(-50%) translateY(-4px)}

    .footer-note{
      color:var(--muted);
      font-size:10.8px;
      line-height:1.6;
    }