/* ==========================================================================
   Sayfa bileşenleri: gösterge şeridi, proje başlığı, ekip ağacı, listeler
   ========================================================================== */

/* ---------- Gösterge şeridi (KPI) ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.kpi {
  position: relative;
  padding: 18px 20px 18px;
  min-width: 0;
  text-decoration: none !important;
  color: inherit;
}
.kpi + .kpi {
  border-left: 1px solid var(--line);
}
a.kpi:hover {
  background: var(--surface-hover);
}
.kpi-label {
  font-size: 12.5px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-value {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  font-variation-settings: "opsz" 144;
}
.kpi-foot {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.kpi-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

/* ---------- Proje küçük görseli ---------- */
.thumb {
  flex: none;
  width: 52px;
  height: 40px;
  border-radius: 5px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-lg {
  width: 72px;
  height: 56px;
  border-radius: 8px;
}
.project-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}
.project-cell a {
  color: var(--text);
  font-weight: 500;
}
.mini-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}
.mini-progress .progress {
  flex: 1;
}

/* ---------- Etkinlik akışı ---------- */
.feed {
  padding: 6px 0;
}
.feed-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 20px;
}
.feed-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.feed-text {
  font-size: 13.5px;
  line-height: 1.45;
}
.feed-text strong {
  font-weight: 600;
}
.feed-time {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
}

/* ---------- Proje detay başlığı (yönetim) ---------- */
.detail-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.detail-head .grow {
  min-width: 220px;
}
.detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.trash-banner {
  margin-bottom: 20px;
}

