:root{
  --bg:#0b0b10;
  --card:#12121a;
  --muted:#9aa0aa;
  --txt:#f2f4f8;
  --line:rgba(255,255,255,.08);
  --accent:#6ae4ff;
}

/* Ekrana göre tüm tasarım oransal büyüsün/küçülsün */
html{
  font-size:clamp(1px, 4vw, 40px);
}

*{
  box-sizing:border-box;
}

html, body{
  margin:0;
  padding:0;
  height:100%;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:none;
}

body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(75rem 37.5rem at 20% -10%, rgba(106,228,255,.18), transparent 60%),
    radial-gradient(56.25rem 31.25rem at 90% 10%, rgba(160,120,255,.18), transparent 55%),
    var(--bg);
  color:var(--txt);
}

/* ===== TOP BAR ===== */
.topbar{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:1000;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;

  padding:.875rem .875rem;
  padding-top:calc(.875rem + env(safe-area-inset-top));

  backdrop-filter:blur(.875rem);
  background:rgba(11,11,16,.78);
  border-bottom:.0625rem solid var(--line);

  transform:none !important;
  transition:none !important;
  will-change:auto !important;
  backface-visibility:hidden;
  -webkit-transform:translateZ(0);
  transform:translateZ(0);
}

.brand{
  display:flex;
  align-items:center;
  gap:.625rem;
  min-width:0;
}

.dot{
  width:.625rem;
  height:.625rem;
  border-radius:999rem;
  background:var(--accent);
  box-shadow:0 0 1.5rem rgba(106,228,255,.7);
  flex:0 0 auto;
}

.title{
  font-weight:800;
  font-size:1rem;
  letter-spacing:.0125rem;
  line-height:1.1;
  min-width:0;
  word-break:break-word;
}

.top-actions{
  display:flex;
  gap:.5rem;
  flex:0 0 auto;
}

.chip{
  font-size:.75rem;
  color:var(--txt);
  text-decoration:none;
  padding:.5rem .625rem;
  border:.0625rem solid var(--line);
  border-radius:999rem;
  background:rgba(255,255,255,.03);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1.1;
  white-space:nowrap;
}

.header-mini-link{
  color:rgba(255,255,255,.72);
  text-decoration:none;
  font-size:.9375rem;
  font-weight:600;
  padding:.5rem .625rem;
  border-radius:.75rem;
  transition:all .18s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.header-mini-link:hover,
.header-mini-link:active{
  color:#fff;
  background:rgba(255,255,255,.06);
  text-decoration:none;
}

.top-link{
  color:#9aa4b2;
  text-decoration:none;
  font-weight:600;
  margin-left:.875rem;
  transition:.2s;
}

.top-link:hover{
  color:#ffffff;
}

/* ===== LAYOUT ===== */
.container{
  width:100%;
  max-width:32.5rem; /* 520px baz */
  margin:0 auto;
  padding:5.5rem .875rem 5.75rem;
  min-height:100vh;
}

.card{
  background:rgba(18,18,26,.92);
  border:.0625rem solid var(--line);
  border-radius:1.125rem;
  padding:1rem;
  box-shadow:0 1rem 3.75rem rgba(0,0,0,.45);
}

.hero{
  padding: .4rem .2rem;
}

.hero-title{
  font-size:1.125rem;
  font-weight:900;
  line-height:1.15;
}

.hero-card{
  max-height: 14rem;
  overflow:hidden;
}

.hero-sub{
  color:var(--muted);
  margin-top:.375rem;
  font-size:.875rem;
}

.grid2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:.75rem;
  margin-top:.875rem;
}

.panel{
  display:block;
  padding:.875rem;
  border-radius:1rem;
  border:.0625rem solid var(--line);
  background:rgba(255,255,255,.03);
  text-decoration:none;
  color:var(--txt);
  transition:transform .18s ease;
}

.panel:active{
  transform:scale(.98);
}

.panel-title{
  font-weight:800;
  font-size:.95rem;
}

.panel-sub{
  color:var(--muted);
  margin-top:.375rem;
  font-size:.75rem;
  line-height:1.3;
}

