/* ================================================================
   main.css — Codeisa
   Aggregated primary stylesheet (preserves original cascade).
   Contains: design tokens, layout, components, IP-scanner styles,
   premium v3 typography & depth layer, and @view-transition.
   ================================================================ */

body { box-sizing: border-box; }
    * { font-family: 'Vazirmatn', sans-serif; }
    .glass { background: rgba(255,255,255,0.05); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.1); }
    .glass-dark { background: rgba(0,0,0,0.3); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.08); }

    /* Unified input styles (banking + dropdowns) */
    .input{
      width:100%;
      background: rgba(0,0,0,0.28);
      border: 1px solid rgba(255,255,255,0.14);
      color: rgba(255,255,255,0.92);
      border-radius: 14px;
      padding: 12px 14px;
      outline: none;
      box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
      font-variant-numeric: tabular-nums;
    }
    .input::placeholder{ color: rgba(255,255,255,0.35); }
    .input:focus{
      border-color: rgba(129,140,248,0.65);
      box-shadow: 0 0 0 3px rgba(99,102,241,0.20);
    }
    select.input{ -webkit-appearance:none; appearance:none; background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.7) 50%), linear-gradient(135deg, rgba(255,255,255,0.7) 50%, transparent 50%); background-position: calc(14px) 50%, calc(8px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-left: 34px; }
    select.input option{ background:#0b0b12; color:#fff; }
    input.input{ direction:ltr; text-align:right; }
    @keyframes blink { 0%,50%{opacity:1} 51%,100%{opacity:.3} }
    .blink { animation: blink 1.5s infinite; }
    @keyframes float { 0%,100%{transform:translateY(0) translateX(0)} 25%{transform:translateY(-10px) translateX(5px)} 50%{transform:translateY(-5px) translateX(-5px)} 75%{transform:translateY(-15px) translateX(3px)} }
    .cloud { animation: float 8s ease-in-out infinite; }
    @keyframes rain-fall { 0%{transform:translateY(-100%);opacity:0} 10%{opacity:1} 90%{opacity:1} 100%{transform:translateY(400px);opacity:0} }
    .rain-drop { animation: rain-fall 1s linear infinite; }
    @keyframes snow-fall { 0%{transform:translateY(-100%) rotate(0deg);opacity:0} 10%{opacity:1} 90%{opacity:.8} 100%{transform:translateY(400px) rotate(360deg);opacity:0} }
    .snow-flake { animation: snow-fall 3s linear infinite; }
    @keyframes sun-pulse { 0%,100%{transform:scale(1);filter:drop-shadow(0 0 20px rgba(255,200,0,.5))} 50%{transform:scale(1.05);filter:drop-shadow(0 0 30px rgba(255,200,0,.7))} }
    .sun-glow { animation: sun-pulse 3s ease-in-out infinite; }
    @keyframes twinkle { 0%,100%{opacity:.3} 50%{opacity:1} }
    .star { animation: twinkle 2s ease-in-out infinite; }
    .nav-btn { transition: all .2s ease; }
    .nav-btn:active { transform: scale(.95); }
    .nav-btn.active { background: linear-gradient(135deg, rgba(99,102,241,.4), rgba(168,85,247,.4)); border-color: rgba(139,92,246,.5); }
    .banking-tab.active { background: linear-gradient(135deg, rgba(99,102,241,.4), rgba(168,85,247,.4)); border: 1px solid rgba(139,92,246,.5); }
    .calc-btn { transition: all .15s ease; }
    .calc-btn:active { transform: scale(.92); }
    input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
    input[type="number"] { -moz-appearance:textfield; }
    .chart-container { position: relative; height: 120px; }
    .scrollbar-hide::-webkit-scrollbar { display:none; }
    .scrollbar-hide { -ms-overflow-style:none; scrollbar-width:none; }
    @keyframes gradient-shift { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
    .animated-gradient { background-size: 200% 200%; animation: gradient-shift 15s ease infinite; }
    .pill { transition: all .2s ease; }
    .pill.active { background: linear-gradient(135deg, rgba(99,102,241,.5), rgba(168,85,247,.5)); border-color: rgba(139,92,246,.55); }
  
    /* Unit dropdown (better contrast) */
    .unit-menu{
      background: rgba(10, 5, 30, 0.98);
      border: 1px solid rgba(255,255,255,0.12);
      backdrop-filter: blur(16px);
      box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    }
    .unit-menu::-webkit-scrollbar{ width: 8px; }
    .unit-menu::-webkit-scrollbar-thumb{ background: rgba(255,255,255,0.15); border-radius: 10px; }

    
    /* Forecast strip scroll (desktop-friendly) */
    .forecast-strip{
      scrollbar-width: thin;
      scrollbar-color: rgba(255,255,255,0.22) rgba(255,255,255,0.06);
      -webkit-overflow-scrolling: touch;
      scroll-behavior: smooth;
      cursor: grab;
    }
    .forecast-strip:active{ cursor: grabbing; }
    .forecast-strip::-webkit-scrollbar{ height: 8px; }
    .forecast-strip::-webkit-scrollbar-track{ background: rgba(255,255,255,0.06); border-radius: 999px; }
    .forecast-strip::-webkit-scrollbar-thumb{ background: rgba(255,255,255,0.22); border-radius: 999px; }

    /* Telegram icon animation */
    @keyframes tgPulse { 0%,100%{ transform:translateY(0) scale(1); filter:drop-shadow(0 0 0 rgba(56,189,248,0)); } 50%{ transform:translateY(-2px) scale(1.05); filter:drop-shadow(0 8px 16px rgba(56,189,248,0.25)); } }
    .tg-anim{ animation: tgPulse 1.6s ease-in-out infinite; }

  
    /* --- Fix: dropdown menus should overlay other cards --- */
    #converter-section, #converter-section .glass { overflow: visible !important; }
    .unit-dropdown { position: relative; z-index: 2000; }
    .unit-dropdown .unit-menu, #conv-type-menu, #from-unit-menu, #to-unit-menu {
      z-index: 9999 !important;
    }
    /* make the dropdown list readable on all backgrounds */
    .unit-menu, #conv-type-menu{
      background: rgba(10, 5, 30, 0.98) !important;
      color: rgba(255,255,255,0.95) !important;
    }

    /* --- Responsive: keep mobile perfect, improve desktop width --- */
    @media (min-width: 1024px){
      #app { max-width: 1100px; margin-left: auto; margin-right: auto; }
      main { padding-left: 24px !important; padding-right: 24px !important; }
    }


    /* Responsive tweaks */
    .table-actions{display:flex; flex-wrap:wrap; gap:8px; align-items:center}
    .btn-mini{background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.14); padding:8px 10px; border-radius:12px; font-size:12px}
    .btn-mini:hover{background:rgba(255,255,255,0.12)}
    .chart-wrap{min-height:220px}
    @media (max-width: 640px){
      .chart-wrap{min-height:200px}
      .glass{border-radius:18px}
    }

    /* Print/PDF export */
    @media print{
      body{background:#fff !important; color:#111 !important}
      nav, #top-nav, .nav-btn, .no-print{display:none !important}
      .glass, .glass-dark{background:transparent !important; border:0 !important; box-shadow:none !important}
      canvas{max-width:100% !important}
      table{width:100% !important}
      .print-card{padding:0 !important}
    }

    /* Weather: nicer clouds + depth */
    .cloud{filter: drop-shadow(0 6px 10px rgba(0,0,0,0.18)); opacity:0.95}
    .cloud svg{filter: blur(0.2px)}
    @keyframes cloudFloat { 0%{transform:translateX(120%)} 100%{transform:translateX(-140%)} }
    .cloud{animation: cloudFloat linear infinite; }
    .cloud.slow{animation-duration: 38s}
    .cloud.mid{animation-duration: 28s}
    .cloud.fast{animation-duration: 18s}
    .cloudLayer{position:absolute; inset:0; pointer-events:none}
    .mist{position:absolute; inset:-20px; background:radial-gradient(circle at 20% 30%, rgba(255,255,255,0.14), transparent 55%), radial-gradient(circle at 70% 60%, rgba(255,255,255,0.10), transparent 60%); filter: blur(6px); opacity:0.7}

/* DateTime: progress bars */
.progress-track{background:rgba(255,255,255,0.10); border:1px solid rgba(255,255,255,0.10); border-radius:999px; overflow:hidden}
.progress-bar{height:10px; border-radius:999px; background:linear-gradient(90deg, rgba(99,102,241,0.9), rgba(168,85,247,0.9)); width:0%}
.mono{font-variant-numeric: tabular-nums}

/* Weather: richer animations */
@keyframes lightningFlash { 0%,92%,100%{opacity:0} 93%{opacity:0.65} 94%{opacity:0.15} 95%{opacity:0.85} 96%{opacity:0.2} 97%{opacity:0.7} }
.lightning-flash{position:absolute; inset:0; background:rgba(255,255,255,0.55); animation: lightningFlash 5.5s infinite; pointer-events:none; mix-blend-mode: overlay;}
@keyframes windDrift { 0%{transform:translateX(120%)} 100%{transform:translateX(-140%)} }
.wind-line{position:absolute; height:2px; width:80px; background:rgba(255,255,255,0.18); border-radius:999px; filter: blur(0.2px); animation: windDrift linear infinite}
@keyframes rainSlash { 0%{transform:translateY(-120%) translateX(0);opacity:0} 10%{opacity:1} 90%{opacity:1} 100%{transform:translateY(420px) translateX(80px);opacity:0} }
.rain-slash{animation: rainSlash 0.95s linear infinite;}

  

    
    /* ===== Site Logo Animation ===== */
    @keyframes logoFloat { 0%,100%{transform:translateY(0) rotate(0deg)} 50%{transform:translateY(-3px) rotate(2deg)} }
    @keyframes logoGlow { 0%,100%{filter:drop-shadow(0 10px 18px rgba(168,85,247,0.22))} 50%{filter:drop-shadow(0 16px 28px rgba(99,102,241,0.35))} }
    @keyframes boltFlash { 0%,88%,100%{opacity:0.55} 90%{opacity:1} 92%{opacity:0.35} 94%{opacity:1} }
    .site-logo{
      animation: logoFloat 2.8s ease-in-out infinite, logoGlow 3.6s ease-in-out infinite;
      position:relative;
      overflow:hidden;
    }
    .site-logo::after{
      content:"";
      position:absolute; inset:-40%;
      background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.22) 30%, transparent 60%);
      transform: translateX(-80%) rotate(18deg);
      animation: gradient-shift 4.8s ease-in-out infinite;
      pointer-events:none;
      opacity:0.35;
    }
    .site-logo .bolt{ animation: boltFlash 4.2s infinite; transform-origin:center; }

    /* Crypto charts: clearer + taller */
    .chart-container { position: relative; height: 150px; }
    .crypto-card{ position:relative; overflow:hidden; }
    .crypto-card::before{
      content:"";
      position:absolute; inset:-30%;
      background: radial-gradient(circle at 15% 25%, rgba(99,102,241,0.18), transparent 55%),
                  radial-gradient(circle at 85% 65%, rgba(168,85,247,0.14), transparent 60%);
      pointer-events:none;
    }
    .crypto-card > *{ position:relative; z-index:1; }