/* Bilgi listesi */
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.fact {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.fact:nth-child(odd) {
  border-right: 1px solid var(--line);
}
.fact dt {
  font-size: 12px;
  color: var(--text-3);
}
.fact dd {
  margin: 4px 0 0;
  font-size: 14.5px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* Tehlikeli işlemler */
.danger-zone {
  border-color: var(--red-100);
}
.danger-zone .panel-head {
  border-bottom-color: var(--red-100);
}
.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  flex-wrap: wrap;
}
.danger-row + .danger-row {
  border-top: 1px solid var(--line);
}
.danger-row p {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
  max-width: 60ch;
}

/* Durum seçici kartları */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.choice {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.choice:hover {
  border-color: #b4ab96;
}
.choice input {
  position: absolute;
  opacity: 0;
}
.choice-radio {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.choice input:checked ~ .choice-radio {
  border-color: var(--green-600);
}
.choice input:checked ~ .choice-radio::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-600);
}
.choice:has(input:checked) {
  border-color: var(--green-600);
  background: var(--green-50);
  box-shadow: inset 0 0 0 1px var(--green-600);
}
.choice:has(input:focus-visible) {
  box-shadow: var(--focus-ring);
}
.choice-title {
  font-size: 14px;
  font-weight: 600;
}
.choice-desc {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.45;
}

/* Kapak görseli yükleme */
.cover-edit {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.cover-preview {
  width: 200px;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  border: 1px dashed var(--line-strong);
  background: var(--surface-sunken);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Proje görsel galerisi (proje sayfası) ---------- */
.gallery {
  margin-bottom: 16px;
  outline: none;
}
.gallery:focus-visible .gallery-stage {
  box-shadow: 0 0 0 3px var(--green-100);
}
.gallery-stage {
  position: relative;
  height: clamp(220px, 34vw, 440px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--ink-900);
  isolation: isolate;
}
.gallery-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar {
  display: none;
}
.gallery-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.gallery-backdrop {
  position: absolute;
  inset: -90px;
  width: calc(100% + 180px);
  max-width: none;
  height: calc(100% + 180px);
  object-fit: cover;
  filter: blur(28px) saturate(1.1) brightness(0.55);
  z-index: 0;
}
.gallery-open {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}
.gallery-nav,
.gallery-expand {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(243, 241, 234, 0.92);
  color: var(--ink-900);
  box-shadow: 0 4px 14px rgba(11, 20, 17, 0.25);
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.gallery-nav {
  top: 50%;
  width: 40px;
  height: 40px;
  margin-top: -20px;
}
.gallery-nav.is-prev {
  left: 14px;
}
.gallery-nav.is-next {
  right: 14px;
}
.gallery-expand {
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
}
.gallery-nav:hover,
.gallery-expand:hover {
  background: #fff;
  transform: scale(1.05);
}
.gallery-nav:focus-visible,
.gallery-expand:focus-visible,
.gallery-open:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: -4px;
}
@media (hover: hover) {
  .gallery-nav,
  .gallery-expand {
    opacity: 0;
  }
  .gallery-stage:hover .gallery-nav,
  .gallery-stage:hover .gallery-expand,
  .gallery-nav:focus-visible,
  .gallery-expand:focus-visible {
    opacity: 1;
  }
}
.gallery-counter {
  position: absolute;
  z-index: 2;
  left: 12px;
  bottom: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(11, 20, 17, 0.62);
  color: var(--text-inverse);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.gallery-thumbs {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.gallery-thumb {
  flex: none;
  width: 76px;
  height: 52px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 7px;
  overflow: hidden;
  background: var(--paper-2);
  cursor: pointer;
  opacity: 0.62;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-thumb:hover {
  opacity: 0.9;
}
.gallery-thumb.is-active {
  opacity: 1;
  border-color: var(--green-600);
}
.gallery-thumb:focus-visible {
  outline: 2px solid var(--green-600);
  outline-offset: 2px;
}
@media (max-width: 720px) {
  .gallery-stage {
    height: 62vw;
    min-height: 200px;
    border-radius: var(--radius-lg);
  }
  .gallery-thumb {
    width: 60px;
    height: 42px;
  }
}

/* Tam ekran görsel */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(8, 14, 12, 0.94);
  color: var(--text-inverse);
  overflow: hidden;
}
.lightbox::backdrop {
  background: rgba(8, 14, 12, 0.6);
}
.lightbox[open] {
  display: grid;
  grid-template-rows: auto 1fr;
  animation: lightbox-in 0.18s ease;
}
@keyframes lightbox-in {
  from {
    opacity: 0;
  }
}
.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 0 20px;
}
.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-300);
}
.lightbox-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 12px 72px 28px;
}
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
}
.lightbox-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(243, 241, 234, 0.1);
  color: var(--text-inverse);
  cursor: pointer;
}
.lightbox-btn:hover {
  background: rgba(243, 241, 234, 0.2);
}
.lightbox-btn:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 2px;
}
.lightbox-nav {
  position: fixed;
  top: 50%;
  width: 48px;
  height: 48px;
  margin-top: -24px;
}
.lightbox-nav.is-prev {
  left: 14px;
}
.lightbox-nav.is-next {
  right: 14px;
}
@media (max-width: 720px) {
  .lightbox-stage {
    padding: 12px 8px 76px;
  }
  .lightbox-nav {
    top: auto;
    bottom: 16px;
    margin-top: 0;
  }
  .lightbox-nav.is-prev {
    left: calc(50% - 58px);
  }
  .lightbox-nav.is-next {
    right: calc(50% - 58px);
  }
}

/* ---------- Yönetici: proje görselleri düzenleme ---------- */
.gallery-edit-panel {
  position: relative;
  transition: box-shadow 0.15s ease;
}
.gallery-edit-panel.is-dragover {
  box-shadow: 0 0 0 2px var(--green-500), var(--shadow-2);
}
.gallery-edit-panel.is-busy .gallery-edit {
  opacity: 0.7;
}
.gallery-edit-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}
.gallery-edit {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: opacity 0.15s ease;
}
.gallery-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  overflow: hidden;
}
.gallery-tile.is-cover {
  border-color: var(--green-600);
  box-shadow: 0 0 0 1px var(--green-600);
}
.gallery-tile-img {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--paper-2);
  cursor: zoom-in;
}
.gallery-tile-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-tile-no {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(11, 20, 17, 0.66);
  color: var(--text-inverse);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  pointer-events: none;
}
.gallery-tile.is-cover .gallery-tile-no {
  background: var(--green-600);
}
.gallery-tile-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-top: 1px solid var(--line);
}
.gallery-tile-bar .is-danger {
  color: var(--red-700);
}
.gallery-tile-bar .is-danger:hover:not(:disabled) {
  background: var(--red-50);
  color: var(--red-700);
}
.gallery-tile.is-add {
  border-style: dashed;
  border-color: var(--line-strong);
  background: var(--surface-sunken);
}
.gallery-add {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 150px;
  padding: 16px;
  border: 0;
  background: none;
  color: var(--text-2);
  font: inherit;
  text-align: center;
  cursor: pointer;
}
.gallery-add:hover:not(:disabled) {
  color: var(--green-700);
  background: var(--green-50);
}
.gallery-add:disabled {
  cursor: progress;
}
.gallery-add-title {
  font-weight: 500;
}
.gallery-tile.is-empty {
  grid-column: 1 / -1;
}
.gallery-tile.is-empty .gallery-add {
  min-height: 180px;
}
@media (max-width: 720px) {
  .gallery-edit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .gallery-tile-bar .btn-sm:not(.btn-icon) {
    padding: 0 6px;
    font-size: 12px;
  }
  .gallery-edit-panel .panel-head {
    flex-wrap: wrap;
  }
}

