* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --card: #f7f9fc;
  --border: #e4e9f1;          /* kılcal çerçeve — ağır tel kafes hissi biter */
  --border-strong: #c9d3e0;   /* form alanları: bir tık belirgin */
  --text: #182231;            /* mürekkep */
  --muted: #5c6b80;
  --accent: #1f3a5c;          /* tek renk: derin lacivert */
  --accent-2: #31527a;
  --accent-soft: rgba(31, 58, 92, .06);
  --ok: #16794f;
  --err: #c9302c;
  --shadow: 0 1px 2px rgba(18, 28, 45, .05);
}

/* Marka kimliği: sayfanın tepesinde degrade şerit */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  z-index: 100;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

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

/* ---- auth sayfalari ---- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2.2rem;
  width: 340px;
  box-shadow: 0 8px 30px rgba(30, 58, 110, .10);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: .3rem; }
.auth-card .tag { color: var(--muted); font-size: .85rem; margin-bottom: 1.4rem; }
.auth-card label { display: block; font-size: .85rem; color: var(--muted); margin: .8rem 0 .25rem; }
.auth-card input {
  width: 100%;
  padding: .55rem .7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.auth-card button {
  width: 100%;
  margin-top: 1.2rem;
  padding: .6rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.auth-card .alt { margin-top: 1rem; font-size: .85rem; color: var(--muted); text-align: center; }
.notice { margin-top: .9rem; font-size: .85rem; }
.notice.error { color: var(--err); }
.notice.ok { color: var(--ok); }

/* ---- ana uygulama ---- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 1.4rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
header .brand { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
header .brand span { color: var(--accent); }
header .user { color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 1rem; }
header .user a { margin-left: .2rem; }
header .wallet b { color: var(--ok); }
header .wallet button {
  margin-left: .35rem;
  padding: .2rem .6rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font-size: .78rem;
  cursor: pointer;
}

.layout { display: flex; height: calc(100vh - 57px); }

aside {
  width: 280px;
  background: #f9fafc;
  border-right: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
  flex-shrink: 0;
}
aside h2 { font-size: .8rem; text-transform: uppercase; color: var(--muted); margin-bottom: .7rem; }
#newBtn {
  width: 100%;
  padding: .55rem;
  margin-bottom: 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.history-item {
  padding: .6rem .7rem;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: .35rem;
  border: 1px solid transparent;
}
.history-item:hover { background: var(--accent-soft); }
.history-item.active { border-color: var(--accent); background: var(--accent-soft); }
.history-item .q { font-size: .87rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item .meta { font-size: .72rem; color: var(--muted); margin-top: .15rem; }

main { flex: 1; overflow-y: auto; padding: 1.4rem 2rem; }

/* soru formu */
#composer { max-width: none; margin: 1rem 0 0; }
#composer h1 { margin-bottom: .4rem; }
#composer .tag { color: var(--muted); margin-bottom: 1.4rem; }
.composer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 520px);
  gap: 2rem;
  align-items: start;
}
.composer-main { min-width: 0; }
.composer-side { min-width: 0; }
@media (max-width: 900px) {
  .composer-grid { grid-template-columns: 1fr; }
}
.composer-side h2 {
  font-size: .8rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .7rem;
}
#question {
  width: 100%;
  min-height: 260px;
  padding: .8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font: inherit;
  resize: vertical;
}
.panelist-picker { display: flex; flex-direction: column; gap: .55rem; margin: .6rem 0 .4rem;
  max-height: 38vh; overflow-y: auto; overflow-x: hidden; padding-right: .4rem; }
#startBtn { margin-inline-start: auto; } /* satırın sağında (RTL'de solunda) */

/* çökebilir gruplar */
.panel-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem .8rem;
  margin-bottom: .7rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.panel-group summary {
  cursor: pointer;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  user-select: none;
}
.panel-group summary::marker { color: var(--accent); }

