/* Device Profiler arayüzü: public sayfa ve admin kayıt ayrıntısı ortak kullanır */
:root {
  color-scheme: dark;
  --bg: #0d1117;
  --bg-raised: #151b23;
  --bg-sunken: #0a0e13;
  --bg-hover: #1f2630;
  --bg-active: #232c38;
  --line: #2a313b;
  --line-soft: #1d232b;
  --text: #e6edf3;
  --text-2: #9aa4af;
  --text-3: #6b7480;
  --accent: #58a6ff;
  --ok: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --info: #a371f7;
  --string: #a5d6ff;
  --number: #79c0ff;

  --radius: 8px;
  --radius-sm: 5px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --fp-sticky-top: 0px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* Sayfa düzeyi yalnız public sayfada; admin kendi düzenini taşır */
body.fp-page {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px 24px;
}
.fp-app { font-family: var(--font-sans); font-size: 14px; line-height: 1.5; color: var(--text); font-variant-numeric: tabular-nums; }

.fp-app :focus-visible, .fp-page :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fp-app code { font-family: var(--font-mono); font-size: 12px; }
.fp-muted { color: var(--text-3); font-weight: 400; }
.fp-error { color: var(--bad); font-family: var(--font-mono); font-size: 12px; }

/* ===== Üst bant ===== */
.fp-top {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px 24px;
  padding: 20px 0 14px;
}
.fp-brand h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.fp-brand span { color: var(--text-2); font-size: 13px; }
.fp-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.fp-export-status { color: var(--ok); font-size: 12px; }

.fp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-raised); color: var(--text);
  font: 500 13px var(--font-sans);
  cursor: pointer;
}
.fp-btn:hover:not(:disabled) { background: var(--bg-hover); border-color: #3a434f; }
.fp-btn:disabled { opacity: 0.45; cursor: default; }
.fp-btn--primary { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.fp-btn--primary:hover:not(:disabled) { background: #2b7bf5; border-color: #2b7bf5; }

.fp-run { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.fp-run__track { flex: 1; height: 3px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.fp-run__fill { height: 100%; width: 0; background: var(--accent); transition: width 200ms ease; }
.fp-run__text { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.fp-run--done .fp-run__fill { background: var(--ok); opacity: 0.6; }

/* ===== Sekmeler ===== */
.fp-tabs {
  position: sticky; top: var(--fp-sticky-top); z-index: 10;
  display: flex; gap: 2px;
  overflow-x: auto; scrollbar-width: none;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.fp-tabs::-webkit-scrollbar { display: none; }
.fp-tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 12px 12px;
  background: none; border: 0;
  color: var(--text-2);
  font: 500 13px var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
}
.fp-tab:hover { color: var(--text); }
.fp-tab[aria-selected="true"] { color: var(--text); }
.fp-tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--accent);
}
.fp-tab__count {
  min-width: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--bg-active); color: var(--text-2);
  font-size: 11px; line-height: 18px; text-align: center;
}
.fp-tab__count--warn { background: rgba(210, 153, 34, 0.18); color: var(--warn); }

/* ===== Kart ===== */
.fp-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  min-width: 0;
}
.fp-card__title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.fp-subtitle { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 8px; }

/* ===== Özet ===== */
.fp-overview { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; align-items: start; }

.fp-facts { display: grid; gap: 0; }
.fp-facts > div {
  display: grid; grid-template-columns: 150px 1fr; gap: 16px;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
}
.fp-facts > div:last-child { border-bottom: 0; }
.fp-facts dt { color: var(--text-2); }
.fp-facts dd { overflow-wrap: anywhere; }
.fp-card--device .fp-facts dd { font-size: 15px; }
.fp-facts--compact > div { grid-template-columns: 130px 1fr; padding: 6px 0; }

.fp-map { display: grid; gap: 6px; }
.fp-map__row { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: center; }
.fp-map__label {
  background: none; border: 0; padding: 2px 0; text-align: left;
  color: var(--text-2); font: 13px var(--font-sans); cursor: pointer;
}
.fp-map__label:hover { color: var(--text); }
.fp-map__cells { display: flex; flex-wrap: wrap; gap: 4px; }

.fp-cell {
  display: inline-block; flex: none;
  width: 16px; height: 16px; border-radius: 4px;
  border: 0; padding: 0; cursor: pointer;
  background: var(--line);
}
button.fp-cell:hover { outline: 2px solid var(--text-2); outline-offset: 1px; }
.fp-cell--ok { background: var(--ok); }
.fp-cell--empty { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.fp-cell--notGranted { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-3); background-image: linear-gradient(135deg, transparent 45%, var(--text-3) 45%, var(--text-3) 55%, transparent 55%); }
.fp-cell--perturbed { background: var(--warn); }
.fp-cell--permission { background: var(--info); }
.fp-cell--error { background: var(--bad); }
.fp-cell--collecting { background: var(--accent); animation: fp-pulse 1s ease-in-out infinite alternate; }
.fp-cell--pending { background: var(--line); }

.fp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--text-2); }
.fp-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.fp-legend__item .fp-cell { width: 10px; height: 10px; border-radius: 3px; cursor: default; }
.fp-legend__item b { color: var(--text); font-weight: 600; }