/* ---------- Üye: proje listesi ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  color: inherit;
  text-decoration: none !important;
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.18s var(--ease), border-color 0.18s, transform 0.18s var(--ease);
}
a.project-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.project-card.is-locked {
  opacity: 0.82;
}
.project-card.is-locked .project-card-cover img {
  filter: grayscale(0.85);
}
.project-card-cover {
  position: relative;
  aspect-ratio: 16 / 8;
  background: var(--ink-900);
  overflow: hidden;
}
.project-card-cover img,
.project-card-cover svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-card-cover .badge {
  position: absolute;
  top: 12px;
  left: 12px;
}
.project-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.project-card-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.2;
  font-variation-settings: "opsz" 60;
}
.project-card-loc {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-3);
}
.project-card-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
}
.project-card-stats strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---------- Üye: proje sayfası ---------- */
.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}
.project-hero .page-title {
  font-size: 36px;
}
.land {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 1.2fr 1.3fr;
  background: var(--ink-900);
  color: var(--text-inverse);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.land-cell {
  padding: 18px 22px 20px;
  min-width: 0;
}
.land-cell + .land-cell {
  border-left: 1px solid var(--ink-700);
}
.land-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-400);
}
.land-value {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.land-value.is-price {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  color: var(--leaf);
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
  font-variant-numeric: lining-nums;
}
.land-value small {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-300);
  font-weight: 400;
}
.shares {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 22px;
  border-top: 1px solid var(--ink-700);
  grid-column: 1 / -1;
}
.shares-count {
  flex: none;
  font-size: 13px;
  color: var(--ink-300);
}
.shares-count strong {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: #fff;
  font-variant-numeric: tabular-nums lining-nums;
}
.shares .progress {
  flex: 1;
  background: var(--ink-700);
}
.shares .progress-fill {
  background: var(--leaf);
}
.shares .progress-target {
  background: #f2b38f;
}
.shares-target {
  flex: none;
  font-size: 12.5px;
  color: var(--ink-300);
}

.member-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}
.side-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.me-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.me-row:last-child {
  border-bottom: 0;
}
.me-row dt {
  color: var(--text-3);
}
.me-row dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