/* ===== Psychology Module (scoped) ===== */

        #psychology-section .psy-surface{
          --bg0:#0b1220;
          --bg1:#0f172a;
          --card:rgba(255,255,255,.06);
          --card2:rgba(255,255,255,.09);
          --stroke:rgba(255,255,255,.12);
          --text:#e5e7eb;
          --muted:#9ca3af;
          --accent:#8b5cf6;
          --accent2:#22c55e;
          --danger:#ef4444;
          --warn:#f59e0b;
          --shadow: 0 16px 50px rgba(0,0,0,.35);
          --radius:18px;
        }

        #psychology-section .psy-surface *{box-sizing:border-box}
        #psychology-section .psy-surface{
          margin:0;
          min-height:100vh;
          font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Tahoma, Arial;
          color:var(--text);
          background:
            radial-gradient(1000px 600px at 80% 0%, rgba(139,92,246,.18), transparent 60%),
            radial-gradient(900px 500px at 10% 20%, rgba(34,197,94,.12), transparent 55%),
            linear-gradient(180deg, var(--bg0), var(--bg1));
          padding:18px;
        }

        #psychology-section .psy-surface .wrap{max-width:980px;margin:0 auto}
        #psychology-section .psy-surface .topbar{
          display:flex; align-items:center; justify-content:space-between; gap:12px;
          padding:14px 14px;
          border:1px solid var(--stroke);
          border-radius:var(--radius);
          background:linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04));
          box-shadow:var(--shadow);
          backdrop-filter: blur(10px);
        }
        #psychology-section .psy-surface .brand{display:flex; align-items:center; gap:10px}
        #psychology-section .psy-surface .logo{
          width:40px;height:40px;border-radius:14px;
          background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.30), rgba(255,255,255,.08) 50%, rgba(0,0,0,.05));
          border:1px solid var(--stroke);
          display:grid;place-items:center;
          box-shadow: 0 10px 30px rgba(0,0,0,.25);
        }
        #psychology-section .psy-surface .brand h1{font-size:16px; margin:0; line-height:1.2}
        #psychology-section .psy-surface .brand p{margin:0; font-size:12px; color:var(--muted)}
        #psychology-section .psy-surface .pill{
          display:flex; gap:8px; align-items:center;
          padding:8px 10px;
          border:1px solid var(--stroke);
          border-radius:999px;
          background:rgba(255,255,255,.05);
          font-size:12px; color:var(--muted);
          white-space:nowrap;
        }
        #psychology-section .psy-surface .dot{width:8px;height:8px;border-radius:999px;background:var(--accent);box-shadow:0 0 0 4px rgba(139,92,246,.18)}
        #psychology-section .psy-surface .content{margin-top:14px}

        #psychology-section .psy-surface .grid{
          display:grid;
          grid-template-columns: repeat(12, 1fr);
          gap:12px;
          margin-top:14px;
        }

        #psychology-section .psy-surface .card{
          grid-column: span 4;
          background:var(--card);
          border:1px solid var(--stroke);
          border-radius:var(--radius);
          padding:14px;
          box-shadow:var(--shadow);
          backdrop-filter: blur(10px);
          transition: transform .15s ease, background .15s ease, border-color .15s ease;
          cursor:pointer;
          position:relative;
          overflow:hidden;
        }
        #psychology-section .psy-surface .card:hover{transform: translateY(-2px); background:var(--card2); border-color:rgba(255,255,255,.18)}
        #psychology-section .psy-surface .card:active{transform: translateY(0px) scale(.995)}
        #psychology-section .psy-surface .card .title{display:flex; align-items:center; justify-content:space-between; gap:12px}
        #psychology-section .psy-surface .card h3{margin:0; font-size:14px}
        #psychology-section .psy-surface .card p{margin:8px 0 0; font-size:12px; color:var(--muted); line-height:1.7}
        #psychology-section .psy-surface .tag{
          font-size:11px;
          padding:6px 9px;
          border-radius:999px;
          border:1px solid var(--stroke);
          background:rgba(255,255,255,.06);
          color:#c7c9d1;
        }
        #psychology-section .psy-surface .shine{
          position:absolute; inset:-40% -30%;
          background: radial-gradient(circle at 20% 20%, rgba(139,92,246,.20), transparent 55%);
          transform: rotate(12deg);
          pointer-events:none;
        }

        @media (max-width: 900px){ #psychology-section .psy-surface .card{grid-column: span 6;} }
        @media (max-width: 560px){ #psychology-section .psy-surface .card{grid-column: span 12;} #psychology-section .psy-surface .topbar{flex-direction:column; align-items:stretch} #psychology-section .psy-surface .pill{justify-content:center} }

        #psychology-section .psy-surface .panel{
          border:1px solid var(--stroke);
          border-radius:var(--radius);
          background:var(--card);
          box-shadow:var(--shadow);
          backdrop-filter: blur(10px);
          padding:14px;
        }
        #psychology-section .psy-surface .panel h2{margin:0 0 8px; font-size:14px}
        #psychology-section .psy-surface .crumbs{
          display:flex; gap:8px; flex-wrap:wrap; align-items:center;
          color:var(--muted); font-size:12px;
          margin:10px 2px 0;
        }
        #psychology-section .psy-surface .crumbs button{
          border:none; background:transparent; color:var(--text); cursor:pointer;
          padding:0; font:inherit; text-decoration:underline; text-decoration-color: rgba(255,255,255,.25);
        }

        #psychology-section .psy-surface .list{display:grid; gap:10px; margin-top:10px}
        #psychology-section .psy-surface .item{
          display:flex; align-items:flex-start; justify-content:space-between; gap:10px;
          padding:12px;
          border:1px solid var(--stroke);
          border-radius:14px;
          background:rgba(255,255,255,.05);
          cursor:pointer;
          transition: background .15s ease, border-color .15s ease, transform .15s ease;
        }
        #psychology-section .psy-surface .item:hover{background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.18); transform: translateY(-1px)}
        #psychology-section .psy-surface .item h4{margin:0; font-size:13px}
        #psychology-section .psy-surface .item small{color:var(--muted); font-size:12px; line-height:1.6}
        #psychology-section .psy-surface .item .meta{display:flex; flex-direction:column; align-items:flex-end; gap:6px}
        #psychology-section .psy-surface .badge{
          font-size:11px; padding:6px 9px; border-radius:999px;
          border:1px solid var(--stroke);
          background:rgba(139,92,246,.12);
          color:#ddd6fe;
          white-space:nowrap;
        }
        #psychology-section .psy-surface .badge.timer{background:rgba(245,158,11,.12); color:#fde68a}
        #psychology-section .psy-surface .badge.free{background:rgba(34,197,94,.12); color:#bbf7d0}

        #psychology-section .psy-surface .btnrow{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px}
        #psychology-section .psy-surface .btn{
          border:none; cursor:pointer;
          padding:10px 12px;
          border-radius:12px;
          color:var(--text);
          background:rgba(255,255,255,.06);
          border:1px solid var(--stroke);
          transition: background .15s ease, transform .15s ease, border-color .15s ease;
          font-size:12px;
        }
        #psychology-section .psy-surface .btn:hover{background:rgba(255,255,255,.10); border-color:rgba(255,255,255,.18)}
        #psychology-section .psy-surface .btn:active{transform: scale(.99)}
        #psychology-section .psy-surface .btn.primary{background: rgba(139,92,246,.18); border-color: rgba(139,92,246,.35)}
        #psychology-section .psy-surface .btn.primary:hover{background: rgba(139,92,246,.24)}
        #psychology-section .psy-surface .btn.danger{background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.30)}
        #psychology-section .psy-surface .btn.danger:hover{background: rgba(239,68,68,.20)}

        #psychology-section .psy-surface .formgrid{display:grid; grid-template-columns:repeat(12,1fr); gap:10px; margin-top:10px}
        #psychology-section .psy-surface .field{grid-column: span 4}
        #psychology-section .psy-surface .field label{display:block; font-size:12px; color:var(--muted); margin-bottom:6px}
        #psychology-section .psy-surface input, #psychology-section .psy-surface select{
          width:100%; padding:10px 10px;
          border-radius:12px;
          border:1px solid var(--stroke);
          background: rgba(0,0,0,.18);
          color: var(--text);
          outline:none;
        }
        #psychology-section .psy-surface input:focus, #psychology-section .psy-surface select:focus{border-color: rgba(139,92,246,.50); box-shadow: 0 0 0 4px rgba(139,92,246,.15)}
        @media (max-width: 820px){ #psychology-section .psy-surface .field{grid-column: span 6} }
        @media (max-width: 520px){ #psychology-section .psy-surface .field{grid-column: span 12} }

        #psychology-section .psy-surface .quizhead{
          display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap;
          margin-top:10px;
        }
        #psychology-section .psy-surface .quizhead h3{margin:0; font-size:14px}
        #psychology-section .psy-surface .quizhead p{margin:6px 0 0; color:var(--muted); font-size:12px; line-height:1.7; max-width:60ch}
        #psychology-section .psy-surface .timerBox{
          display:flex; flex-direction:column; align-items:flex-end; gap:6px;
          padding:10px 12px;
          border-radius:14px;
          border:1px solid var(--stroke);
          background: rgba(0,0,0,.18);
          min-width: 170px;
        }
        #psychology-section .psy-surface .timerBox .tlabel{color:var(--muted); font-size:11px}
        #psychology-section .psy-surface .timerBox .tval{font-size:16px; font-weight:700; letter-spacing:.5px}
        #psychology-section .psy-surface .timerBox.warn{border-color: rgba(245,158,11,.35)}
        #psychology-section .psy-surface .timerBox.danger{border-color: rgba(239,68,68,.35)}
        #psychology-section .psy-surface .progress{
          height:10px; border-radius:999px; overflow:hidden;
          background: rgba(255,255,255,.07);
          border:1px solid rgba(255,255,255,.08);
          margin:12px 0;
        }
        #psychology-section .psy-surface .progress > div{height:100%; width:0%; background: linear-gradient(90deg, rgba(139,92,246,.95), rgba(34,197,94,.75)); transition: width .25s ease}

        #psychology-section .psy-surface .qbox{
          margin-top:6px;
          padding:12px;
          border:1px solid var(--stroke);
          border-radius:16px;
          background: rgba(255,255,255,.05);
        }
        #psychology-section .psy-surface .qnum{font-size:11px;color:var(--muted); margin:0 0 8px}
        #psychology-section .psy-surface .qtext{margin:0 0 10px; font-size:13px; line-height:1.9}
        #psychology-section .psy-surface .options{display:grid; gap:8px}
        #psychology-section .psy-surface .opt{
          display:flex; align-items:center; justify-content:space-between; gap:10px;
          padding:10px 12px;
          border-radius:14px;
          border:1px solid var(--stroke);
          background: rgba(0,0,0,.14);
          cursor:pointer;
          transition: background .15s ease, border-color .15s ease, transform .15s ease;
          user-select:none;
        }
        #psychology-section .psy-surface .opt:hover{background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18)}
        #psychology-section .psy-surface .opt.selected{
          background: rgba(139,92,246,.18);
          border-color: rgba(139,92,246,.45);
          box-shadow: 0 0 0 4px rgba(139,92,246,.14);
        }
        #psychology-section .psy-surface .opt .mark{
          width:18px;height:18px;border-radius:6px;
          border:1px solid rgba(255,255,255,.18);
          background: rgba(255,255,255,.06);
          display:grid;place-items:center;
          flex: 0 0 auto;
        }
        #psychology-section .psy-surface .opt.selected .mark{background: rgba(139,92,246,.50); border-color: rgba(139,92,246,.75)}
        #psychology-section .psy-surface .opt.selected .mark:before{content:"✓"; font-weight:900; font-size:12px}
        #psychology-section .psy-surface .opt .label{font-size:12px; color:var(--text)}
        #psychology-section .psy-surface .opt .val{font-size:11px; color:var(--muted)}

        #psychology-section .psy-surface .hint{
          margin-top:10px;
          color:var(--muted);
          font-size:12px;
          line-height:1.7;
        }

        #psychology-section .psy-surface .result{
          margin-top:14px;
          padding:14px;
          border:1px solid var(--stroke);
          border-radius:var(--radius);
          background: rgba(255,255,255,.05);
        }
        #psychology-section .psy-surface .result h3{margin:0 0 8px; font-size:14px}
        #psychology-section .psy-surface .result .summary{
          margin:0;
          color:var(--text);
          font-size:12px;
          line-height:1.9;
          white-space:pre-line;
        }
        #psychology-section .psy-surface .two{
          display:grid;
          grid-template-columns: 1.2fr .8fr;
          gap:12px;
          margin-top:12px;
        }
        @media (max-width: 860px){ #psychology-section .psy-surface .two{grid-template-columns:1fr} }
        #psychology-section .psy-surface .mini{
          padding:12px;
          border:1px solid var(--stroke);
          border-radius:16px;
          background: rgba(0,0,0,.14);
        }
        #psychology-section .psy-surface .mini h4{margin:0 0 6px; font-size:13px}
        #psychology-section .psy-surface .mini p{margin:0; color:var(--muted); font-size:12px; line-height:1.8}
        #psychology-section .psy-surface .saveok{
          margin-top:10px; color:#bbf7d0; font-size:12px; display:none;
        }
        #psychology-section .psy-surface .warnline{color:#fde68a}
        #psychology-section .psy-surface .dangerline{color:#fecaca}
        #psychology-section .psy-surface .footnote{
          margin-top:12px;
          color:var(--muted);
          font-size:11px;
          line-height:1.7;
        }
  
    /* ===== End Psychology Module ===== */

    /* ===== [INTEGRATION] IP Scanner Section (index3) ===== */
    /* Scoped under #ipscanner-section to prevent conflict with existing styles */
    #ipscanner-section .font-mono-custom {
        font-family: 'JetBrains Mono', monospace;
    }
    @keyframes ips-subtlePulse {
        0%, 100% { transform: scale(1); opacity: 0.95; }
        50% { transform: scale(1.02); opacity: 1; filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.4)); }
    }
    #ipscanner-section .active-pulse-btn {
        animation: ips-subtlePulse 2.5s infinite ease-in-out;
    }
    #ipscanner-section .smooth-transition {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    #ipscanner-section .card-glow-hover:hover {
        transform: translateY(-2px);
        border-color: rgba(245, 158, 11, 0.3);
        box-shadow: 0 8px 20px -5px rgba(245, 158, 11, 0.05);
    }
    #ipscanner-section .telegram-footer-card:hover {
        border-color: rgba(14, 165, 233, 0.4);
        box-shadow: 0 0 15px rgba(14, 165, 233, 0.15);
        background-color: rgba(14, 165, 233, 0.03);
    }
    /* IP Scanner inner dark wrapper matching index3 background */
    #ipscanner-section .ips-inner {
        background-color: #05070f;
        color: #f1f5f9;
        border-radius: 20px;
        overflow: hidden;
        min-height: 80vh;
        display: flex;
        flex-direction: column;
    }
    /* Inline-SVG provider logo badge used in the ping monitor */
    #ipscanner-section .ips-logo-badge{
      width:20px; height:20px; border-radius:9999px;
      display:flex; align-items:center; justify-content:center;
      flex-shrink:0; line-height:0;
    }
    #ipscanner-section .ips-logo-badge svg{ display:block; }
    /* Safety net: if Font Awesome CDN fails to load, hide broken empty <i> tags
       so they never appear as empty rectangles / broken-image boxes.
       Detection is performed by JS at runtime; this class is then added to <html>.
       Restricted to <i> elements to avoid affecting other classes that happen
       to start with "fa-". */
    html.fa-missing i.fa,
    html.fa-missing i.fas,
    html.fa-missing i.far,
    html.fa-missing i.fab,
    html.fa-missing i[class*="fa-solid"],
    html.fa-missing i[class*="fa-regular"],
    html.fa-missing i[class*="fa-brands"]{
      width:0 !important; height:0 !important;
      display:inline-block !important;
      overflow:hidden !important;
      visibility:hidden !important;
    }
    /* The provider "logos" in the ping-monitor have been replaced with inline
       SVG above, so this safety-net only affects decorative icons. */
    /* Global broken-image safety: any <img> that fails to load gets a neutral
       gradient placeholder instead of the browser's broken-image icon. */
    img.codeisa-img-broken{
      background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(168,85,247,.18));
      border: 1px solid rgba(148,163,184,.20);
      border-radius: 8px;
      object-fit: contain;
      min-width: 24px; min-height: 24px;
    }
    /* ===== [/INTEGRATION] IP Scanner Section ===== */