.fp-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 24px; margin-top: 18px; }
.fp-checks__none { margin-top: 16px; font-size: 13px; }
.fp-record .fp-checks { margin-top: 0; }
.fp-check-list { list-style: none; }
.fp-check {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px;
}
.fp-check:last-child { border-bottom: 0; }
.fp-check__state { white-space: nowrap; }
.fp-check--ok .fp-check__state { color: var(--ok); }
.fp-check--bad .fp-check__state { color: var(--bad); white-space: normal; text-align: right; }
.fp-check--warn .fp-check__state { color: var(--warn); }

/* ===== Grup sekmesi: liste + ayrıntı ===== */
.fp-split { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.fp-list {
  position: sticky; top: calc(var(--fp-sticky-top) + 64px);
  display: flex; flex-direction: column; gap: 1px;
  max-height: calc(100vh - var(--fp-sticky-top) - 84px); overflow-y: auto;
}
.fp-row {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; padding: 8px 10px;
  background: none; border: 0; border-radius: var(--radius-sm);
  color: var(--text); text-align: left; font: inherit; cursor: pointer;
}
.fp-row:hover { background: var(--bg-hover); }
.fp-row--on, .fp-row--on:hover { background: var(--bg-active); }
.fp-row__text { display: flex; flex-direction: column; min-width: 0; }
.fp-row__name { font-size: 13px; font-weight: 500; }
.fp-row__sub {
  font-size: 12px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fp-row--on .fp-row__sub { color: var(--text-2); }

.fp-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--line); }
.fp-dot--ok { background: var(--ok); }
.fp-dot--empty, .fp-dot--notGranted { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.fp-dot--perturbed { background: var(--warn); }
.fp-dot--permission { background: var(--info); }
.fp-dot--error { background: var(--bad); }
.fp-dot--collecting { background: var(--accent); animation: fp-pulse 1s ease-in-out infinite alternate; }

.fp-detail { padding: 0; outline: none; }
.fp-detail__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.fp-detail__title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.fp-detail__key { color: var(--text-3); font-size: 12px; }
.fp-detail__meta { display: flex; align-items: center; gap: 10px; font-size: 12px; white-space: nowrap; }
.fp-detail__body { padding: 16px 20px 20px; font-size: 13px; overflow-wrap: anywhere; }

.fp-pill {
  display: inline-block; padding: 1px 9px; border-radius: 10px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--bg-active); color: var(--text-2);
}
.fp-pill--ok { background: rgba(63, 185, 80, 0.14); color: var(--ok); }
.fp-pill--perturbed { background: rgba(210, 153, 34, 0.16); color: var(--warn); }
.fp-pill--permission { background: rgba(163, 113, 247, 0.16); color: var(--info); }
.fp-pill--error { background: rgba(248, 81, 73, 0.15); color: var(--bad); }
.fp-pill--collecting { color: var(--accent); }

