/*
 * Panel görünümü — tasarım yenilemesi (K38): kurumsal, sade, satır tabanlı.
 *
 * Tek dosya, satır içi stil YOK (katı CSP: `style-src 'self'`).
 * Mobil önce: kullanıcı bu ekrana WhatsApp'tan geliyor, yani telefondan.
 * Açık/koyu tema `prefers-color-scheme` ile; ayrı bir tema düğmesi v1'de yok.
 *
 * Kararlar (Bakhish, 23.08): sistem font yığını · WhatsApp yeşili tek vurgu,
 * nötrler kurumsal · Todoist tarzı satır listesi · satır içi SVG ikon seti.
 * Rozet paleti bilinçli SADELEŞTİ: yalnızca "Gecikib" kırmızı, "Bu gün" vurgu
 * renginde, kalan tarihler nötr — dört pastel hap kaldırıldı.
 *
 * ⚠️ Açık tema `--bg` değeri `manifest.webmanifest` `background_color` ile,
 * koyu tema `--surface` değeri `index.html`deki koyu `theme-color` ile AYNI
 * kalmalı (#f6f7f9 / #1c222b). Değiştirirsen ikisini de değiştir.
 */

/* ---------------------------------- belirteçler ---------------------------- */

:root {
  color-scheme: light dark;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e2e5ea;
  --divider: #eceef2;
  --row-hover: #f4f6f8;
  --inset-bg: #f6f7f9;
  --seg-bg: #eceff3;

  --text: #1b2430;
  --muted: #5d6b7c;

  --accent: #128c7e; /* WhatsApp yeşili — kullanıcı oradan geliyor */
  --accent-hover: #0f7c70;
  --accent-text: #ffffff;

  --danger: #b3261e;
  --danger-soft: #fbedec;
  --danger-border: #f3d3d1;

  --info-ink: #0c5f55;
  --info-soft: #e8f4f2;
  --info-border: #cfe7e3;

  --check-border: #b9c2cc;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);

  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181f;
    --surface: #1c222b;
    --border: #2b333f;
    --divider: #252d38;
    --row-hover: #212934;
    --inset-bg: #171d25;
    --seg-bg: #232a34;

    --text: #e8ecf2;
    --muted: #96a2b2;

    --accent: #25d366;
    --accent-hover: #1fbf5b;
    --accent-text: #0a1510;

    --danger: #ff9a9f;
    --danger-soft: #392225;
    --danger-border: #4a2b30;

    --info-ink: #7fd8c9;
    --info-soft: #1c2f2b;
    --info-border: #2d453f;

    --check-border: #46515f;
    --shadow: none;
  }
}

/* ------------------------------------ taban -------------------------------- */

* {
  box-sizing: border-box;
}

/* `hidden` niteliği her `display` kuralını yenmeli: `titleAlert.hidden` ve
   `charsLeft.hidden` buna güveniyor (display:flex onu sessizce ezerdi). */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px calc(32px + env(safe-area-inset-bottom));
}

.icon {
  display: block;
  flex: none;
}

/* ---------------------------------- tipografi ------------------------------ */

.title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.title-sm {
  margin: 0 0 4px;
  font-size: 15.5px;
  font-weight: 600;
}

.body {
  margin: 0 0 12px;
  font-size: 14.5px;
}