/* seçim alanı */
#selectedPanel {
  border: 1px dashed var(--accent);
  border-radius: 8px;
  padding: .6rem .8rem;
  margin-bottom: .8rem;
  background: var(--accent-soft);
}
#selectedPanel .sel-title {
  font-size: .78rem;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: .45rem;
}
#selCount { color: var(--accent); font-weight: 700; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .25rem .6rem;
  margin: 0 .3rem .35rem 0;
  font-size: .76rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip b { color: var(--accent); font-weight: 600; }
.chip button {
  border: none; background: none; color: var(--err);
  cursor: pointer; font-size: .9rem; padding: 0;
}
.panelist-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .9rem;
  min-width: 0;
}
.panelist-row:has(input:checked) { border-color: var(--accent); }
.panelist-row label { display: flex; align-items: center; gap: .5rem; cursor: pointer;
  font-size: .92rem; flex: 0 0 auto; white-space: nowrap; }
.panelist-row select {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: .35rem .5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: .85rem;
  text-overflow: ellipsis;
}
.panelist-row select:disabled { opacity: .45; }
#startBtn {
  padding: .65rem 1.6rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
#startBtn:disabled { opacity: .5; cursor: not-allowed; }
#composerError { color: var(--err); margin-top: .8rem; font-size: .9rem; }
.empty-note { color: var(--muted); background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 1rem; font-size: .9rem; }

/* tartisma gorunumu */
#debateView { max-width: 1100px; margin: 0 auto; }
#debateQuestion { font-size: 1.15rem; margin-bottom: .5rem; }
#debateStatus { color: var(--muted); font-size: .85rem; margin-bottom: 1.4rem; }
#debateStatus .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: .4rem; animation: pulse 1.2s infinite; }
#debateStatus.done .dot { background: var(--ok); animation: none; }
#debateStatus.failed .dot { background: var(--err); animation: none; }
@keyframes pulse { 50% { opacity: .3; } }

#costLine { color: var(--muted); font-size: .82rem; margin: -0.9rem 0 1.3rem; }
#costLine .amount { color: var(--ok); font-weight: 600; }
.card .meta { color: var(--muted); font-size: .72rem; margin-top: .6rem;
  border-top: 1px dashed var(--border); padding-top: .4rem; }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(23, 37, 60, .5);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.6rem;
  width: 380px;
  box-shadow: 0 12px 40px rgba(30, 58, 110, .16);
}
.modal h2 { font-size: 1.1rem; margin-bottom: .6rem; }
.modal p { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.modal-actions { display: flex; gap: .6rem; margin-top: 1.2rem; }
.modal-actions button {
  flex: 1; padding: .55rem;
  border: none; border-radius: 8px;
  background: var(--accent);
  color: #fff; font-weight: 600; cursor: pointer;
}
.modal-actions button.secondary {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
}

/* sosyal giriş */
.divider { color: var(--muted); font-size: .78rem; text-align: center; margin: 1rem 0 .7rem;
  display: flex; align-items: center; gap: .6rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid var(--border); border-radius: 8px;
  padding: .5rem; margin-bottom: .5rem;
  color: var(--text); font-size: .9rem;
}
.social-btn:hover { border-color: var(--accent); }
.g-icon { font-weight: 700; color: var(--accent); }

/* RTL (Arapça) */
html[dir="rtl"] aside { border-right: none; border-left: 1px solid var(--border); }
html[dir="rtl"] .card h3 .spinner { float: left; }

.round { margin-bottom: 1.8rem; }
.round > h2 {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding-bottom: .45rem;
  margin-bottom: 1rem;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .9rem; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .9rem 1rem;
  box-shadow: var(--shadow);
}
.card.synthesis {
  border: 1px solid var(--accent);
  border-top: 3px solid var(--accent);
  background: var(--panel);
}
.card.synthesis h3 { color: var(--accent); }
.card h3 { font-size: .9rem; margin-bottom: .5rem; color: var(--text); }
.card h3 .model { color: var(--muted); font-weight: 400; font-size: .72rem; }
.card h3 .spinner { color: var(--muted); font-weight: 400; font-size: .75rem; }
.card .content { font-size: .88rem; line-height: 1.55; white-space: pre-wrap; color: var(--text); }


/* ---- özel kaydırma çubuğu ---- */
* {
  scrollbar-width: thin;                     /* Firefox */
  scrollbar-color: var(--border) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: padding-box; }

/* ---- mobil uyum ---- */
#menuBtn {
  display: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  padding: .3rem .65rem;
  font-size: 1.05rem;
  cursor: pointer;
  margin-right: .7rem;
}
#drawerBackdrop {
  display: none;
  position: fixed;
  inset: 57px 0 0 0;
  background: rgba(23, 37, 60, .45);
  z-index: 30;
}
#drawerBackdrop.show { display: block; }