/* ---------- Ekip ağacı ---------- */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.state-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--state-ring, transparent);
}
.state-invited {
  --state: #c8372b;
  --state-bg: var(--red-50);
  --state-ring: var(--red-100);
}
.state-verified {
  --state: #c98a14;
  --state-bg: var(--amber-50);
  --state-ring: var(--amber-100);
}
.state-growing {
  --state: #1f8a4f;
  --state-bg: var(--green-50);
  --state-ring: var(--green-100);
}
.state-exit_requested {
  --state: #c2367b;
  --state-bg: var(--pink-50);
  --state-ring: var(--pink-100);
}
.state-exited {
  --state: #8b928d;
  --state-bg: var(--slate-50);
  --state-ring: var(--slate-100);
}
.state-suspended {
  --state: #5b6a8a;
  --state-bg: var(--blue-50);
  --state-ring: var(--blue-100);
}
.state-dot {
  background: var(--state);
}
.tree {
  padding: 10px 12px 14px;
}
.tree-children {
  position: relative;
  margin-left: 21px;
  padding-left: 14px;
  border-left: 1px dashed var(--line-strong);
}
.node {
  position: relative;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--state);
  border-radius: 8px;
  background: var(--surface);
  transition: background-color 0.12s, border-color 0.12s;
}
.tree-children > .tree-branch > .node::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 22px;
  width: 15px;
  border-top: 1px dashed var(--line-strong);
}
.node:hover {
  background: var(--surface-hover);
}
.node.state-exited {
  background: var(--surface-sunken);
}
.node.state-exited .node-name {
  color: var(--text-3);
}
.node.is-self {
  background: var(--amber-50);
  box-shadow: 0 0 0 1px var(--amber-500) inset;
}
.node.is-masked .node-name > span:first-child {
  letter-spacing: 0.02em;
}
.node-you,
.node-referrer {
  align-self: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
.node-you {
  background: var(--amber-500);
  color: #fff;
}
.node-referrer {
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid var(--blue-100);
}
.node.is-referrer {
  background: var(--surface-sunken);
}
.node-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-width: 0;
}
.node-toggle {
  flex: none;
  min-width: 44px;
  height: 32px;
  padding: 0 8px 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--green-100);
  border-radius: 8px;
  background: var(--green-50);
  color: var(--green-700);
  font: 600 13px/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.node-toggle svg {
  transition: transform 0.15s var(--ease);
}
.node-toggle:hover {
  background: var(--green-100);
  border-color: var(--green-600);
}
.node-toggle.is-open {
  background: var(--green-700);
  border-color: var(--green-700);
  color: var(--text-inverse);
}
.node-toggle.is-open:hover {
  background: var(--green-800);
}
.node-toggle.is-open svg {
  transform: rotate(90deg);
}
.node-toggle.is-leaf {
  visibility: hidden;
}
.node-id {
  flex: 1;
  min-width: 0;
}
.node-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 600;
}
.node-phone {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
}
.node-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-2);
}
.node-sub .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}
/* Onur puanı seviye rozeti (ağaç düğümü ve yönetici tablosu) */
.level {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--slate-50);
  box-shadow: inset 0 0 0 1px var(--slate-100);
  color: var(--slate-700);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.level b {
  font-weight: 600;
}
.level-kasif {
  background: var(--clay-50);
  box-shadow: inset 0 0 0 1px var(--clay-100);
  color: var(--clay-700);
}
.level-elci {
  background: var(--blue-50);
  box-shadow: inset 0 0 0 1px var(--blue-100);
  color: var(--blue-700);
}
.level-rehber {
  background: var(--amber-50);
  box-shadow: inset 0 0 0 1px var(--amber-100);
  color: var(--amber-700);
}
.level-oncu {
  background: var(--green-50);
  box-shadow: inset 0 0 0 1px var(--green-100);
  color: var(--green-800);
}
.node-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 12px 10px 46px;
  margin-top: -2px;
}
.deposit-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}
.deposit-state.is-paid {
  color: var(--green-700);
}
.tree-root {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px 4px;
  font-size: 12.5px;
  color: var(--text-3);
}
.tree-root svg {
  color: var(--amber-500);
}

/* ---------- Slider yönetimi ---------- */
.slides-list {
  display: flex;
  flex-direction: column;
}
.slide-row {
  display: grid;
  grid-template-columns: 28px 168px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: background-color 0.12s, box-shadow 0.12s;
}
.slide-row:last-child {
  border-bottom: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.slide-row.is-dragging {
  opacity: 0.5;
}
.slide-row.is-drop-target {
  box-shadow: inset 0 2px 0 var(--green-600);
}
.slide-row.is-inactive .slide-thumb {
  filter: grayscale(1);
  opacity: 0.6;
}
.drag-handle {
  display: grid;
  place-items: center;
  width: 28px;
  height: 36px;
  border: 0;
  background: none;
  color: var(--text-3);
  cursor: grab;
  border-radius: 4px;
}
.drag-handle:hover {
  background: var(--paper-2);
}
.slide-thumb {
  width: 168px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--ink-900);
  border: 1px solid var(--line);
}
.slide-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.order-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ---------- Duyuru yönetimi ---------- */
.ann-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.ann-row:last-child {
  border-bottom: 0;
}
.ann-row.is-important {
  box-shadow: inset 3px 0 0 var(--clay-600);
}
.ann-row h3 {
  font-size: 14.5px;
  font-weight: 600;
}
.ann-row p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}

