/* ═══════════════════ özellik bileşenleri ═══════════════════ */

/* ── bölgeye göre görünürlük: iki çalışma alanı birbirine karışmaz ── */
:root[data-region="TR"]   .only-kktc { display: none !important; }
:root[data-region="KKTC"] .only-tr   { display: none !important; }

/* ── bölge anahtarı ── */
.region {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin: 0 14px 12px; padding: 5px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.region button {
  display: flex; align-items: center; gap: 10px; text-align: left; min-width: 0;
  padding: 10px 12px; border-radius: 15px; color: var(--text-2);
  transition: background var(--dur) var(--ease), color var(--dur), box-shadow var(--dur);
}
.region button:hover { color: var(--text); }
.region button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.region__flag {
  width: 30px; height: 20px; flex: 0 0 auto; border-radius: 4px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line-2), 0 1px 2px rgba(0,0,0,.12);
  transition: opacity var(--dur), filter var(--dur);
}
.region__flag .flag { display: block; width: 100%; height: 100%; }
.region button:not([aria-pressed="true"]) .region__flag { opacity: .7; filter: saturate(.75); }
.region button:hover .region__flag { opacity: 1; filter: none; }
.region__txt { min-width: 0; }
.region b { display: block; font-size: var(--fs-sm); font-weight: 700; line-height: 1.2; white-space: nowrap; }
/* ── istatistik kutuları ── */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat--wide { grid-column: 1 / -1; }
.stat--accent { background: var(--accent-soft); }
.stat--accent span { color: var(--accent-text); }
.stat--accent b { font-size: var(--fs-md); }
.stat { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; min-width: 0; }
.stat span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.stat b { display: block; font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.01em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat b.small { font-size: var(--fs-sm); line-height: 1.35; }
.stat small { display: block; font-size: var(--fs-xs); font-weight: 600; margin-top: 2px; }
.stat small.ok { color: var(--success); }
.stat small.warn { color: var(--warning); }

.actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 2px 6px; }

.title-edit { display: flex; align-items: center; gap: 6px; }
.title-edit .h2 { cursor: text; border-radius: 8px; padding: 0 4px; margin-left: -4px; }
.title-edit .h2:hover { background: var(--surface-2); }
.title-edit .btn { opacity: .6; }

/* ── planlama dağılımı ── */
.stackbar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: var(--surface-3);
            box-shadow: inset 0 0 0 1px var(--line); }
.stackbar span { height: 100%; min-width: 2px; }
.stackbar span + span { box-shadow: -1px 0 0 rgba(255,255,255,.6); }
.breakdown { list-style: none; margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.breakdown li { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 10px; }
.breakdown li + li { border-top: 1px solid var(--line); }
.breakdown li.is-muted { opacity: .7; }
.bd-dot { width: 12px; height: 12px; border-radius: 4px; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.breakdown b { display: block; font-size: var(--fs-sm); font-weight: 700; line-height: 1.3; }
.breakdown small { display: block; font-size: var(--fs-xs); color: var(--text-3); }
.bd-num { text-align: right; flex: 0 0 auto; }
.bd-num b { font-variant-numeric: tabular-nums; }

/* ── plan kesiti ── */
.thumb { width: 100%; height: auto; aspect-ratio: 7 / 5; border-radius: var(--r-md);
         background: var(--surface-2); border: 1px solid var(--line); image-rendering: auto; }
.plan-read + .plan-read { margin-top: 4px; }

.ctx { padding: 9px 12px; background: var(--surface-2); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.ctx b { display: block; font-weight: 700; }
.ctx small { color: var(--text-3); font-size: var(--fs-xs); }

.chip--sm { height: 24px; padding: 0 9px; font-size: var(--fs-xs); }
.chip.mono { font-family: var(--mono); font-size: 11.5px; }

.empty--sm { padding: 14px 10px; }
.mb-1 { margin-bottom: 6px; }

/* ── OSB arama ── */
.osb-list { list-style: none; margin-top: 10px; max-height: 260px; overflow-y: auto;
            display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; }
.osb-list li[data-osb] {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: var(--surface-2); border-radius: var(--r-md); cursor: pointer;
  border: 1px solid transparent; transition: border-color var(--dur), background var(--dur);
}
.osb-list li[data-osb]:hover, .osb-list li[data-osb]:focus-visible { border-color: var(--accent); background: var(--surface); }
.osb-list b { display: block; font-size: var(--fs-sm); font-weight: 700; }
.osb-list small { display: block; font-size: var(--fs-xs); color: var(--text-3); }
.osb-hint { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 4px; }

/* ── arsa ekleme ── */
.add-arsa { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add-arsa .btn { height: 46px; }
.dropzone {
  margin-top: 10px; padding: 14px; border-radius: var(--r-md); text-align: center;
  border: 1.5px dashed var(--line-2); color: var(--text-3); font-size: var(--fs-xs);
}
.dropzone .script { display: block; margin-bottom: 2px; }
.formats { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }

.drop-overlay {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}
.drop-overlay__card {
  padding: 28px 36px; border-radius: var(--r-xl); text-align: center;
  background: var(--surface); border: 2px dashed var(--accent); box-shadow: var(--shadow-lg);
}
.drop-overlay__card .i { width: 34px; height: 34px; margin: 0 auto 8px; color: var(--accent); }
.drop-overlay__card b { display: block; font-size: var(--fs-lg); }
.drop-overlay.is-blocked .drop-overlay__card { border-color: var(--warning); }
.drop-overlay.is-blocked .drop-overlay__card .i { color: var(--warning); }
.drop-overlay .when-blocked { display: none; }
.drop-overlay.is-blocked .when-blocked { display: block; }
.drop-overlay.is-blocked .when-ok { display: none; }

/* ── çizim göstergesi ── */
.draw-hud {
  position: fixed; z-index: 40; bottom: calc(var(--gap) + 50px); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 16px;
  border-radius: var(--r-pill); background: var(--glass-strong);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: toast-in .24s var(--ease); max-width: calc(100vw - 2 * var(--gap));
}
body:not(.panel-collapsed) .draw-hud { left: calc(50% + (var(--panel-w) + var(--gap)) / 2); }
.draw-hud__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--draw-color, var(--hot));
                 box-shadow: 0 0 0 4px color-mix(in srgb, var(--draw-color, var(--hot)) 22%, transparent); flex: 0 0 auto; }
.draw-hud__text b { display: block; font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; }
.draw-hud__text small { display: block; font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap; }
body.is-drawing .statusbar { opacity: .5; }

/* ── harita başlatılamadıysa ── */
.map-fail { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
            gap: 8px; color: var(--text-2); text-align: center; padding: 20px; }
.map-fail b { color: var(--text); font-size: var(--fs-lg); }

@media (max-width: 820px) {
  .draw-hud, body:not(.panel-collapsed) .draw-hud { left: 50%; bottom: auto; top: calc(var(--gap) + 110px); }
  .draw-hud__text small { display: none; }
}