.label {
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.count {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.list-note {
  margin: 4px 0 12px;
  padding: 6px 2px;
  font-size: 13.5px;
}

/* ---------------------------------- düğmeler ------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  /* Dokunma hedefi 44px'in altına düşmesin. */
  min-height: 44px;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.btn:hover {
  background: var(--row-hover);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
}

.btn-ghost:hover {
  background: var(--row-hover);
}

.btn-small {
  padding: 8px 14px;
  font-size: 13.5px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn:disabled:hover {
  background: var(--surface);
}

.btn-primary:disabled:hover {
  background: var(--accent);
}

/* Üst çubuk eylemleri: ikon + (geniş ekranda) etiket. */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}

.btn-icon:hover {
  background: var(--row-hover);
  color: var(--text);
}

/* ---------------------------------- üst çubuk ------------------------------ */

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -16px;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
}

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-text);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-user {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appbar-actions {
  display: flex;
  gap: 2px;
  flex: none;
}

/* ------------------------------ sekmeler ve filtre ------------------------- */

.tabs {
  display: flex;
  gap: 4px;
  margin: 6px 0 12px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 9px 12px;
  min-height: 40px;
  margin-bottom: -1px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.12s ease;
}

.tab:hover {
  color: var(--text);
}

.tab-active {
  color: var(--text);
  font-weight: 650;
  border-bottom-color: var(--accent);
  cursor: default;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

/* Yalnızca ekran okuyucular için: görünmez ama belge yapısında duran başlık. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--seg-bg);
}

.seg-btn {
  min-height: 40px;
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}

.seg-active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow);
  cursor: default;
}

/* ---------------------------------- uyarılar ------------------------------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--danger-border);
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
}

.alert .icon {
  margin-top: 1px;
}

.alert-info {
  border-color: var(--info-border);
  background: var(--info-soft);
  color: var(--info-ink);
}

.retry-row {
  margin-top: 4px;
}

/* -------------------------------- görev listesi ---------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tasks {
  list-style: none;
  margin: 0;
  padding: 0;
}

.task + .task {
  border-top: 1px solid var(--divider);
}

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px 10px 8px;
  cursor: pointer;
  list-style: none;
  transition: background-color 0.12s ease;
}

.task-row::-webkit-details-marker {
  display: none;
}

.task-row::marker {
  content: '';
}

@media (hover: hover) {
  .task-row:hover {
    background: var(--row-hover);
  }
}

.task-row-static {
  cursor: default;
}

.task-main {
  flex: 1;
  min-width: 0;
  padding-top: 10px;
}

.task-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  /* Görev başlığı kullanıcı metnidir: uzun bir kelime kutuyu taşırmasın. */
  overflow-wrap: anywhere;
}

.task-done .task-title {
  /* Üstü çizili metin mobilde okumayı zorlaştırdığı için kullanılmadı. */
  color: var(--muted);
}

.task-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.sub-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.sub-item .icon {
  opacity: 0.85;
}

.sub-item span {
  overflow-wrap: anywhere;
}

/* Son tarih tonları — sade: yalnızca gecikme kırmızı, bugün vurgu renginde. */
.due-overdue {
  color: var(--danger);
  font-weight: 600;
}

.due-today {
  color: var(--accent);
  font-weight: 600;
}

/* Reply-təklif rozeti (F9): qrupdan "hazırdır" cavabı gelen açık görev. */
.sub-suggest {
  color: var(--info-ink);
  font-weight: 600;
  padding: 1px 8px;
  border: 1px solid var(--info-border);
  border-radius: 999px;
  background: var(--info-soft);
}

/* `due-tomorrow`, `due-later`, `due-none` nötr kalır (miras: --muted). */

/* Açılma oku. */
.task-row > .icon:last-child {
  align-self: center;
  color: var(--muted);
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.task-disc[open] > .task-row > .icon:last-child {
  transform: rotate(180deg);
}

/* --------------------------------- bitti çemberi --------------------------- */

.check {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: none;
  background: none;
  color: transparent;
  cursor: pointer;
}

.check::before {
  content: '';
  grid-area: 1 / 1;
  width: 22px;
  height: 22px;
  border: 1.8px solid var(--check-border);
  border-radius: 50%;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease;
}

.check .icon {
  grid-area: 1 / 1;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.12s ease;
}

@media (hover: hover) {
  .check:hover::before {
    border-color: var(--accent);
  }

  .check:hover .icon {
    opacity: 0.6;
    color: var(--accent);
  }
}

.check-done::before {
  background: var(--accent);
  border-color: var(--accent);
}

.check-done .icon {
  opacity: 1;
  color: var(--accent-text);
}

@media (hover: hover) {
  .check-done:hover .icon {
    color: var(--accent-text);
  }
}

/* İstek uçuşta: halka döner, satır sunucu onaylayana kadar DEĞİŞMEZ (K35). */
.check-pending {
  cursor: default;
}

.check-pending::before {
  border-color: var(--divider);
  border-top-color: var(--accent);
  animation: check-spin 0.8s linear infinite;
}

@keyframes check-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Düzeltme kipinde çemberin yerini tutan kalem. */
.check-ghost {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  color: var(--muted);
}

.check-ghost::before {
  content: '';
  grid-area: 1 / 1;
  width: 22px;
  height: 22px;
  border: 1.8px dashed var(--check-border);
  border-radius: 50%;
}

.check-ghost .icon {
  grid-area: 1 / 1;
  z-index: 1;
  width: 12px;
  height: 12px;
}

/* ---------------------------------- ayrıntı -------------------------------- */

.task-detail {
  padding: 2px 14px 14px 62px;
}

.meta {
  display: grid;
  gap: 7px;
  margin: 8px 0 0;
  font-size: 13.5px;
}

.meta-row {
  display: flex;
  gap: 10px;
}

.meta-term {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-width: 118px;
  color: var(--muted);
}

.meta-term .icon {
  opacity: 0.8;
}

.meta-value {
  margin: 0;
  overflow-wrap: anywhere;
}

.files {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  font-size: 13.5px;
}

.files-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 118px;
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition:
    border-color 0.12s ease,
    color 0.12s ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chip-muted {
  border-style: dashed;
  color: var(--muted);
  font-weight: 400;
}

.transcript {
  margin-top: 12px;
  font-size: 13.5px;
}

.transcript summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.transcript summary::-webkit-details-marker {
  display: none;
}

.transcript summary::marker {
  content: '';
}

.transcript summary:hover {
  color: var(--text);
}

.transcript-body {
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--inset-bg);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* ---------------------------- düzeltme (dilim 4) --------------------------- */

.task-editing {
  background: var(--row-hover);
}

.task-editing .task-detail {
  padding-top: 0;
}

.edit {
  margin-top: 10px;
  padding-top: 2px;
  border-top: 1px solid var(--divider);
}

.field {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  /* iOS'ta 16px'in altındaki alanlar odaklanınca sayfayı yakınlaştırır. */
  font-size: 16px;
}

.field-multiline {
  resize: vertical;
  min-height: 130px;
  line-height: 1.5;
}

.field:disabled {
  opacity: 0.6;
}

.edit .alert {
  margin: 8px 0 0;
}

.chars-left {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------------------------------- boş ekran ------------------------------ */

.empty {
  padding: 44px 20px;
  text-align: center;
}

.empty-icon {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--accent);
  opacity: 0.85;
}

.empty .body {
  margin-bottom: 0;
  font-size: 13.5px;
}

/* ------------------------------------ giriş -------------------------------- */

.auth-wrap {
  display: flex;
  justify-content: center;
  padding-top: 7vh;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-top: 24px;
}

.auth {
  width: 100%;
  max-width: 400px;
  margin-top: 0;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.nonce {
  margin: 0 0 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 0.16em;
  /* Kullanıcı bunu ekrandan okuyup elle yazabilmeli. */
  user-select: all;
}

.countdown {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.auth .btn-block {
  margin-bottom: 14px;
}

.jid {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--inset-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  word-break: break-all;
  user-select: all;
}

/* ------------------- v1.2: qrup şeridi + yan sütun + grup ------------------ */

/* Qrup düğmeleri: yatay şerit, taşarsa kaydırılır (telefonda doğal jest). */
.groups {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.groups::-webkit-scrollbar {
  display: none;
}

.f-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  min-height: 36px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.f-chip:hover {
  border-color: var(--accent);
}

.f-chip-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.f-count {
  padding: 0 7px;
  border-radius: 999px;
  background: var(--seg-bg);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.f-chip-active .f-count {
  background: rgba(255, 255, 255, 0.22);
  color: var(--accent-text);
}

/* Yan sütun: telefonda ÜSTTE yatay şerit — aynı DOM, yerleşim CSS'ten. */
.side {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.side::-webkit-scrollbar {
  display: none;
}

.side-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* Başlıklar dar ekranda gizli: şeritte çipler kendi adını taşıyor. */
.side-heading {
  display: none;
}

.side-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  min-height: 36px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.side-option:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* Seçenek çipinin tiki yalnızca SEÇİLİYKEN görünür. */
.side-option .icon {
  display: none;
}

.side-option-active,
.side-overdue-active {
  color: var(--text);
  font-weight: 600;
  border-color: var(--accent);
}

.side-option-active .icon {
  display: block;
  color: var(--accent);
}

/* Gecikənlər açıkken tehlike tonunda: filtre "kırmızı" işleri gösteriyor. */
.side-overdue-active {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.side-overdue-active .icon {
  display: block;
  color: var(--danger);
}

.side-select {
  flex: none;
  min-height: 36px;
  max-width: 230px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.side-select-active {
  color: var(--text);
  font-weight: 600;
  border-color: var(--accent);
}

/* Geniş ekran: yan sütun SOLA geçer, dikey olur, içerik sağda (K44). */
@media (min-width: 880px) {
  .app {
    max-width: 980px;
  }

  .layout {
    display: grid;
    grid-template-columns: 216px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }

  .side {
    display: block;
    position: sticky;
    top: 63px;
    /* SIRALAMA başlığı sekme çizgisine yapışmasın (Bakhish, 23.08 gece):
       sağdaki araç çubuğuyla aynı görsel hizada başlar. */
    margin: 18px 0 0;
    overflow: visible;
  }

  .side-section {
    display: block;
  }

  .side-section + .side-section {
    margin-top: 18px;
  }

  .side-heading {
    display: block;
    margin: 0 0 6px;
    padding-left: 11px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
  }

  .side-option {
    display: flex;
    width: 100%;
    border: none;
    border-radius: 9px;
    background: none;
    padding: 8px 11px;
    text-align: left;
  }

  .side-option:hover {
    background: var(--row-hover);
  }

  .side-option-active {
    background: var(--seg-bg);
  }

  .side-overdue-active {
    background: var(--danger-soft);
  }

  .side-option + .side-option,
  .side-select + .side-option {
    margin-top: 2px;
  }

  .side-select {
    display: block;
    width: 100%;
    max-width: none;
    border-radius: 9px;
    margin-bottom: 2px;
  }
}

/* Hərkəsə grubu (K43): çemberin yerinde üye rozeti. */
.fan-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  color: var(--muted);
}

.fan-mark::before {
  content: '';
  grid-area: 1 / 1;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--seg-bg);
}

.fan-mark .icon {
  grid-area: 1 / 1;
  z-index: 1;
}

.fan-progress {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.fan-progress-full {
  color: var(--accent);
}

/* Üye listesi: grubun asıl gövdesi — kişi kişi çember. */
.fan-members {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.fan-member {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: -8px;
}

.fan-member + .fan-member {
  border-top: 1px solid var(--divider);
}

.fan-member-main {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  flex-wrap: wrap;
  padding: 8px 0;
}

.fan-name {
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.fan-member-done .fan-name {
  color: var(--muted);
}

.fan-member-sub {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.empty-icon-muted {
  color: var(--muted);
  opacity: 0.6;
}

.clear-row {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

/* --------------------- v1.3: panelden oluşturma (F10) ---------------------- */

/* Telefonda sağ-alt yuvarlak düğme; geniş ekranda sol-alt hap (aşağıda). */
.new-task-btn {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.24);
  transition: background-color 0.12s ease;
}

.new-task-btn:hover {
  background: var(--accent-hover);
}

.new-task-btn .btn-label {
  display: none;
}

/* Liste, sabit düğmenin altında bitmesin. */
.screen {
  padding-bottom: 76px;
}

@media (min-width: 880px) {
  .new-task-btn {
    /* Sol-alt köşe (Bakhish, 23.08): içerik sütununun sol kenarına hizalı —
       tam viewport köşesi geniş ekranda içerikten kopuk dururdu. */
    right: auto;
    left: max(18px, calc(50% - 490px));
    width: auto;
    height: 48px;
    padding: 0 18px 0 14px;
    border-radius: 999px;
  }

  .new-task-btn .btn-label {
    display: inline;
  }
}

/* Pəncərə: yerli <dialog> — katı CSP altında da çalışır, odak yönetimi doğal. */
dialog.create {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  margin: auto;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 18px 50px rgba(10, 15, 22, 0.3);
}

dialog.create::backdrop {
  background: rgba(12, 17, 24, 0.45);
}

.create-title {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.create-hint {
  margin: -2px 0 8px;
  font-size: 12.5px;
}

.create-people {
  display: grid;
  gap: 6px;
}

.create-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.create-person:hover {
  background: var(--row-hover);
}

.create-person input {
  width: 17px;
  height: 17px;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}

.create-person-name {
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.create-note {
  margin: 2px 0;
  font-size: 13px;
}

dialog.create .alert {
  margin: 12px 0 0;
}

dialog.create .task-actions {
  margin-top: 16px;
}

/* ------------------------ WhatsApp bağlantısı (ADR-0022) ------------------------ */

.wa-panel .title {
  margin-bottom: 10px;
}

.wa-panel .alert {
  margin: 0 0 12px;
}

.wa-qr {
  display: block;
  width: 216px;
  height: 216px;
  margin: 4px auto 12px;
  /* A light border (the "quiet zone") is what lets a phone find the code, and
     the code must stay dark-on-white in dark mode too, or it will not scan. */
  padding: 8px;
  background: #ffffff;
  border-radius: 8px;
  /* Keeps the module edges sharp when the image is scaled. */
  image-rendering: pixelated;
}

/* The logged-in box. `absolute` at every width (decision, 21.09): on narrow
   screens it covers part of the page. No ancestor is positioned, so it
   anchors to the page's top-right corner. */
.wa-corner {
  position: absolute;
  top: 16px;
  right: 16px;
  /* Above the sticky app bar (20) and the new-task button (30). */
  z-index: 40;
  width: 272px;
  /* Never wider than a phone screen, so it causes no sideways scroll. */
  max-width: calc(100vw - 32px);
  margin-top: 0;
  padding: 18px;
  box-shadow: 0 18px 50px rgba(10, 15, 22, 0.3);
}

.wa-corner .title {
  font-size: 16px;
}

.wa-corner .body {
  font-size: 13.5px;
}

/* ----------------------------------- odak ---------------------------------- */

.btn:focus-visible,
.btn-icon:focus-visible,
.tab:focus-visible,
.seg-btn:focus-visible,
.check:focus-visible,
.chip:focus-visible,
.f-chip:focus-visible,
.side-option:focus-visible,
.side-select:focus-visible,
.new-task-btn:focus-visible,
.create-person input:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* --------------------------------- dar ekran ------------------------------- */

@media (max-width: 479px) {
  /* Yalnızca üst çubuk eylemleri ikona iner; Düzəlt gibi içerik düğmeleri
     etiketini HER genişlikte korur. */
  .btn-icon .btn-label {
    display: none;
  }

  .task-detail {
    padding-left: 16px;
  }

  .meta-term,
  .files-label {
    min-width: 104px;
  }
}

/* ------------------------------- hareket azaltma --------------------------- */

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