/* ---------- Duyarlı ---------- */
@media (max-width: 1180px) {
  .kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .kpi:nth-child(4) {
    border-left: 0;
  }
  .kpi:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }
  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .member-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .land {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .land-cell:nth-child(3) {
    border-left: 0;
  }
  .land-cell:nth-child(n + 3) {
    border-top: 1px solid var(--ink-700);
  }
}

@media (max-width: 720px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi {
    padding: 14px 16px;
  }
  .kpi:nth-child(odd) {
    border-left: 0;
  }
  .kpi:nth-child(4) {
    border-left: 1px solid var(--line);
  }
  .kpi:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .kpi-value {
    font-size: 26px;
  }
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .fact:nth-child(odd) {
    border-right: 0;
  }
  .choice-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .project-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .project-hero .page-title {
    font-size: 28px;
  }
  .land-cell {
    padding: 14px 16px;
  }
  .land-value.is-price {
    font-size: 24px;
  }
  .shares {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 16px;
  }
  .shares .progress {
    flex-basis: 100%;
    order: 3;
  }
  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .slide-row {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 16px;
  }
  .slide-row .drag-handle {
    display: none;
  }
  .slide-thumb {
    width: 96px;
  }
  .slide-row .slide-actions {
    grid-column: 1 / -1;
  }
  .ann-row {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 16px;
  }
  .tree {
    padding: 8px 8px 12px;
  }
  .tree-children {
    margin-left: 10px;
    padding-left: 10px;
  }
  .tree-children > .tree-branch > .node::before {
    left: -11px;
    width: 9px;
  }
  .node-main {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px 8px;
    padding: 10px;
  }
  .node-id {
    flex-basis: calc(100% - 34px);
  }
  .node-sub {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .node-sub .sep {
    display: none;
  }
  .node-phone {
    flex-basis: 100%;
  }
  .level {
    height: 22px;
    margin-left: 32px;
    font-size: 11px;
  }
  .node-actions {
    padding-left: 42px;
  }

  /* Tablolar mobilde kart düzenine dönüşür */
  .table-cards thead {
    display: none;
  }
  .table-cards,
  .table-cards tbody,
  .table-cards tr,
  .table-cards td {
    display: block;
    width: 100%;
  }
  .table-cards tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }
  .table-cards tbody tr:last-child {
    border-bottom: 0;
  }
  .table-cards td {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 12px;
    justify-items: end;
    align-items: center;
    padding: 5px 0;
    border: 0;
    text-align: right;
  }
  .table-cards td::before {
    content: attr(data-label);
    grid-column: 1;
    grid-row: 1 / span 3;
    justify-self: start;
    align-self: start;
    padding-top: 1px;
    font-size: 12px;
    color: var(--text-3);
    text-align: left;
  }
  .table-cards td > * {
    grid-column: 2;
    max-width: 100%;
  }
  .table-cards td.cell-primary {
    display: block;
    justify-items: start;
    text-align: left;
    padding-bottom: 8px;
  }
  .table-cards td.cell-primary::before {
    display: none;
  }
  .table-cards td.col-actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    padding-top: 8px;
  }
  .table-cards td.col-actions:empty {
    display: none;
  }
  .table-cards td.col-actions::before {
    display: none;
  }
  .table-cards .project-cell {
    min-width: 0;
  }
  .table-cards .mini-progress {
    min-width: 0;
    width: 60%;
  }
}

/* ==========================================================================
   Duyuru hedef kitlesi, davet ekranı, KVKK, ana ekran
   ========================================================================== */

/* Tek sütunlu seçim kartları (dar pencerelerde) */
.choice-grid.choice-stack {
  grid-template-columns: minmax(0, 1fr);
}

/* Sayı alanları: rakamlar hizalı */
.input-num {
  font-variant-numeric: tabular-nums;
}