/* ===== @view-transition (preserved) ===== */
@view-transition { navigation: auto; }

/* ===== PREMIUM UPGRADE v3 STYLES (preserved) ===== */
/* ==================== PREMIUM UPGRADE v3 — 2026 ==================== */
/* Inspired by Apple, Stripe, Vercel, Linear, Arc, Raycast.            */
/* This layer ADDS depth, typography, motion. It does NOT remove any   */
/* existing class/ID. Existing scripts continue working unchanged.    */

:root{
  /* Tier 2 design tokens (extends modern-design-v2) */
  --pp-bg-deep: #050414;
  --pp-bg-mid:  #0a0a24;
  --pp-bg-soft: #131336;
  --pp-acc-1:   #6366f1;
  --pp-acc-2:   #a855f7;
  --pp-acc-3:   #ec4899;
  --pp-acc-4:   #22d3ee;
  --pp-acc-glow: rgba(168, 85, 247, .35);
  --pp-text:    #f4f4ff;
  --pp-text-d:  #c3c4dd;
  --pp-text-dd: #8a8ca6;
  --pp-stroke:  rgba(255,255,255,0.09);
  --pp-stroke-2:rgba(255,255,255,0.18);
  --pp-glass:   rgba(255,255,255,0.045);
  --pp-glass-h: rgba(255,255,255,0.075);
  --pp-shadow-1: 0 4px 12px rgba(0,0,0,.18);
  --pp-shadow-2: 0 14px 38px rgba(0,0,0,.32), 0 2px 6px rgba(0,0,0,.18);
  --pp-shadow-3: 0 22px 60px rgba(0,0,0,.42), 0 4px 12px rgba(0,0,0,.22);
  --pp-glow-purple: 0 0 32px rgba(168,85,247,.35), 0 0 64px rgba(168,85,247,.18);
  --pp-glow-indigo: 0 0 32px rgba(99,102,241,.35), 0 0 64px rgba(99,102,241,.18);
  --pp-ease: cubic-bezier(.22,.61,.36,1);
  --pp-ease-bouncy: cubic-bezier(.34, 1.56, .64, 1);
  --pp-radius-card: 22px;
  --pp-radius-pill: 999px;
  --font-fa: 'Vazirmatn', 'Estedad', 'IRANSansX', sans-serif;
  --font-en: 'Inter', 'Manrope', 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', ui-monospace, monospace;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  body::after, .deco-blob{ animation: none !important; }
}

