  :root{
    --bg: #0B1220;
    --surface: #101a2e;
    --surface-2: #16223b;
    --line: #26344f;
    --ink: #E9EDF5;
    --muted: #8493AD;
    --amber: #FFB020;
    --green: #34D399;
    --red: #F87171;
  }
  *{box-sizing:border-box; margin:0; padding:0;}
  html{scroll-behavior:smooth;}
  body{
    background:
      radial-gradient(1200px 600px at 15% -10%, rgba(255,176,32,0.07), transparent 60%),
      radial-gradient(900px 500px at 100% 0%, rgba(52,211,153,0.06), transparent 55%),
      var(--bg);
    color:var(--ink);
    font-family:'IBM Plex Sans Arabic', sans-serif;
    line-height:1.6;
    min-height:100vh;
  }
  html[lang="en"] body{ font-family:'IBM Plex Sans', sans-serif; }
  .mono{font-family:'IBM Plex Mono',monospace; direction:ltr; unicode-bidi:plaintext;}
  .display{font-family:'Space Grotesk','IBM Plex Sans Arabic',sans-serif;}
  a{color:inherit; text-decoration:none;}
  button{font:inherit; cursor:pointer; background:none; border:none; color:inherit;}
  .wrap{max-width:1120px; margin:0 auto; padding:0 24px;}

  header{
    position:sticky; top:0; z-index:50;
    background:rgba(11,18,32,0.85);
    backdrop-filter: blur(10px);
    border-bottom:1px solid var(--line);
  }
  nav.wrap{ display:flex; align-items:center; justify-content:space-between; height:68px; gap:16px; }
  .brand{display:flex; align-items:center; gap:10px; font-weight:700; font-size:1.15rem; flex-shrink:0;}
  .brand .dot{ width:9px; height:9px; border-radius:50%; background:var(--amber); box-shadow:0 0 0 4px rgba(255,176,32,0.15); }
  .navlinks{display:flex; gap:28px; font-size:.92rem; color:var(--muted);}
  .navlinks a:hover{color:var(--ink);}
  .navcta{display:flex; gap:10px; align-items:center; flex-shrink:0;}
  .btn{ padding:9px 18px; border-radius:9px; font-size:.9rem; font-weight:600; border:1px solid var(--line); transition:.15s; display:inline-block; }
  .btn-ghost{color:var(--muted);}
  .btn-ghost:hover{color:var(--ink); border-color:#3a4a68;}
  .btn-solid{background:var(--amber); color:#1a1204; border-color:var(--amber);}
  .btn-solid:hover{filter:brightness(1.08);}
  .btn-solid:disabled{opacity:.5; cursor:not-allowed; filter:none;}
  .lang-switch{
    display:flex; align-items:center; border:1px solid var(--line); border-radius:8px; overflow:hidden;
    font-family:'IBM Plex Mono',monospace; font-size:.76rem;
  }
  .lang-switch button{ padding:7px 11px; color:var(--muted); }
  .lang-switch button.active{ background:var(--surface-2); color:var(--amber); }
  @media (max-width:820px){ .navlinks{display:none;} }

  .hero{padding:76px 0 40px;}
  .eyebrow{
    display:inline-flex; align-items:center; gap:8px;
    font-family:'IBM Plex Mono',monospace; font-size:.78rem; letter-spacing:.06em;
    color:var(--green); background:rgba(52,211,153,0.08);
    border:1px solid rgba(52,211,153,0.25); border-radius:999px;
    padding:6px 14px; margin-bottom:22px;
  }
  .eyebrow .blip{width:6px;height:6px;border-radius:50%;background:var(--green); animation:blip 1.6s ease-in-out infinite;}
  @keyframes blip{0%,100%{opacity:1} 50%{opacity:.25}}
  h1{ font-size:clamp(2.1rem, 5vw, 3.4rem); font-weight:700; line-height:1.18; max-width:760px; letter-spacing:-.01em; }
  h1 .accent{color:var(--amber);}
  .sub{ margin-top:20px; color:var(--muted); font-size:1.08rem; max-width:560px; }

  /* DROP ZONE */
  .dropzone{
    margin-top:44px; position:relative; background:var(--surface);
    border:1.5px dashed #3a4a68; border-radius:18px; padding:44px 28px;
    text-align:center; transition:.2s; overflow:hidden; cursor:pointer;
  }
  .dropzone:hover, .dropzone.dragover{border-color:var(--amber); background:var(--surface-2);}
  .dropzone::before, .dropzone::after{
    content:""; position:absolute; width:22px; height:22px; border-radius:50%; background:var(--bg); top:50%; transform:translateY(-50%);
  }
  .dropzone::before{right:-11px;}
  .dropzone::after{left:-11px;}
  .dz-icon{ width:52px; height:52px; margin:0 auto 18px; border-radius:12px; background:rgba(255,176,32,0.1); border:1px solid rgba(255,176,32,0.3); display:flex; align-items:center; justify-content:center; }
  .dz-icon svg{width:24px; height:24px; stroke:var(--amber);}
  .dz-title{font-weight:600; font-size:1.05rem;}
  .dz-sub{color:var(--muted); font-size:.88rem; margin-top:6px;}
  .dz-meta{ margin-top:22px; display:flex; justify-content:center; gap:18px; flex-wrap:wrap; font-family:'IBM Plex Mono',monospace; font-size:.74rem; color:var(--muted); }
  .dz-meta b{color:var(--ink); font-weight:500;}

  /* FILE QUEUE (uploader) */
  .queue{ margin-top:20px; display:flex; flex-direction:column; gap:10px; }
  .qitem{
    background:var(--surface); border:1px solid var(--line); border-radius:12px;
    padding:14px 16px; text-align:start;
  }
  .qitem-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
  .qitem-name{ font-weight:600; font-size:.9rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .qitem-size{ color:var(--muted); font-size:.76rem; font-family:'IBM Plex Mono',monospace; flex-shrink:0; }
  .qitem-bar{ height:5px; border-radius:4px; background:var(--line); margin-top:10px; overflow:hidden; }
  .qitem-bar-fill{ height:100%; width:0%; background:linear-gradient(90deg, var(--green), var(--amber)); border-radius:4px; transition:width .15s linear; }
  .qitem-status{ display:flex; align-items:center; justify-content:space-between; margin-top:8px; font-size:.76rem; color:var(--muted); font-family:'IBM Plex Mono',monospace; }
  .qitem-link-row{ display:none; margin-top:10px; align-items:center; gap:8px; flex-wrap:wrap; }
  .qitem.done .qitem-link-row{ display:flex; }
  .qitem.done .qitem-bar-fill{ background:var(--green); }
  .qitem.error .qitem-bar-fill{ background:var(--red); }
  .qitem.error .status-text{ color:var(--red); }
  .link-box{
    flex:1; min-width:180px; background:var(--bg); border:1px solid var(--line); border-radius:7px;
    padding:8px 10px; font-family:'IBM Plex Mono',monospace; font-size:.78rem; color:var(--green);
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; direction:ltr; text-align:left;
  }
  .copy-btn{
    border:1px solid var(--line); border-radius:7px; padding:8px 12px; font-size:.76rem; color:var(--ink);
    flex-shrink:0; transition:.15s;
  }
  .copy-btn:hover{border-color:var(--amber); color:var(--amber);}
  .copy-btn.copied{border-color:var(--green); color:var(--green);}
  .qitem-remove{ color:var(--muted); font-size:.75rem; flex-shrink:0; }
  .qitem-remove:hover{ color:var(--red); }
  input[type=file]{ display:none; }

  /* RAIL */
  .rail-section{padding:64px 0 20px;}
  .rail-label{ font-family:'IBM Plex Mono',monospace; font-size:.75rem; color:var(--muted); display:flex; justify-content:space-between; margin-bottom:14px; }
  .rail{ position:relative; height:2px; background:var(--line); border-radius:2px; margin:0 6px; }
  .rail .fill{ position:absolute; top:0; inset-inline-end:0; height:100%; width:0%; background:linear-gradient(90deg, var(--green), var(--amber)); border-radius:2px; animation:fillRail 5s ease-in-out infinite; }
  @keyframes fillRail{ 0%{width:0%} 45%{width:100%} 55%{width:100%} 100%{width:0%} }
  .rail .pulse{ position:absolute; top:50%; width:10px; height:10px; border-radius:50%; background:var(--amber); inset-inline-end:0; transform:translate(50%,-50%); box-shadow:0 0 12px 2px rgba(255,176,32,0.7); animation:movePulse 5s ease-in-out infinite; }
  html[lang="en"] .rail .pulse{ transform:translate(-50%,-50%); }
  @keyframes movePulse{ 0%{inset-inline-end:0%} 45%{inset-inline-end:100%} 55%{inset-inline-end:100%} 100%{inset-inline-end:0%} }
  .steps{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-top:18px; }
  .step{text-align:center; padding-top:6px;}
  .step .num{ width:26px; height:26px; margin:0 auto 10px; border-radius:50%; border:1px solid var(--line); background:var(--surface); display:flex; align-items:center; justify-content:center; font-family:'IBM Plex Mono',monospace; font-size:.72rem; color:var(--muted); }
  .step .t{font-weight:600; font-size:.92rem;}
  .step .d{color:var(--muted); font-size:.78rem; margin-top:4px;}
  @media (max-width:700px){ .steps{grid-template-columns:1fr 1fr;} }

  .manifest{ margin-top:70px; border:1px solid var(--line); border-radius:16px; background:var(--surface); overflow:hidden; }
  .manifest-head{ display:flex; align-items:center; justify-content:space-between; padding:16px 22px; border-bottom:1px solid var(--line); font-family:'IBM Plex Mono',monospace; font-size:.75rem; color:var(--muted); }
  .manifest-grid{ display:grid; grid-template-columns:repeat(4,1fr); }
  .m-cell{ padding:22px; border-inline-start:1px solid var(--line); }
  .m-cell:first-child{border-inline-start:none;}
  .m-num{font-family:'IBM Plex Mono',monospace; font-size:1.5rem; font-weight:500; color:var(--ink);}
  .m-num .u{color:var(--amber); font-size:1rem;}
  .m-label{color:var(--muted); font-size:.8rem; margin-top:6px;}
  @media (max-width:700px){ .manifest-grid{grid-template-columns:1fr 1fr;} .m-cell:nth-child(3){border-inline-start:none;} }

  .features{padding:88px 0;}
  .features-head{max-width:520px; margin-bottom:44px;}
  .features-head .eyebrow{margin-bottom:16px;}
  .features-head h2{font-size:clamp(1.6rem,3vw,2.1rem); font-weight:700;}
  .features-head p{color:var(--muted); margin-top:12px;}
  .fgrid{display:grid; grid-template-columns:repeat(3,1fr); gap:1px; background:var(--line); border:1px solid var(--line); border-radius:16px; overflow:hidden;}
  .fcard{background:var(--surface); padding:28px 24px;}
  .fcard .fi{width:38px; height:38px; margin-bottom:16px; color:var(--amber);}
  .fcard .fi svg{width:100%; height:100%;}
  .fcard h3{font-size:1rem; font-weight:600; margin-bottom:8px;}
  .fcard p{color:var(--muted); font-size:.88rem;}
  @media (max-width:760px){ .fgrid{grid-template-columns:1fr;} }

  .cta{ margin:0 auto 90px; max-width:1120px; padding:0 24px; }
  .cta-box{ border-radius:20px; padding:52px 40px; text-align:center; background:linear-gradient(160deg, var(--surface-2), var(--surface)); border:1px solid var(--line); position:relative; overflow:hidden; }
  .cta-box h2{font-size:clamp(1.5rem,3vw,2rem); font-weight:700;}
  .cta-box p{color:var(--muted); margin-top:10px;}
  .cta-box .btn{margin-top:24px; display:inline-block;}

  footer{border-top:1px solid var(--line); padding:34px 0; color:var(--muted); font-size:.82rem;}
  footer .wrap{display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px;}

  /* USER CHIP (shown after fake login) */
  .user-chip{ display:none; align-items:center; gap:10px; }
  .user-chip.active{ display:flex; }
  .user-chip .avatar{
    width:30px; height:30px; border-radius:50%; background:var(--amber); color:#1a1204;
    display:flex; align-items:center; justify-content:center; font-weight:700; font-size:.82rem; flex-shrink:0;
  }
  .user-chip .uname{ font-size:.86rem; font-weight:600; max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .user-chip .logout-btn{ color:var(--muted); font-size:.8rem; border:1px solid var(--line); border-radius:8px; padding:7px 12px; transition:.15s; }
  .user-chip .logout-btn:hover{ color:var(--red); border-color:var(--red); }
  .navcta.logged-in .btn-ghost, .navcta.logged-in .btn-solid{ display:none; }

  /* AUTH MODALS */
  .modal-overlay{
    position:fixed; inset:0; background:rgba(6,10,18,0.72); backdrop-filter:blur(3px);
    display:none; align-items:center; justify-content:center; z-index:100; padding:20px;
  }
  .modal-overlay.open{ display:flex; }
  .modal-box{
    width:100%; max-width:400px; background:var(--surface); border:1px solid var(--line);
    border-radius:18px; padding:30px 28px; position:relative; box-shadow:0 20px 60px rgba(0,0,0,0.4);
  }
  .modal-close{
    position:absolute; top:16px; inset-inline-end:16px; width:30px; height:30px; border-radius:8px;
    display:flex; align-items:center; justify-content:center; color:var(--muted); transition:.15s;
  }
  .modal-close:hover{ color:var(--ink); background:var(--surface-2); }
  .modal-title{ font-weight:700; font-size:1.2rem; margin-bottom:6px; }
  .modal-sub{ color:var(--muted); font-size:.85rem; margin-bottom:22px; }
  .field{ margin-bottom:16px; }
  .field label{ display:block; font-size:.82rem; color:var(--muted); margin-bottom:7px; }
  .field input{
    width:100%; background:var(--bg); border:1px solid var(--line); border-radius:9px;
    padding:11px 13px; color:var(--ink); font-size:.92rem; font-family:inherit; transition:.15s;
  }
  .field input:focus{ outline:none; border-color:var(--amber); }
  .field-err{ color:var(--red); font-size:.76rem; margin-top:6px; display:none; }
  .field.invalid input{ border-color:var(--red); }
  .field.invalid .field-err{ display:block; }
  .modal-submit{ width:100%; padding:12px; border-radius:9px; margin-top:6px; }
  .modal-form-err{
    background:rgba(248,113,113,0.08); border:1px solid rgba(248,113,113,0.3); color:var(--red);
    font-size:.82rem; border-radius:9px; padding:10px 12px; margin-bottom:16px; display:none;
  }
  .modal-form-err.show{ display:block; }
  .modal-switch{ text-align:center; margin-top:20px; font-size:.84rem; color:var(--muted); }
  .modal-switch button{ color:var(--amber); font-weight:600; }
  .modal-switch button:hover{ text-decoration:underline; }
  .modal-success{ text-align:center; padding:10px 0 4px; }
  .modal-success .ok-icon{
    width:48px; height:48px; margin:0 auto 16px; border-radius:50%; background:rgba(52,211,153,0.1);
    border:1px solid rgba(52,211,153,0.3); color:var(--green); display:flex; align-items:center; justify-content:center;
  }
  .modal-success .ok-icon svg{ width:22px; height:22px; }

  @media (prefers-reduced-motion: reduce){ *{animation:none !important; transition:none !important;} }

  /* STANDALONE AUTH PAGE (login.html) — reuses .modal-box styling but centered in normal page flow */
  .auth-page{ min-height:calc(100vh - 69px); display:flex; align-items:center; justify-content:center; padding:40px 20px; }
  .auth-page .modal-box{ position:relative; width:100%; max-width:400px; }
  .auth-page .modal-close{ display:none; }
  .back-home{ display:inline-flex; align-items:center; gap:6px; color:var(--muted); font-size:.86rem; }
  .back-home:hover{ color:var(--ink); }