/* ===== FORM ===== */
.form{
  display:flex;
  flex-direction:column;
  gap:.625rem;
  margin-top:.625rem;
}

label{
  font-size:.75rem;
  color:var(--muted);
}

input,
select,
textarea{
  width:100%;
  padding:.75rem;
  border-radius:.875rem;
  border:.0625rem solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--txt);
  outline:none;
  font-size:.9rem;
}

textarea{
  resize:vertical;
}

.btn{
  margin-top:.375rem;
  padding:.75rem .875rem;
  border-radius:.875rem;
  border:0;
  background:linear-gradient(135deg, rgba(106,228,255,.95), rgba(160,120,255,.95));
  color:#061018;
  font-weight:900;
  font-size:.9rem;
}

.btn-submit{
  width:100%;
  padding:.9375rem;
  background-color:#007aff;
  color:#fff;
  border:none;
  border-radius:.625rem;
  font-size:1rem;
  font-weight:600;
  cursor:pointer;
  margin-top:auto;
  flex-shrink:0;
  transition:all .15s ease;
}

.btn-submit:hover{
  transform:scale(1.02);
}

.btn-submit:active{
  transform:scale(.96);
  box-shadow:inset 0 .1875rem .5rem rgba(0,0,0,.25);
}

#send-code-btn,
#check-code-btn{
  transition:all .15s ease;
}

#send-code-btn:active,
#check-code-btn:active{
  transform:scale(.95);
}

/* ===== HELPERS ===== */
.muted{
  color:var(--muted);
  margin-top:.75rem;
  font-size:.75rem;
}

.muted a{
  color:var(--accent);
  text-decoration:none;
}

.alert{
  margin-top:.625rem;
  padding:.625rem .75rem;
  border-radius:.875rem;
  border:.0625rem solid rgba(255,85,85,.25);
  background:rgba(255,85,85,.08);
  font-size:.85rem;
}

.badge{
  display:inline-block;
  font-size:.6875rem;
  padding:.375rem .625rem;
  border-radius:999rem;
  border:.0625rem solid var(--line);
  color:var(--accent);
}

.result{
  margin-top:.875rem;
  padding:.75rem;
  border-radius:.875rem;
  border:.0625rem solid var(--line);
  background:rgba(255,255,255,.02);
}

.kpi{
  margin-top:.625rem;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:.625rem;
  font-size:.875rem;
}

.uploadbox{
  margin-top:.75rem;
  padding:.875rem;
  border-radius:1rem;
  border:.0625rem dashed rgba(255,255,255,.16);
  background:rgba(255,255,255,.02);
}

/* ===== LIST ===== */
.list{
  margin-top:.875rem;
  display:flex;
  flex-direction:column;
  gap:.625rem;
}

.list-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  text-decoration:none;
  color:var(--txt);
  padding:.75rem;
  border-radius:.875rem;
  border:.0625rem solid var(--line);
  background:rgba(255,255,255,.02);
}

.list-item.pulse{
  border-color:var(--line) !important;
  box-shadow:none !important;
  transform:none !important;
}

/* ===== BOTTOM NAV ===== */
.bottomnav{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:1000;

  display:flex;
  justify-content:space-around;
  gap:.375rem;

  padding:.75rem .625rem calc(.75rem + env(safe-area-inset-bottom));
  background:rgba(11,11,16,.88);
  border-top:.0625rem solid var(--line);
  backdrop-filter:blur(.875rem);

  transform:none !important;
  transition:none !important;
  will-change:auto !important;
  backface-visibility:hidden;
  -webkit-transform:translateZ(0);
  transform:translateZ(0);
}

.bottomnav a{
  color:var(--muted);
  text-decoration:none;
  font-size:.75rem;
  padding:.625rem .625rem;
  border-radius:.75rem;
  line-height:1.1;
  white-space:nowrap;
}

.bottomnav a.active{
  color:var(--txt);
  background:rgba(255,255,255,.06);
  border:.0625rem solid var(--line);
}