/* ---------- Typography ---------- */
html[lang="fa"] body, html[lang="fa"] *{ font-family: var(--font-fa); }
html[lang="en"] body, html[lang="en"] *{ font-family: var(--font-en); letter-spacing: -0.005em; }
html[lang="en"] *{ font-feature-settings: 'cv11', 'ss01', 'ss03'; }
.font-mono-custom, .mono, [class*="tabular"]{ font-family: var(--font-mono) !important; font-variant-numeric: tabular-nums; }

/* Render the page slightly crisper */
body{
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Header refinement ---------- */
header.glass-dark{
  background: linear-gradient(180deg, rgba(7,4,28,.78), rgba(7,4,28,.55)) !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 14px 32px rgba(0,0,0,.45);
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
}
header h1#site-title{
  font-size: 23px !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em;
}
.site-logo{
  width: 44px !important; height: 44px !important;
  border-radius: 14px !important;
  background:
    radial-gradient(120% 120% at 20% 10%, #c4b5fd 0%, #818cf8 40%, #6366f1 70%, #4338ca 100%) !important;
  box-shadow:
    0 10px 30px rgba(99,102,241,.45),
    0 0 0 1px rgba(255,255,255,.16) inset,
    0 2px 0 rgba(255,255,255,.20) inset !important;
}

/* ---------- Language switcher button ---------- */
.lang-switcher{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.14);
  color: #e9eaff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .22s var(--pp-ease);
  user-select: none;
  letter-spacing: .02em;
}
.lang-switcher:hover{
  border-color: rgba(168,85,247,.5);
  background: linear-gradient(180deg, rgba(168,85,247,.18), rgba(99,102,241,.10));
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(99,102,241,.25);
}
.lang-switcher:active{ transform: translateY(0) scale(.97); }
.lang-switcher .lang-icon{
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.lang-switcher .lang-text{
  font-family: var(--font-mono) !important;
  font-size: 11px;
  letter-spacing: .04em;
}
@media (max-width: 480px){
  .lang-switcher{ padding: 6px 10px; font-size: 11px; }
  .lang-switcher .lang-text{ font-size: 10.5px; }
}

/* Header right cluster */
.header-cluster{
  display: flex; align-items: center; gap: 10px;
}

/* ---------- Online status refinement ---------- */
#online-status{
  padding: 7px 13px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  background: linear-gradient(180deg, rgba(16,185,129,.14), rgba(16,185,129,.06)) !important;
  border: 1px solid rgba(16,185,129,.32) !important;
  box-shadow: 0 6px 18px rgba(16,185,129,.18);
}