.modal { width: min(380px, 92vw); }
.auth-card { width: min(340px, 92vw); }

@media (max-width: 768px) {
  #menuBtn { display: inline-block; }
  header { padding: .6rem .8rem; flex-wrap: nowrap; gap: .5rem; }
  header .brand { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  header .brand .brand-tag { display: none; }   /* dar ekranda slogan gizli */
  header .user { gap: .5rem; font-size: .8rem; flex-shrink: 0; }
  #username { display: none; }                   /* yer açmak için kullanıcı adı gizli */
  header .wallet button { padding: .15rem .5rem; }

  /* geçmiş paneli: soldan kayan çekmece */
  aside {
    position: fixed;
    top: 57px; bottom: 0; left: 0;
    width: min(300px, 84vw);
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 40;
    box-shadow: 4px 0 24px rgba(30,58,110,.18);
  }
  aside.open { transform: translateX(0); }
  html[dir="rtl"] aside {
    left: auto; right: 0;
    transform: translateX(100%);
    box-shadow: -4px 0 24px rgba(30,58,110,.18);
  }
  html[dir="rtl"] aside.open { transform: translateX(0); }

  main { padding: 1rem .9rem; }
  #composer { margin-top: .3rem; }
  #question { min-height: 150px; }
  .composer-grid { gap: 1.1rem; }
  .panelist-picker { max-height: none; overflow-y: visible; }
  .panelist-row { flex-wrap: wrap; }             /* uzun model adında select alta insin */
  .panelist-row select { flex-basis: 100%; }
  .cards { grid-template-columns: 1fr; }
  #debateView { max-width: none; }
  .modal-actions { flex-direction: column; }
}

@media (max-width: 400px) {
  header .wallet { font-size: .74rem; }
  main { padding: .8rem .6rem; }
}

/* login modal formu */
.modal-form label { display: block; font-size: .85rem; color: var(--muted); margin: .7rem 0 .25rem; }
.modal-form input {
  width: 100%;
  padding: .55rem .7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.modal-form button {
  width: 100%;
  margin-top: 1.1rem;
  padding: .6rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.modal .alt { margin-top: 1rem; font-size: .85rem; color: var(--muted); text-align: center; }
#headerLoginBtn {
  padding: .3rem .9rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: .85rem;
}


/* deneme (demo) banner'i */
.trial-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--ok);
  background: rgba(14, 159, 110, .07);
  border-radius: 8px;
  padding: .7rem 1rem;
  margin-bottom: .9rem;
  font-size: .9rem;
}
.trial-banner button {
  flex-shrink: 0;
  padding: .45rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--ok);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

/* ---- yeni özellikler ---- */
.tpl-row { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.tpl-label { font-size: .78rem; text-transform: uppercase; color: var(--muted); margin-right: .3rem; }
.tpl-chip {
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--panel); color: var(--text);
  font-weight: 600;
  padding: .3rem .8rem; font-size: .8rem; cursor: pointer;
}
.tpl-chip:hover { border-color: var(--accent); background: var(--accent); color: #fff; }


.opts-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .8rem; }
.opts-row label { display: flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--muted); }
.opts-row select {
  padding: .35rem .5rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: .85rem;
}

.role-select { flex: 0 0 auto; max-width: 150px; }

#debateToolbar { display: flex; gap: .6rem; margin-bottom: 1rem; }
#debateToolbar button {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--text);
  padding: .4rem .9rem; font-size: .83rem; cursor: pointer;
}
#debateToolbar button:hover { border-color: var(--accent); color: var(--accent); }