/* Dar alanlar için iki sütunlu arsa şeridi (davet kartı) */
.land.is-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.land.is-compact .land-cell {
  padding: 14px 16px;
}
.land.is-compact .land-cell:nth-child(3) {
  border-left: 0;
}
.land.is-compact .land-cell:nth-child(n + 3) {
  border-top: 1px solid var(--ink-700);
}
.land.is-compact .land-value.is-price {
  font-size: 24px;
}
.land.is-compact .shares {
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 14px 16px;
}
.land.is-compact .shares .progress {
  flex-basis: 100%;
  order: 3;
}

/* ---------- Davet ekranı: görseller ve arsa bilgileri ---------- */
.invite-card.is-wide {
  width: min(620px, 100%);
}
.invite-top {
  padding: 16px 20px;
  background: var(--ink-900);
  color: #fff;
}
.invite-gallery .gallery {
  margin: 0;
}
.invite-gallery .gallery-stage {
  border-radius: 0;
  height: clamp(220px, 52vw, 340px);
}
.invite-gallery .gallery-thumbs {
  padding: 10px 20px 0;
}
.invite-details {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.invite-desc {
  font-size: 14px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.invite-desc.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.invite-desc + .news-more {
  justify-self: start;
  margin-top: -8px;
}
@media (max-width: 720px) {
  .invite-gallery .gallery-stage {
    height: 62vw;
    min-height: 200px;
  }
  .invite-gallery .gallery-thumbs {
    padding: 10px 16px 0;
  }
}

/* ---------- KVKK bildirimi ve üye alt bilgisi ---------- */
.privacy-wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 40px 0;
}
.privacy-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-lg);
  background: var(--blue-50);
  color: var(--text);
  font-size: 13.5px;
}
.privacy-banner p {
  flex: 1;
  min-width: 0;
}
.privacy-banner-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--blue-700);
}
.member-foot {
  width: 100%;
  max-width: 1240px;
  margin: auto auto 0;
  padding: 18px 40px 28px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-3);
}
.member-foot a,
.auth-foot a {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
@media (max-width: 720px) {
  .privacy-wrap {
    padding: 16px 16px 0;
  }
  .privacy-banner {
    flex-wrap: wrap;
  }
  .privacy-banner p {
    flex-basis: calc(100% - 48px);
  }
  .member-foot {
    padding: 16px 16px 24px;
  }
}

/* ---------- KVKK aydınlatma metni sayfası ---------- */
.legal-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
}
.legal-top {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.legal {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 72px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}
.legal .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legal-title {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.legal-meta {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-3);
}
.legal-toc {
  margin-top: 28px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.legal-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 28px;
}
.legal-toc li {
  break-inside: avoid;
  font-size: 13.5px;
  line-height: 1.9;
}
.legal-toc a {
  color: var(--green-700);
}
.legal-section {
  margin-top: 34px;
  scroll-margin-top: 20px;
}
.legal-section h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
}
.legal-section > * + * {
  margin-top: 12px;
}
.legal-section p {
  color: var(--text-2);
  text-align: justify;
  hyphens: auto;
}
.legal-list {
  margin: 0;
  padding-left: 22px;
  color: var(--text-2);
  list-style: disc outside;
}
.legal-list li::marker {
  color: var(--green-600);
}
.legal-list li + li {
  margin-top: 6px;
}
.legal-list.is-ordered {
  padding-left: 0;
  list-style: none;
}
.legal-list.is-ordered li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
}
.legal-marker {
  font-weight: 600;
  color: var(--text);
}
.legal-table {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.legal-table > div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}
.legal-table > div:last-child {
  border-bottom: 0;
}
.legal-table dt {
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--surface-sunken);
  border-right: 1px solid var(--line);
}
.legal-table dd {
  margin: 0;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.legal-missing {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--amber-100);
  color: var(--amber-700);
  font-weight: 500;
}
.legal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
@media (max-width: 720px) {
  .legal {
    padding: 28px 16px 56px;
    font-size: 14.5px;
  }
  .legal-title {
    font-size: 30px;
  }
  .legal-toc ol {
    columns: 1;
  }
  .legal-section p {
    text-align: left;
  }
  .legal-table > div {
    grid-template-columns: minmax(0, 1fr);
  }
  .legal-table dt {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
  }
  .legal-table dd {
    padding: 10px 14px;
  }
}