/* ---------- Navigation pills (premium) ---------- */
nav{
  padding: 16px 20px 10px !important;
  background: linear-gradient(180deg, rgba(7,4,28,.40), rgba(7,4,28,.20)) !important;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
nav .nav-btn{
  position: relative;
  padding: 10px 18px !important;
  border-radius: 12px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)) !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  color: rgba(244,244,255,.75) !important;
  transition: transform .25s var(--pp-ease), border-color .2s ease, background .25s ease, box-shadow .3s ease, color .2s ease !important;
}
nav .nav-btn:hover{
  transform: translateY(-2px);
  color: #fff !important;
  border-color: rgba(168,85,247,.45) !important;
  background: linear-gradient(180deg, rgba(168,85,247,.12), rgba(99,102,241,.06)) !important;
  box-shadow: 0 10px 24px rgba(99,102,241,.22);
}
nav .nav-btn.active{
  color: #fff !important;
  border-color: rgba(255,255,255,.32) !important;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 55%, #ec4899 100%) !important;
  box-shadow: 0 14px 30px rgba(139,92,246,.45), inset 0 1px 0 rgba(255,255,255,.30) !important;
  transform: translateY(-1px);
}
nav .nav-btn.active::after{
  display: none;
}

/* ---------- Section reveal animation ---------- */
main section:not(.hidden){
  animation: ppSectionIn .5s var(--pp-ease) both;
}
@keyframes ppSectionIn{
  from{ opacity: 0; transform: translateY(12px) scale(.995); filter: blur(2px); }
  to  { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ---------- Premium glass cards ---------- */
main .glass{
  border-radius: var(--pp-radius-card) !important;
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.025)) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow:
    var(--pp-shadow-1),
    inset 0 1px 0 rgba(255,255,255,.08) !important;
  transition: transform .35s var(--pp-ease), box-shadow .35s ease, border-color .25s ease !important;
}
main .glass:hover{
  border-color: rgba(255,255,255,.18) !important;
  box-shadow: var(--pp-shadow-2), inset 0 1px 0 rgba(255,255,255,.10) !important;
}
main .glass-dark{
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(5,4,18,.72), rgba(5,4,18,.55)) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
}