#followupBox {
  display: flex; gap: .6rem; align-items: flex-start;
  margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
#followupBox textarea {
  flex: 1; padding: .6rem .8rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font: inherit; resize: vertical;
}
#followupBox button {
  padding: .6rem 1.4rem; border: none; border-radius: 8px;
  background: var(--accent);
  color: #fff; font-weight: 600; cursor: pointer;
}

#historySearch {
  width: 100%; margin-bottom: .6rem; padding: .45rem .6rem;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: .83rem;
}

#helpBtn {
  border: 1px solid var(--border); background: var(--panel);
  border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: .85rem;
}
.help-modal { width: min(560px, 94vw); }
.help-modal p { white-space: pre-line; font-size: .88rem; line-height: 1.6; color: var(--text); }

.try-cta {
  border: 1px solid var(--accent); border-radius: 6px;
  padding: .35rem 1rem; font-weight: 600;
}
.share-main { max-width: 1100px; margin: 1.5rem auto; padding: 0 1rem; }

/* belge ekleme */
#docBtn {
  border: 1px dashed var(--border); border-radius: 8px;
  background: var(--card); color: var(--text);
  padding: .35rem .8rem; font-size: .83rem; cursor: pointer;
}
#docBtn:hover { border-color: var(--accent); color: var(--accent); }
#docInfo { font-size: .8rem; color: var(--ok); }

/* ---- Dil menüsü ---- */
button, .tpl-chip { letter-spacing: .01em; }

.lang-sel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: .8rem;
  font-weight: 600;
  padding: .3rem .4rem;
  cursor: pointer;
}
.lang-sel:hover { border-color: var(--accent); color: var(--accent); }
.lang-sel-floating { position: fixed; top: 14px; right: 16px; z-index: 50; }
[dir="rtl"] .lang-sel-floating { right: auto; left: 16px; }

/* ---- Tartışmacı istatistikleri ---- */
.panel-stats { margin-top: .5rem; font-size: .82rem; }
.panel-stats summary { cursor: pointer; color: var(--muted); font-weight: 600; user-select: none; }
.stat-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .3rem .2rem; border-bottom: 1px solid var(--border);
  color: var(--muted); max-width: 480px;
}
.stat-row span:first-child { color: var(--text); font-weight: 600; }

/* ---- Kart içi Markdown biçimlendirme ---- */
.content h3, .content h4, .content h5, .content h6 {
  margin: .9rem 0 .4rem; color: var(--text); line-height: 1.3;
}
.content h3 { font-size: 1.02rem; }
.content h4 { font-size: .95rem; }
.content h5, .content h6 { font-size: .9rem; }
.content p { margin: .45rem 0; }
.content ul, .content ol { margin: .45rem 0; padding-inline-start: 1.4rem; }
.content li { margin: .25rem 0; }
.content b { color: var(--text); }
.content code {
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  padding: .05rem .3rem; font-size: .85em;
}
.content pre {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: .6rem .8rem; overflow-x: auto; margin: .5rem 0; font-size: .85em;
}
.content pre code { border: none; background: none; padding: 0; }
.content blockquote {
  border-inline-start: 3px solid var(--accent); margin: .5rem 0;
  padding: .2rem .8rem; color: var(--muted);
}
.content hr { border: none; border-top: 1px solid var(--border); margin: .8rem 0; }
.content table { border-collapse: collapse; margin: .6rem 0; max-width: 100%; display: block; overflow-x: auto; }
.content th, .content td { border: 1px solid var(--border); padding: .35rem .6rem; text-align: start; }
.content th { background: var(--card); font-weight: 700; }
.content a { color: var(--accent); }