/* ---------- Ana ekrana ekleme yönergeleri ---------- */
.install-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}
.install-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.install-no {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green-50);
  color: var(--green-700);
  font-weight: 600;
  font-size: 13px;
}

/* ---------- Davet paneli: genişte sağ sütunda açık, dar ekranda ağacın üstünde katlanır şerit ---------- */
.invite-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.invite-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  color: var(--green-700);
}
.invite-contacts {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -4px;
}
.invite-toggle {
  display: none;
  flex: none;
}
.invite-toggle svg {
  transition: transform 0.15s var(--ease);
}
.invite-toggle-close {
  display: none;
}

@media (max-width: 1180px) {
  /* Yan sütun kalkar; paneller tek tek sıralanabilsin diye kapsayıcı yok sayılır. */
  .member-grid .side-stack {
    display: contents;
  }
  .member-grid .invite-panel {
    order: -1;
  }
  .member-grid .team-panel {
    order: 0;
  }
  .member-grid .me-panel {
    order: 1;
  }
  .member-grid .sent-panel {
    order: 2;
  }
  .invite-panel {
    border-color: var(--green-100);
    box-shadow: 0 0 0 1px var(--green-100) inset;
  }
  .invite-panel .panel-head {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .invite-panel.is-collapsed .panel-head {
    border-bottom: 0;
  }
  .invite-panel.is-collapsed .panel-body {
    display: none;
  }
  .invite-toggle {
    display: inline-flex;
  }
  .invite-panel:not(.is-collapsed) .invite-toggle {
    background: var(--surface);
    color: var(--green-700);
    border-color: var(--green-100);
  }
  .invite-panel:not(.is-collapsed) .invite-toggle svg {
    transform: rotate(180deg);
  }
  .invite-panel:not(.is-collapsed) .invite-toggle-open {
    display: none;
  }
  .invite-panel:not(.is-collapsed) .invite-toggle-close {
    display: inline;
  }
}

/* Üye görünümü: ağaç doğrudan üyenin kendisiyle başlar; en üst düzeyde girinti ve bağlantı çizgisi yok. */
.tree > .tree-children.is-top {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}
.tree > .tree-children.is-top > .tree-branch > .node::before {
  display: none;
}
.tree > .tree-children.is-top > .tree-branch:first-child > .node {
  margin-top: 0;
}

/* ── Onur puanı kartı (Üyeliğim paneli) ─────────────────────────────────────────────── */
.points-slot:empty {
  display: none;
}
.points-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
  box-shadow: inset 0 0 0 1px var(--line);
}
.points-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.points-emoji {
  font-size: 28px;
  line-height: 1;
}
.points-level {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}
.points-medal {
  font-size: 11px;
  font-weight: 500;
  color: var(--amber-700);
  background: var(--amber-50);
  box-shadow: inset 0 0 0 1px var(--amber-100);
  border-radius: 999px;
  padding: 1px 8px;
}
.points-total {
  text-align: right;
  line-height: 1.1;
}
.points-total strong {
  display: block;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}
.points-total span {
  font-size: 12px;
  color: var(--text-2);
}
.points-progress {
  height: 8px;
  margin-top: 12px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
.points-progress span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--amber-500);
  transition: width 0.4s ease;
}
.points-next {
  margin: 6px 0 0;
}
.points-more {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.points-more summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--green-700);
  padding: 4px 0;
}
.points-more[open] summary {
  margin-bottom: 6px;
}
.points-sources {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13.5px;
}
.points-sources li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  flex-wrap: wrap;
}
.points-sources b {
  min-width: 34px;
  color: var(--amber-700);
  font-variant-numeric: tabular-nums;
}
/* Yönetici → Puan sıralaması */
.points-table .points-rank {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.points-table tr.is-muted {
  opacity: 0.6;
}
.points-more.is-inline {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}
.points-more.is-inline summary {
  font-size: 13px;
  padding: 0;
}
