/* Canlı hikâye (hikaye.js ile birlikte): "Nasıl çalışır" bölümünde telefon çerçevesinde WhatsApp yazışması
   kendi kendine oynar, yanındaki küçük panele sipariş düşer, adım kartları sırayla vurgulanır.
   Renk değişkenleri sayfadan gelir; stiller .hk- önekiyle sayfadan ayrılır. Azaltılmış hareket tercihinde animasyon yok. */
.hikaye { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; max-width: 860px; margin: 0 auto 56px; }
.hk-altyazi { grid-column: 1 / -1; text-align: center; font-size: 15px; font-weight: 500; color: var(--muted); min-height: 24px; margin-top: -8px; transition: opacity .3s ease; }
.hk-altyazi.hk-solgun { opacity: 0; }
.hk-gizli { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Telefon */
.hk-telefon { position: relative; background: var(--night); border-radius: 36px; padding: 12px; box-shadow: 0 30px 60px -30px rgba(28, 11, 68, .6), 0 0 0 1px rgba(255, 255, 255, .06) inset; }
.hk-telefon::before { content: ""; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 92px; height: 22px; background: var(--night); border-radius: 0 0 14px 14px; z-index: 2; }
.hk-ekran { display: flex; flex-direction: column; height: 520px; border-radius: 26px; overflow: hidden; background: #efe8df; }
.hk-ust { display: flex; align-items: center; gap: 10px; padding: 30px 14px 10px; background: #128c7e; color: #fff; }
.hk-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--violet); display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }
.hk-ust b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.2; }
.hk-ust small { display: block; font-size: 11.5px; opacity: .85; }
.hk-akis { list-style: none; flex: 1; min-height: 0; overflow: hidden; padding: 12px 10px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.hk-saat { align-self: center; font-size: 11px; color: #5b6b63; background: rgba(255, 255, 255, .8); border-radius: 8px; padding: 2px 8px; margin-bottom: 4px; }
.hk-balon { max-width: 86%; padding: 7px 10px 5px; border-radius: 10px; font-size: 13.2px; line-height: 1.38; color: #111b21; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); white-space: pre-line; animation: hk-balon .35s cubic-bezier(.2, .7, .2, 1) both; }
.hk-balon time { display: block; font-size: 10px; color: #667781; text-align: right; margin-top: 2px; }
.hk-in { align-self: flex-start; background: #fff; border-top-left-radius: 2px; }
.hk-out { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 2px; }
.hk-out time::after { content: " ✓✓"; color: #53bdeb; }
.hk-link { color: #027eb5; text-decoration: underline; }
.hk-yaziyor { align-self: flex-start; background: #fff; border-radius: 10px; border-top-left-radius: 2px; padding: 9px 12px; display: flex; gap: 4px; animation: hk-balon .25s both; }
.hk-yaziyor i { width: 6px; height: 6px; border-radius: 50%; background: #8a9a94; animation: hk-nokta 1s ease-in-out infinite; }
.hk-yaziyor i:nth-child(2) { animation-delay: .15s; } .hk-yaziyor i:nth-child(3) { animation-delay: .3s; }
.hk-yazi { display: flex; align-items: center; gap: 8px; padding: 8px 10px 10px; background: #f0f2f5; }
.hk-yazi span { flex: 1; background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 13px; color: #8696a0; }
.hk-yazi i { width: 34px; height: 34px; border-radius: 50%; background: #128c7e; color: #fff; display: grid; place-items: center; font-style: normal; font-size: 14px; }
@keyframes hk-balon { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes hk-nokta { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Küçük panel */
.hk-panel { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 24px 50px -30px rgba(60, 20, 140, .35); overflow: hidden; margin-top: 36px; }
.hk-panel-ust { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--lavender); }
.hk-panel-ust b { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.hk-panel-ust b::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--violet); }
.hk-sekme { font-size: 13px; font-weight: 600; color: var(--violet); display: inline-flex; align-items: center; gap: 6px; }
.hk-sekme i { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--violet); color: #fff; font-size: 12px; display: grid; place-items: center; transition: transform .3s ease; }
.hk-sekme i.hk-zipla { animation: hk-zipla .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes hk-zipla { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.hk-liste { list-style: none; padding: 12px; display: grid; gap: 8px; }
.hk-kart { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "no tutar durum" "ad ad durum"; align-items: center; gap: 2px 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); font-size: 13.5px; }
.hk-no { grid-area: no; font-size: 12px; font-weight: 600; color: var(--stone); letter-spacing: .02em; }
.hk-tutar { grid-area: tutar; font-weight: 600; color: var(--ink); text-align: right; }
.hk-kart b { grid-area: ad; font-weight: 500; color: var(--muted); font-size: 13px; }
.hk-durum { grid-area: durum; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--lavender); color: var(--muted); transition: background .3s ease, color .3s ease; }
.hk-yeni .hk-durum { background: var(--violet-soft); color: var(--violet); }
.hk-odendi .hk-durum { background: var(--mint-bg); color: var(--mint-ink); }
.hk-kargoda .hk-durum { background: #e3efff; color: #2a5bb8; }
.hk-kart.hk-dusen { animation: hk-dus .55s cubic-bezier(.2, .8, .2, 1) both; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.hk-kart.hk-dusen.hk-odendi { border-color: #9ad9bd; box-shadow: 0 0 0 3px var(--mint-bg); }
@keyframes hk-dus { from { opacity: 0; transform: translateY(-18px) scale(.97); } to { opacity: 1; transform: none; } }
/* Bildirim: başlığın altında açılıp kapanan şerit (kartların üstüne binmez) */
.hk-bildirim { background: var(--night); color: #fff; font-size: 12.5px; font-weight: 500; padding: 0 16px; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .35s ease, padding .35s ease, opacity .3s ease; }
.hk-bildirim.hk-acik { max-height: 44px; padding: 9px 16px; opacity: 1; }
.hk-bildirim::before { content: "🔔 "; }
.hk-ciro { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.hk-ciro b { font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }

/* Adım kartları hikâyeyle eş zamanlı vurgulanır */
.step { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background .4s ease; }
.step.hk-aktif { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft), 0 24px 50px -30px rgba(60, 20, 140, .4); }
.step.hk-aktif .k { color: var(--violet); }

@media (max-width: 760px) {
  .hikaye { grid-template-columns: 1fr; max-width: 360px; gap: 18px; }
  .hk-telefon { max-width: 300px; margin: 0 auto; width: 100%; }
  .hk-ekran { height: 460px; }
  .hk-panel { margin-top: 0; }
  .hk-altyazi { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hk-balon, .hk-yaziyor, .hk-yaziyor i, .hk-kart.hk-dusen, .hk-sekme i.hk-zipla { animation: none; }
  .hk-bildirim, .hk-altyazi, .hk-durum, .step { transition: none; }
}