/* Section headings */
main h2{
  font-size: 24px !important;
  font-weight: 800 !important;
  letter-spacing: -0.022em;
  background: linear-gradient(120deg, #ffffff 0%, #d8dcff 60%, #e9d5ff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

/* ---------- Inputs (refined) ---------- */
.input, input[type="text"], input[type="number"], input[type="search"], input[type="email"], select, textarea{
  background: rgba(5,4,18,.55) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 14px !important;
  transition: border-color .2s ease, background .2s ease, box-shadow .25s ease !important;
}
.input:focus, input:focus, select:focus, textarea:focus{
  border-color: rgba(168,85,247,.7) !important;
  background: rgba(7,4,28,.78) !important;
  box-shadow: 0 0 0 3px rgba(168,85,247,.20), 0 0 18px rgba(168,85,247,.20) !important;
}
input.input{ direction: ltr; text-align: end; }
html[lang="en"] input.input{ text-align: start; }

/* Number spinner hidden */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button{ -webkit-appearance:none; margin: 0; }
input[type=number]{ -moz-appearance: textfield; }

/* Range slider polish */
input[type="range"]{
  -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(168,85,247,.55), rgba(99,102,241,.35));
  outline: none;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff, #c7d2fe);
  border: 2px solid rgba(168,85,247,.8);
  box-shadow: 0 4px 12px rgba(168,85,247,.45);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb{
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid rgba(168,85,247,.8);
  box-shadow: 0 4px 12px rgba(168,85,247,.45); cursor: pointer;
}

/* ---------- Buttons: gradient primary (override gradients) ---------- */
.bg-gradient-to-r.from-indigo-600.to-purple-600{
  background-image: linear-gradient(135deg, #6366f1 0%, #a855f7 55%, #ec4899 100%) !important;
  border-radius: 14px !important;
  font-weight: 700 !important;
  box-shadow: 0 10px 28px rgba(139,92,246,.42), inset 0 1px 0 rgba(255,255,255,.20) !important;
  transition: transform .2s var(--pp-ease), filter .25s ease, box-shadow .3s ease !important;
}
.bg-gradient-to-r.from-indigo-600.to-purple-600:hover{
  filter: brightness(1.10) saturate(1.10);
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(168,85,247,.55), inset 0 1px 0 rgba(255,255,255,.22) !important;
}
.bg-gradient-to-r.from-indigo-600.to-purple-600:active{
  transform: translateY(0) scale(.98);
}

/* ---------- Calculator buttons ---------- */
.calc-btn{
  border-radius: 16px !important;
  font-weight: 800 !important;
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.03)) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 4px 12px rgba(0,0,0,.20) !important;
  transition: transform .12s var(--pp-ease), filter .2s ease, box-shadow .2s ease !important;
}
.calc-btn:hover{ filter: brightness(1.15); transform: translateY(-1px); }
.calc-btn:active{ transform: scale(.92) !important; }

/* ---------- Crypto cards refined ---------- */
.crypto-card{
  border-radius: var(--pp-radius-card) !important;
  position: relative;
  overflow: hidden;
}
.crypto-card::before{
  background:
    radial-gradient(60% 60% at 10% 0%, rgba(99,102,241,.20), transparent 60%),
    radial-gradient(60% 60% at 90% 100%, rgba(236,72,153,.14), transparent 60%) !important;
}
.crypto-card:hover{
  transform: translateY(-3px) scale(1.005);
  box-shadow: var(--pp-shadow-3), inset 0 1px 0 rgba(255,255,255,.12) !important;
}

/* ---------- IP Scanner refinement ---------- */
#ipscanner-section .ips-inner{
  background: linear-gradient(180deg, #05050f 0%, #0a0a1f 100%) !important;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: var(--pp-shadow-3);
}
#ipscanner-section button[id^="ips_"]{
  transition: transform .15s var(--pp-ease), box-shadow .25s ease, filter .2s ease;
}
#ipscanner-section button[id^="ips_"]:hover{ filter: brightness(1.10); }
#ipscanner-section button[id^="ips_"]:active{ transform: scale(.97); }