/* ===== Kayıt sekmesi ===== */
.fp-record { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.fp-record__wide { grid-column: 1 / -1; }
.fp-list-row { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.fp-list-row:last-child { border-bottom: 0; }
.fp-list-row__head { display: flex; justify-content: space-between; gap: 12px; }
.fp-list-row details { margin-top: 6px; }
.fp-list-row summary { color: var(--text-2); font-size: 12px; cursor: pointer; margin-bottom: 6px; }
.fp-table-wrap { overflow-x: auto; }
.fp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fp-table th { text-align: left; font-weight: 500; color: var(--text-2); padding: 6px 10px; border-bottom: 1px solid var(--line); }
.fp-table td { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.fp-table tr:last-child td { border-bottom: 0; }
.fp-num { text-align: right; }
.fp-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; margin-right: 6px; }
.fp-link:hover { text-decoration: underline; }

/* ===== Değer biçimleri (biçimlendiriciler) ===== */
.fp-val-string { color: var(--string); }
.fp-val-number { color: var(--number); }
.fp-val-boolean { color: #ff7b72; }
.fp-val-null { color: var(--text-3); font-style: italic; }
.fp-bool-true { color: var(--ok); }
.fp-bool-false { color: var(--bad); }
.fp-val-inline { display: inline-block; padding: 2px 8px; background: var(--bg-sunken); border-radius: 4px; font-family: var(--font-mono); font-size: 12px; }
.fp-val-array-badge {
  display: inline-block; margin: 0 6px 6px 0; padding: 1px 8px;
  background: var(--bg-active); color: var(--text-2); border-radius: 4px; font-size: 11px;
}

.fp-nested__content {
  margin-top: 4px; padding: 8px;
  background: var(--bg-sunken); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  font-size: 12px; max-height: 560px; overflow: auto;
}
.fp-detail__body > .fp-nested__content { margin-top: 0; max-height: none; padding: 0; background: none; border: 0; }

.fp-kv-table { width: 100%; font-family: var(--font-mono); font-size: 12px; }
.fp-kv-row { display: flex; border-bottom: 1px solid var(--line-soft); padding: 3px 0; }
.fp-kv-row:last-child { border-bottom: 0; }
.fp-kv-row:hover { background: rgba(255, 255, 255, 0.02); }
.fp-kv-key { flex: 0 0 240px; color: var(--text-2); padding: 2px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-kv-val { flex: 1; min-width: 0; padding: 2px 8px; overflow-wrap: anywhere; }
.fp-kv-table .fp-kv-table { margin-left: 4px; }
.fp-kv-table .fp-kv-table .fp-kv-key { flex-basis: 190px; }
.fp-kv-table .fp-kv-table .fp-kv-table .fp-kv-key { flex-basis: 160px; }
.fp-kv-row--vertical { flex-direction: column; padding: 8px 0 6px; }
.fp-kv-row--vertical > .fp-kv-key,
.fp-kv-table .fp-kv-table .fp-kv-row--vertical > .fp-kv-key,
.fp-kv-table .fp-kv-table .fp-kv-table .fp-kv-row--vertical > .fp-kv-key {
  flex: none; padding: 0 8px 4px; color: var(--text); font-family: var(--font-sans); font-weight: 600; font-size: 12px;
}
.fp-kv-row--vertical > .fp-kv-val { padding: 0; width: 100%; }

.fp-data-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12px; }
.fp-data-table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; padding: 6px 8px;
  background: var(--bg-active); color: var(--text-2);
  font: 500 12px var(--font-sans);
  border-bottom: 1px solid var(--line);
}
.fp-data-table td {
  padding: 4px 8px; border-bottom: 1px solid var(--line-soft);
  max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fp-data-table tr:hover td { background: var(--bg-hover); }

.fp-prim-list { font-family: var(--font-mono); font-size: 12px; }
.fp-prim-list__item { padding: 1px 0; border-bottom: 1px solid var(--line-soft); }
.fp-prim-list__item:last-child { border-bottom: 0; }
.fp-prim-list__idx { display: inline-block; min-width: 40px; margin-right: 8px; text-align: right; color: var(--text-3); }

.fp-num-grid, .fp-string-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.fp-num-grid__item { padding: 1px 6px; background: var(--bg-active); border-radius: 3px; color: var(--number); font: 11px var(--font-mono); }
.fp-string-tag {
  max-width: 260px; padding: 1px 8px;
  background: rgba(165, 214, 255, 0.06); border: 1px solid rgba(165, 214, 255, 0.14); border-radius: 4px;
  color: var(--string); font: 11px var(--font-mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.fp-color-grid { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 8px; }
.fp-color-swatch { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); }

.fp-perms-group-label { margin: 10px 0 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.fp-perms-group-label:first-child { margin-top: 0; }
.fp-perms-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.fp-perm-badge { padding: 2px 9px; border-radius: 10px; font: 11px var(--font-mono); white-space: nowrap; border: 1px solid transparent; }
.fp-perm-badge--granted { background: rgba(63, 185, 80, 0.12); color: var(--ok); border-color: rgba(63, 185, 80, 0.28); }
.fp-perm-badge--prompt { background: rgba(210, 153, 34, 0.12); color: var(--warn); border-color: rgba(210, 153, 34, 0.28); }
.fp-perm-badge--denied { background: rgba(248, 81, 73, 0.12); color: var(--bad); border-color: rgba(248, 81, 73, 0.28); }
.fp-perm-badge--error { background: var(--bg-active); color: var(--text-3); border-color: var(--line); cursor: help; }

.fp-large-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.fp-search {
  flex: 1; max-width: 360px; height: 30px; padding: 0 10px;
  background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); font: 12px var(--font-mono);
}
.fp-search:focus { border-color: var(--accent); outline: none; }
.fp-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.fp-pagination button {
  height: 26px; padding: 0 10px;
  background: var(--bg-active); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text-2); font: 12px var(--font-sans); cursor: pointer;
}
.fp-pagination button:hover:not(:disabled) { color: var(--text); background: var(--bg-hover); }
.fp-pagination button:disabled { opacity: 0.35; cursor: default; }

.fp-keyboard-group { margin: 10px 0 6px; font-size: 12px; font-weight: 600; color: var(--text-2); font-family: var(--font-sans); }
.fp-keyboard-group:first-child { margin-top: 0; }
.fp-keyboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
.fp-keyboard-key {
  display: flex; justify-content: space-between; padding: 4px 8px;
  background: var(--bg-sunken); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); font-size: 12px;
}
.fp-keyboard-code { color: var(--text-2); }
.fp-keyboard-char { color: var(--accent); font-weight: 600; }

@keyframes fp-spin { to { transform: rotate(360deg); } }
@keyframes fp-pulse { from { opacity: 0.35; } to { opacity: 1; } }
.fp-spinner {
  display: inline-block; width: 12px; height: 12px; vertical-align: -1px;
  border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
  animation: fp-spin 0.7s linear infinite;
}

/* ===== Tanıtım ve alt bilgi ===== */
.fp-seo-intro { max-width: 760px; padding: 8px 0 24px; color: var(--text-2); line-height: 1.7; }
.fp-seo-intro h2 { color: var(--text); font-size: 20px; margin-bottom: 12px; }
.fp-seo-intro h3 { color: var(--text); font-size: 15px; margin: 16px 0 8px; }
.fp-seo-intro p { margin-bottom: 8px; }
.fp-seo-intro ul { padding-left: 20px; }
.fp-seo-intro--hidden { display: none; }

.fp-footer { margin-top: 40px; padding: 20px 0; border-top: 1px solid var(--line-soft); color: var(--text-3); font-size: 12px; }
.fp-footer p { max-width: 640px; margin-bottom: 6px; }

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

@media (max-width: 1100px) {
  .fp-overview { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  body.fp-page { padding: 0 16px 16px; }
  .fp-top { grid-template-columns: 1fr; }
  .fp-actions { justify-content: flex-start; }
  .fp-split { grid-template-columns: 1fr; }
  .fp-list { position: static; max-height: 300px; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; }
  .fp-record { grid-template-columns: 1fr; }
  .fp-map__row { grid-template-columns: 1fr; gap: 4px; }
  .fp-facts > div, .fp-facts--compact > div { grid-template-columns: 1fr; gap: 2px; }
  .fp-kv-key { flex-basis: 140px; }
  .fp-detail__head { flex-direction: column; gap: 8px; }
}

/* GPU hesap uyumluluğu */
.fp-gc { display: grid; gap: 10px; max-width: 640px; font-size: 14px; }
.fp-gc__notice { color: var(--text-2); font-size: 13px; }
.fp-gc__meter { height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.fp-gc__fill { height: 100%; background: var(--accent); transition: width 200ms ease; }
.fp-gc__state { font-weight: 600; }
.fp-gc__state--complete { color: var(--ok); }
.fp-gc__state--stopped { color: var(--warn); }
.fp-gc__state--error { color: var(--bad); }
.fp-gc__result { font-size: 16px; font-weight: 500; }

/* Yalnız ekran okuyucu için metin (renkle verilen bilginin metin karşılığı) */
.fp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