/* ---- Geçmişte sonuç önizleme ikonu ---- */
.history-item { display: flex; align-items: center; gap: .4rem; }
.hist-main { flex: 1; min-width: 0; }
.peek-btn {
  flex: 0 0 auto; border: 1px solid transparent; background: none;
  font-size: .95rem; cursor: pointer; padding: .2rem .3rem; border-radius: 6px;
  opacity: .45;
}
.history-item:hover .peek-btn { opacity: 1; }
.peek-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.peek-modal { max-width: 720px; width: min(92vw, 720px); }
.peek-modal #peekBody {
  max-height: 60vh; overflow-y: auto; margin: .6rem 0;
  font-size: .9rem; line-height: 1.55;
}

/* ---- Popup mobil uyumu ---- */
.modal-backdrop { padding: 1rem; }
@media (max-width: 768px) {
  .modal { width: 100%; max-width: 100%; padding: 1.1rem; max-height: 90vh; overflow-y: auto; }
  .peek-modal { width: 100%; }
  .peek-modal #peekBody { max-height: 62vh; font-size: .88rem; }
  .modal-actions button { padding: .7rem; } /* dokunmatik icin daha genis hedef */
}
@media (hover: none) {
  .peek-btn { opacity: 1; } /* dokunmatikte hover yok — ikon hep gorunur */
}

/* ---- Kayıt: ad-soyad yan yana ---- */
.name-row { display: flex; gap: .7rem; }
.name-row > span { flex: 1; min-width: 0; }
.name-row input { width: 100%; }
@media (max-width: 480px) { .name-row { flex-direction: column; gap: 0; } }

/* ---- İstatistik sayfası ---- */
.stats-main { max-width: 860px; margin: 0 auto; padding: 1.4rem 1.2rem 3rem; }
.stats-main section { margin-top: 1.6rem; }
.stats-main h2 {
  font-size: .85rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--accent); font-weight: 700;
  border-bottom: 2px solid var(--accent-soft); padding-bottom: .4rem; margin-bottom: .8rem;
}
.stat-cards { display: flex; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.stat-card {
  flex: 1; min-width: 140px; background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px; padding: .9rem 1rem; color: var(--muted); font-size: .85rem;
}
.stat-num { font-size: 1.7rem; font-weight: 800; color: var(--text); }
.bar-row { display: flex; align-items: center; gap: .7rem; margin: .35rem 0; font-size: .85rem; }
.bar-label {
  flex: 0 0 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text); font-weight: 600; text-align: end;
}
.bar-track { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 6px; height: 18px; }
.bar-fill { display: block; height: 100%; background: var(--accent); }
.bar-count { flex: 0 0 2.5rem; color: var(--muted); }
@media (max-width: 600px) { .bar-label { flex-basis: 120px; font-size: .78rem; } }
#statsLink { text-decoration: none; font-size: 1rem; }

/* ---- Modal içi form öğeleri (özel rol vb.) ---- */
.modal input:not([type="hidden"]) {
  display: block;
  width: 100%;
  margin: .7rem 0 .2rem;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: .92rem;
}
.modal input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.modal p { margin-bottom: .2rem; }

/* ============ Rafine katman: sade & elegant ============ */
header { border-bottom: 1px solid var(--border); }
header .brand { font-weight: 700; letter-spacing: -.015em; }
header .brand-tag { color: var(--muted); font-weight 400; }

/* Form alanları kılcal çerçeveden bir tık belirgin olsun */
textarea, .opts-row select, .lang-sel, .modal input:not([type="hidden"]),
.auth-card input, #historySearch, #followupInput {
  border-color: var(--border-strong);
}

/* Tek buton ailesi: dolgun lacivert birincil, sessiz ikincil */
#startBtn, #followupBtn, .modal-actions button:not(.secondary) {
  background: var(--accent);
  transition: background .15s ease;
}
#startBtn:hover, #followupBtn:hover, .modal-actions button:not(.secondary):hover {
  background: var(--accent-2);
}

/* İstatistik çubukları düz, zarif */
.bar-fill { background: var(--accent); opacity: .85; }

/* Geçmiş: aktif kayıt yanda ince mürekkep çizgisi */
.history-item { border-inline-start: 2px solid transparent; }
.history-item.active { border-color: var(--border); border-inline-start: 2px solid var(--accent); background: var(--card); }
.history-item:hover { background: var(--card); }