#ipscanner-section #ips_startBtn{
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #ea580c 100%) !important;
  box-shadow: 0 12px 30px rgba(245,158,11,.42), inset 0 1px 0 rgba(255,255,255,.30) !important;
}

#ipscanner-section .card-glow-hover{
  transition: transform .3s var(--pp-ease), border-color .25s ease, box-shadow .35s ease !important;
}
#ipscanner-section .card-glow-hover:hover{
  transform: translateY(-3px);
  border-color: rgba(245,158,11,.40) !important;
  box-shadow: 0 16px 38px rgba(245,158,11,.16), 0 6px 14px rgba(0,0,0,.32);
}

/* IP row pulsing */
#ips_ipsTableList > div{
  border-radius: 14px;
  transition: background .2s ease, transform .15s ease, border-color .2s ease;
}
#ips_ipsTableList > div:hover{ transform: translateX(-3px); }
html[lang="en"] #ips_ipsTableList > div:hover{ transform: translateX(3px); }

/* ---------- Calendar polish ---------- */
#calendar-days > div{
  border-radius: 10px !important;
  transition: background .2s ease, color .2s ease, transform .15s ease;
}
#calendar-days > div:hover{
  background: rgba(168,85,247,.20) !important;
  transform: scale(1.05);
}

/* ---------- Forecast strip refinement ---------- */
.forecast-strip{
  scroll-snap-type: x mandatory;
}
.forecast-strip > *{ scroll-snap-align: start; }

/* ---------- Banking tabs ---------- */
.banking-tab{
  border-radius: 14px !important;
  font-weight: 700 !important;
  transition: all .25s var(--pp-ease) !important;
}
.banking-tab.active{
  background: linear-gradient(135deg, #6366f1, #a855f7 65%, #ec4899) !important;
  border-color: rgba(255,255,255,.30) !important;
  box-shadow: 0 10px 24px rgba(139,92,246,.40), inset 0 1px 0 rgba(255,255,255,.22) !important;
}

/* ---------- Pills (mode toggles) ---------- */
.pill{ border-radius: 14px !important; font-weight: 700 !important; }
.pill.active{
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 60%, #ec4899 100%) !important;
  border-color: rgba(255,255,255,.30) !important;
  box-shadow: 0 8px 20px rgba(139,92,246,.4), inset 0 1px 0 rgba(255,255,255,.22) !important;
  color: #fff !important;
}

/* ---------- Mini buttons ---------- */
.btn-mini{
  background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.035)) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 12px !important;
  padding: 8px 12px !important;
  font-weight: 600 !important;
  transition: all .2s var(--pp-ease);
}
.btn-mini:hover{
  background: linear-gradient(180deg, rgba(168,85,247,.18), rgba(99,102,241,.10)) !important;
  border-color: rgba(168,85,247,.40) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(168,85,247,.20);
}

/* ---------- Dropdown menus polish ---------- */
.unit-menu, #conv-type-menu, #from-unit-menu, #to-unit-menu{
  background: linear-gradient(180deg, rgba(10,8,32,.98), rgba(7,4,28,.98)) !important;
  border: 1px solid rgba(168,85,247,.30) !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.04) inset !important;
  padding: 6px !important;
}
.unit-menu > *, #conv-type-menu > *{
  border-radius: 10px;
}

/* ---------- Selection ---------- */
::selection{ background: rgba(168,85,247,.55); color: #fff; }

/* ---------- Focus visible ---------- */
button:focus-visible, a:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible{
  outline: 2px solid rgba(168,85,247,.75);
  outline-offset: 2px;
  border-radius: 10px;
}

/* ---------- Scrollbar premium ---------- */
*::-webkit-scrollbar{ width: 10px; height: 10px; }
*::-webkit-scrollbar-track{ background: rgba(255,255,255,.03); border-radius: 999px; }
*::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(168,85,247,.55), rgba(99,102,241,.45));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg, rgba(168,85,247,.85), rgba(99,102,241,.75));
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* ---------- Body background — deeper, richer ---------- */
body{
  background:
    radial-gradient(1300px 800px at 12% -8%, rgba(99,102,241,.30), transparent 60%),
    radial-gradient(1000px 700px at 92% 0%, rgba(168,85,247,.25), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(236,72,153,.20), transparent 60%),
    linear-gradient(180deg, #050414 0%, #0a0a26 50%, #07061a 100%) !important;
  background-attachment: fixed !important;
}

/* aurora layer */
body::after{
  opacity: .58 !important;
  filter: blur(90px) !important;
}

/* ---------- LTR specific fixes ---------- */
html[lang="en"][dir="ltr"] .scrollbar-hide{ direction: ltr; }
html[lang="en"] .text-right{ text-align: right; }
html[lang="en"] nav{ direction: ltr; }
html[lang="en"] nav .nav-btn{ font-family: var(--font-en) !important; }

/* IP Scanner stays LTR for technical content */
#ipscanner-section, #ipscanner-section *{
  /* keep LTR for IPs */
}
#ipscanner-section h1, #ipscanner-section h2, #ipscanner-section h3, #ipscanner-section h4, #ipscanner-section p, #ipscanner-section span, #ipscanner-section label, #ipscanner-section button{
  /* allow translation; numerics keep mono */
}