/* ===== PRICE COLORS ===== */
.js-price.up{ color:#2dff8f; }
.js-price.down{ color:#ff4d4d; }
.js-price.flat{ color:#ffffff; }

.js-chg.up{ color:#2dff8f; }
.js-chg.down{ color:#ff4d4d; }
.js-chg.flat{ color:rgba(255,255,255,.75); }

/* ===== TV AREA ===== */
.tvwrap{
  margin-top:.75rem;
  height:calc(100vh - 13.75rem);
  min-height:26.25rem;
  border-radius:1rem;
  overflow:hidden;
  border:.0625rem solid var(--line);
  background:rgba(255,255,255,.02);
}

#tv_container{
  width:100%;
  height:100%;
}

.tfbar{
  display:flex;
  gap:.375rem;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.tf{
  padding:.5rem .625rem;
  border-radius:.75rem;
  border:.0625rem solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--muted);
  font-size:.75rem;
}

.tf.active{
  color:var(--txt);
  border-color:rgba(106,228,255,.35);
  background:rgba(106,228,255,.10);
}

/* ===== LIVE BAR ===== */
.livebar{
  margin-top:.625rem;
  padding:.625rem .75rem;
  border-radius:1rem;
  border:.0625rem solid var(--line);
  background:rgba(11,11,16,.72);
  backdrop-filter:blur(.75rem);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
}

.lb-left{
  display:flex;
  flex-direction:column;
  gap:.125rem;
  min-width:0;
}

.lb-sym{
  font-weight:900;
  font-size:.875rem;
  line-height:1;
}

.lb-name{
  color:var(--muted);
  font-size:.6875rem;
  line-height:1.2;
  word-break:break-word;
}

.lb-right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:.125rem;
  flex:0 0 auto;
}

.lb-price{
  font-weight:900;
  font-size:.95rem;
  line-height:1;
}

.lb-chg{
  font-size:.7rem;
}

.livebar .up{ color:#2dff8f; }
.livebar .down{ color:#ff4d4d; }
.livebar .flat{ color:#ffffff; }

/* ===== DRAG ===== */
.draggable-rate{
  cursor:grab;
  user-select:none;
  transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease, border-color .18s ease;
}

.draggable-rate:active{
  cursor:grabbing;
}

.draggable-rate.sort-active{
  cursor:move;
  border-color:rgba(106,228,255,.25);
}

.draggable-rate.sort-active:hover{
  transform:translateY(-.0625rem);
  box-shadow:0 .5rem 1.5rem rgba(0,0,0,.18);
}

.draggable-rate.dragging{
  opacity:.55;
  transform:scale(.98);
}

.order-buttons{
  display:flex;
  gap:.25rem;
}

.order-buttons button{
  background:rgba(255,255,255,.06);
  border:.0625rem solid rgba(255,255,255,0.1);
  color:#fff;
  border-radius:.375rem;
  padding:.1875rem .375rem;
  cursor:pointer;
  font-size:.75rem;
}

.order-buttons button:hover{
  background:rgba(255,255,255,0.15);
}

/* ===== STEPS ===== */
.steps{
  margin:.75rem 0 .875rem;
  display:flex;
  flex-direction:column;
  gap:.5rem;
}

.step{
  position:relative;
  padding:.75rem .875rem;
  border-radius:.875rem;
  border:.0625rem solid var(--line);
  background:rgba(255,255,255,.02);
  color:var(--muted);
  overflow:hidden;
  transition:all .25s ease;
}

.step span{
  position:relative;
  z-index:2;
  font-size:.875rem;
  color:rgba(255,255,255,.82);
}

.step.active{
  color:var(--txt);
  box-shadow:0 .625rem 1.875rem rgba(0,0,0,.35);
  border-color:rgba(46,204,113,.35);
}

.step-bar{
  margin-top:.625rem;
  width:100%;
  height:.5rem;
  border-radius:999rem;
  background:rgba(255,255,255,.08);
  overflow:hidden;
  position:relative;
  z-index:2;
}

.step-fill{
  width:0%;
  height:100%;
  border-radius:999rem;
  background:linear-gradient(90deg,#1ed760,#56f08a);
  transition:none;
}

.step.done .step-fill{
  width:100%;
}

.step.done span{
  color:#c9ffd9;
}

/* ===== AI STEPS ===== */
#aiSteps{
  display:flex;
  flex-direction:column;
  gap:.5rem;
  margin-top:.625rem;
  max-height:18.75rem;
  overflow:hidden;
}

#aiSteps .step{
  font-size:.75rem;
  padding:.375rem .5rem;
  border-radius:.625rem;
  background:rgba(255,255,255,.03);
  border:.0625rem solid rgba(255,255,255,.05);
}

#aiSteps .step span{
  display:block;
  margin-bottom:.25rem;
}

#aiSteps .step-bar{
  width:100%;
  height:.375rem;
  background:rgba(255,255,255,.08);
  border-radius:.625rem;
  overflow:hidden;
}

#aiSteps .step-fill{
  height:100%;
  width:0%;
  background:#00ff88;
  border-radius:.625rem;
  transition:width .2s linear;
}

/* ===== RUN AI BUTTON ===== */
#btnRunAI{
  display:flex;
  align-items:center;
  justify-content:center;
  width:10rem;
  height:2.625rem;
  font-size:.875rem;
  font-weight:600;
  white-space:nowrap;
  text-align:center;
}

#btnRunAI.ai-running{
  position:relative;
  overflow:hidden;
  opacity:1;
}