/* Önizleme oku: emoji değil, sessiz glif */
.peek-btn { color: var(--muted); font-size: 1rem; line-height: 1; }
.peek-btn:hover { color: var(--accent); }

/* Yardım düğmesi: zarif daire */
#helpBtn {
  border: 1px solid var(--border-strong); border-radius: 50%;
  width: 26px; height: 26px; padding: 0;
  background: none; color: var(--muted);
  font-size: .8rem; font-weight: 700; cursor: pointer;
}
#helpBtn:hover { color: var(--accent); border-color: var(--accent); }

/* Başlık istatistik bağlantısı: sade metin */
#statsLink { color: var(--muted); font-size: .82rem; font-weight: 600; }
#statsLink:hover { color: var(--accent); }

/* ---- Misafir karşılama ---- */
#guestHero { max-width: 640px; margin: 1.2rem 0 1.8rem; }
#guestHero h1 { font-size: 1.65rem; letter-spacing: -.02em; line-height: 1.25; margin-bottom: .6rem; }
#guestHero p { color: var(--muted); line-height: 1.6; margin-bottom: .8rem; }
.hero-points { list-style: none; padding: 0; }
.hero-points li { padding-inline-start: 1.1rem; position: relative; color: var(--muted); margin: .35rem 0; font-size: .92rem; }
.hero-points li::before { content: "—"; position: absolute; inset-inline-start: 0; color: var(--accent); }
.composer-h { font-size: 1.15rem; margin-bottom: .2rem; }

/* ---- Bakiye paketleri ---- */
.topup-packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: .8rem 0 .2rem; }
.pack-btn {
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--panel); color: var(--text);
  font-weight: 700; font-size: .95rem;
  padding: .6rem 0; cursor: pointer;
  transition: border-color .12s ease, color .12s ease;
}
.pack-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Kullanıcı menüsü ---- */
.user-menu-wrap { position: relative; }
#userMenuBtn {
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--panel); color: var(--text);
  padding: .35rem .7rem; font-size: .85rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: .35rem;
}
#userMenuBtn:hover { border-color: var(--accent); }
#userMenuBtn .caret { font-size: .6rem; color: var(--muted); }
.user-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px);
  min-width: 210px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(18, 28, 45, .12);
  padding: .4rem; z-index: 60;
}
.menu-balance {
  display: flex; justify-content: space-between; align-items: center;
  padding: .55rem .7rem; color: var(--muted); font-size: .85rem;
  border-bottom: 1px solid var(--border); margin-bottom: .3rem;
}
.menu-balance b { color: var(--text); font-size: .95rem; }
.user-menu .menu-item {
  display: block; width: 100%; text-align: start;
  padding: .5rem .7rem; border: none; background: none;
  color: var(--text); font-size: .87rem; font-weight: 500;
  border-radius: 6px; cursor: pointer; text-decoration: none;
}
.user-menu .menu-item:hover { background: var(--card); color: var(--accent); }

/* Düşük kredi uyarısı: yalnız $1 ve altında görünür */
.low-balance {
  background: #fdecec; color: var(--err); border: 1px solid #f3c2c2;
  border-radius: 999px; padding: .25rem .6rem;
  font-size: .8rem; font-weight: 700; cursor: pointer;
}

/* ---- Küçük ödeme penceresi ---- */
.checkout-head { display: flex; justify-content: space-between; align-items: center; }
.icon-close {
  border: none; background: none; color: var(--muted);
  font-size: 1rem; cursor: pointer; padding: .2rem .4rem; border-radius: 6px;
}
.icon-close:hover { color: var(--text); background: var(--card); }
#checkoutFrame {
  width: 100%; height: min(58vh, 560px);
  border: 1px solid var(--border); border-radius: 10px;
  margin-top: .6rem; background: #fff;
}
.modal.checkout-modal { width: min(94vw, 480px); }
.topup-packs { grid-template-columns: repeat(7, 1fr); gap: .4rem; margin: .7rem 0 0; }
.pack-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
@media (max-width: 520px) { .topup-packs { grid-template-columns: repeat(4, 1fr); } }