/* ---------- Page entrance (one-time) ---------- */
@keyframes ppPageIn{
  from{ opacity: 0; }
  to  { opacity: 1; }
}
#app{ animation: ppPageIn .4s ease both; }

/* ---------- Responsiveness ---------- */
@media (max-width: 480px){
  header.glass-dark{ padding: 12px 14px !important; }
  header h1#site-title{ font-size: 18px !important; }
  .site-logo{ width: 38px !important; height: 38px !important; border-radius: 12px !important; }
  nav{ padding: 12px 14px 6px !important; }
  nav .nav-btn{ padding: 9px 14px !important; font-size: 12.5px !important; }
  main{ padding-left: 14px !important; padding-right: 14px !important; }
  main h2{ font-size: 19px !important; }
  main .glass{ padding: 14px !important; }
}
@media (min-width: 481px) and (max-width: 768px){
  main .glass{ padding: 18px !important; }
}
@media (min-width: 1024px){
  #app{ max-width: 1200px !important; margin: 0 auto !important; }
  main{ padding: 0 24px 40px !important; }
}
@media (min-width: 1440px){
  #app{ max-width: 1320px !important; }
}

/* Prevent horizontal overflow on tiny screens */
html, body{ overflow-x: hidden; max-width: 100vw; }
#app{ overflow-x: hidden; }

/* ---------- Reduced motion respects animated gradient ---------- */
@media (prefers-reduced-motion: reduce){
  .animated-gradient{ animation: none !important; }
  .site-logo, .site-logo::after, .site-logo .bolt{ animation: none !important; }
}

/* ---------- Print ---------- */
@media print{
  body::before, body::after, .deco-blob, nav, header, #online-status, .lang-switcher{ display: none !important; }
  main .glass, main .glass-dark{ box-shadow: none !important; border: 1px solid #ddd !important; background: #fff !important; color: #111 !important; }
  body{ background: #fff !important; }
  main *, main h2{ color: #111 !important; -webkit-text-fill-color: #111 !important; background: transparent !important; }
}

/* ---------- High contrast tweak for WCAG AA ---------- */
.text-gray-400, .text-slate-400{ color: #c8cadc !important; }
.text-gray-500, .text-slate-500{ color: #a5a8c4 !important; }
.text-gray-300, .text-slate-300{ color: #d8dae8 !important; }

/* ---------- Loading shimmer (utility) ---------- */
.pp-shimmer{
  position: relative; overflow: hidden;
}
.pp-shimmer::after{
  content:""; position:absolute; inset:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.10), transparent);
  animation: ppShimmer 1.6s linear infinite;
}
@keyframes ppShimmer{ from{transform: translateX(-100%);} to{transform: translateX(100%);} }

/* ---------- Toast notification (for language switch) ---------- */
.pp-toast{
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  z-index: 9999;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(99,102,241,.95), rgba(168,85,247,.95));
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(0,0,0,.45), 0 0 24px rgba(168,85,247,.4);
  opacity: 0;
  transition: opacity .3s ease, transform .35s var(--pp-ease-bouncy);
  pointer-events: none;
}
.pp-toast.show{
  opacity: 1; transform: translate(-50%, 0);
}

/* ================================================================
   [v2 PATCH] Codeisa production audit fixes
   Timer pill, Stop button, results table polish, responsive QA.
   These rules are ADDITIVE and do not override existing logic.
   ================================================================ */

/* --- Issue 1: 15-second timer must stay inside its container --- */
#ipscanner-section .ips-timer-pill{
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#ipscanner-section #ips_pingCountdown{
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  min-width: 2.4em;
  text-align: center;
  display: inline-block;
}
/* Ensure the header row inside #ips_pingMonitor never overflows on narrow widths */
#ipscanner-section #ips_pingMonitor > div:first-child{
  min-width: 0;
}
#ipscanner-section #ips_pingMonitor h2{
  min-width: 0;
  flex: 1 1 auto;
}

/* --- Issue 2: Stop Scan button must always render a visible label/icon --- */
#ipscanner-section .ips-stop-btn{
  min-width: 64px;
  position: relative;
}
#ipscanner-section .ips-stop-btn .ips-stop-icon{
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
#ipscanner-section .ips-stop-btn .ips-stop-label{
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}
#ipscanner-section .ips-stop-btn:not(:disabled){
  background: rgba(127, 29, 29, .35);
  color: #fecaca;
}
#ipscanner-section .ips-stop-btn:not(:disabled):hover{
  background: rgba(153, 27, 27, .55);
  color: #fff;
}
#ipscanner-section .ips-stop-btn:focus-visible{
  outline: 2px solid #f87171;
  outline-offset: 2px;
}

/* --- Issue 5: Results table visual polish --- */
#ipscanner-section .ips-results-header{
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
#ipscanner-section #ips_ipsTableList > div{
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
#ipscanner-section #ips_ipsTableList > div:hover{
  background: rgba(15, 23, 42, .55);
}

/* --- Issue 6: Responsive QA — prevent horizontal scroll on tiny screens --- */
html, body{
  max-width: 100%;
  overflow-x: hidden;
}
@media (max-width: 380px){
  /* Slightly tighten internal paddings so the scanner cards never overflow on 320–375px */
  #ipscanner-section .p-4{ padding: 0.75rem !important; }
  #ipscanner-section .rounded-3xl{ border-radius: 1.25rem; }
  #ipscanner-section h2{ font-size: 11px; }
  #ipscanner-section .ips-stop-btn{
    padding-left: .9rem; padding-right: .9rem;
  }
  #ipscanner-section .ips-stop-btn .ips-stop-label{
    /* On the very narrowest viewports show icon-only without breaking layout */
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
  }
  /* Results grid: stack the row a bit tighter so columns stay aligned */
  #ipscanner-section .ips-results-header,
  #ipscanner-section #ips_ipsTableList > div{
    gap: 0.25rem !important;
    font-size: 10.5px;
  }
}
@media (max-width: 360px){
  #ipscanner-section .ips-timer-pill{ padding-left:.5rem; padding-right:.5rem; }
  #ipscanner-section .ips-timer-pill #ips_pingCountdown{ font-size: 10px; }
}

/* Force LTR-only Stop button content rendering even inside an RTL container,
   so the icon never collides with mirrored padding */
html[dir="rtl"] #ipscanner-section .ips-stop-btn{ direction: ltr; }