#btnRunAI.ai-running::after{
  content:'';
  position:absolute;
  top:0;
  left:-120%;
  width:120%;
  height:100%;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  animation:aiBtnGlow 1.3s linear infinite;
}

@keyframes aiBtnGlow{
  0%{ left:-120%; }
  100%{ left:120%; }
}

/* ===== SUPPORT ===== */
.support-form{
  display:flex;
  flex-direction:column;
  gap:.75rem;
  margin-top:.875rem;
}

.support-form input,
.support-form textarea{
  width:100%;
  padding:.875rem;
  border-radius:.875rem;
  border:.0625rem solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--txt);
  font-size:.875rem;
}

.support-form textarea{
  resize:vertical;
  min-height:6.875rem;
}

.support-btn{
  align-self:flex-start;
  padding:.625rem 1.375rem;
  font-size:.875rem;
}

.support-ticket{
  display:flex;
  flex-direction:column;
  gap:.5rem;
}

/* ===== ANALYZE FULLSCREEN ===== */
body.analyze-fullscreen{
  overflow:hidden !important;
}

body.analyze-fullscreen .container{
  max-width:100% !important;
  padding:5.5rem .625rem 5.75rem !important;
}

body.analyze-fullscreen .card{
  height:calc(100dvh - 5.5rem - 5.75rem);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

body.analyze-fullscreen .tvwrap{
  flex:1;
  min-height:0 !important;
  height:auto !important;
}

body.analyze-fullscreen #tv_container{
  width:100% !important;
  height:100% !important;
}

body.analyze-fullscreen .bottomnav{
  display:flex !important;
  z-index:1000 !important;
}

/* ===== MOBILE FINE TUNE ===== */
@media (max-width:560px){
  .container{
    padding:5.25rem .75rem 5.5rem;
  }

  .card{
    padding:.875rem;
  }

  .grid2{
    gap:.625rem;
  }

  .tvwrap{
    min-height:22.5rem;
  }

  body.analyze-fullscreen .container{
    padding:5.25rem .5rem 5.5rem !important;
  }

  body.analyze-fullscreen .card{
    height:calc(100dvh - 5.25rem - 5.5rem);
  }
}


/* GLOBAL BUTON BASMA EFEKTİ */
button,
.btn,
a.btn,
input[type="submit"],
input[type="button"]{
  transition:
    transform 0.08s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease,
    opacity 0.12s ease;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}

button.tap-press,
.btn.tap-press,
a.btn.tap-press,
input[type="submit"].tap-press,
input[type="button"].tap-press{
  transform: scale(0.96);
  filter: brightness(1.08);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.28);
}

/* ===== ADMIN SAYFALARI SCROLL FIX ===== */
body.admin-page{
  height:auto !important;
  overflow-y:auto !important;
}

body.admin-page .container{
  min-height:auto !important;
}

body.admin-page .page-screen{
  min-height:auto !important;
  height:auto !important;
  overflow:visible !important;
}

body.admin-page .card{
  overflow:visible !important;
  max-height:none !important;
}