/* ============================================================================
   WebLibrary — uygulama arayüzü
   ----------------------------------------------------------------------------
   Tek bir ölçek sistemi: boşluk, yarıçap, tipografi ve renk aşağıda tanımlı,
   başka hiçbir yerde çıplak değer kullanılmıyor. Ekranlar arasındaki tutarlılık
   buradan geliyor.

   Yüzey kuralı: ana ekranın kartları (arama, kısayol, özet, link kartı)
   beyaz ve ÇOK hafif gölgeli (--shadow-*); çizgi neredeyse görünmez. Güçlü
   gölge yalnızca üstte duran şeylerde (alt sayfa, kayan buton, bildirim).
   Karanlık kipte gölge görünmediği için ayrımı ince çizgi yapıyor.

   Renk: logodan gelen üç ton. Yeşil aksiyon, koyu teal metin, amber yalnızca
   "değerli işaretli" anlamında. Amber başka hiçbir yerde geçmiyor.
   ========================================================================== */

:root {
  /* boşluk — 4'ün katları */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px;

  /* yarıçap */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* renk */
  --ink:     #0A2A33;   /* birincil metin */
  --ink-2:   #45606A;   /* ikincil metin — kağıt üstünde 7:1 */
  --ink-3:   #587179;   /* üçüncül — kağıt üstünde 4.8:1, beyazda 5.2:1 */
  --surface: #F4F6F5;
  --card:    #FFFFFF;
  --line:    #E4EAE8;
  --line-2:  #EFF3F1;

  --brand:      #1F7355;  /* beyaz yazıyla 5.8:1 */
  --brand-dark: #175B43;
  --brand-soft: #E9F2EE;
  --brand-ink:  #12594181;

  --amber:  #C9780A;      /* değerli işareti — beyaz üstünde 3.6:1, ikon */
  --danger: #B3261E;
  --danger-soft: #FCEDEC;

  --focus: #2FA37A;

  /* yükseklik — sadece üstte duran öğeler */
  --lift-sheet: 0 -8px 40px -12px rgba(10, 42, 51, 0.35);
  --lift-fab:   0 8px 24px -8px rgba(10, 42, 51, 0.45);
  --lift-toast: 0 10px 30px -10px rgba(10, 42, 51, 0.5);

  /* ana ekran kartları — gölge hissedilsin ama görünmesin */
  --shadow-soft: 0 1px 2px rgba(10, 42, 51, 0.04), 0 4px 14px -6px rgba(10, 42, 51, 0.10);
  --shadow-card: 0 1px 2px rgba(10, 42, 51, 0.04), 0 10px 28px -14px rgba(10, 42, 51, 0.18);
  --card-line: rgba(10, 42, 51, 0.045);

  /* tür rozetleri: yalnızca metin/ikon rengi; zemin bundan türetiliyor */
  --k-haber:  #B4413A;
  --k-video:  #2F62C4;
  --k-yazi:   #1F7355;
  --k-urun:   #B0610F;
  --k-belge:  #5B4FB0;
  --k-sosyal: #1F7086;
  --k-arac:   #45606A;

  /* özet kartlarının yumuşak tonları */
  --tone-green: #1F7355;
  --tone-blue:  #2F62C4;
  --tone-amber: #C9780A;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

/* Karanlık kip aynı ölçek sistemini kullanıyor; yalnızca renkler değişiyor.
   Yüzeyler saf siyah değil: OLED'de kontrast fazla sert olur ve kartların
   zeminden ayrıldığı görülmez. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink:     #E8EFEE;
    --ink-2:   #A8BCC0;
    --ink-3:   #8AA1A7;
    --surface: #0E1618;
    --card:    #162124;
    --line:    #24343800;
    --line:    #243438;
    --line-2:  #1C292C;

    --brand:      #35BE8C;
    --brand-dark: #2AA679;
    --brand-soft: #16332A;

    --amber:  #E9A23B;
    --danger: #F2766B;
    --danger-soft: #33201E;

    --lift-sheet: 0 -8px 40px -12px rgba(0, 0, 0, 0.7);
    --lift-fab:   0 8px 24px -8px rgba(0, 0, 0, 0.8);
    --lift-toast: 0 10px 30px -10px rgba(0, 0, 0, 0.8);

    --shadow-soft: none;
    --shadow-card: none;
    --card-line: rgba(255, 255, 255, 0.06);

    --k-haber:  #F08A80;
    --k-video:  #7FA7F2;
    --k-yazi:   #4FC79A;
    --k-urun:   #E9A55A;
    --k-belge:  #A79CF0;
    --k-sosyal: #6CC3D6;
    --k-arac:   #A8BCC0;

    --tone-green: #4FC79A;
    --tone-blue:  #7FA7F2;
    --tone-amber: #E9A23B;
  }

}

* { box-sizing: border-box; }

/*
 * `hidden` özniteliği her zaman kazanmalı.
 *
 * Tarayıcının varsayılanı [hidden] { display: none } ama bu bir UA kuralı;
 * bizim .toast { display: flex } gibi sınıf kurallarımız onu eziyor. Sonuç:
 * JS tarafında `box.hidden = true` denmesine rağmen öğe ekranda kalıyor,
 * sadece içi boşalıyor — bildirim kapandıktan sonra ekranda duran koyu çubuk
 * tam olarak buydu.
 *
 * Testlerin yakalayamamasının sebebi de bu: jsdom stil hesaplamıyor, öznitelik
 * doğru ayarlandığı için test geçiyordu ama ekranda öğe duruyordu.
 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}

/* Üst bölümde neredeyse fark edilmeyen bir atmosfer: marka yeşilinin çok
   açık bir tonu köşeden yayılıyor. Yalnızca sayfanın başında; kaydırınca
   içerikle birlikte gidiyor. */
body {
  background-image:
    radial-gradient(110% 340px at 0% 0%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 70%),
    radial-gradient(80% 260px at 100% 0%, color-mix(in srgb, var(--brand) 5%, transparent), transparent 70%);
  background-repeat: no-repeat;
}

button, input, textarea, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Phosphor ikonları dolgulu çizilir; kontur yok. Boyut metinle birlikte
   büyüyüp küçülsün diye em üzerinden geliyor. */
.ph {
  flex: 0 0 auto;
  display: block;
  fill: currentColor;
  stroke: none;
}

/* ------------------------------------------------------------------ üst bar
   Kaydırırken içeriğin altından geçtiği yarı saydam bir şerit. Blur destekli
   tarayıcıda cam etkisi, desteklemeyende düz zemin. */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: calc(var(--safe-top) + var(--s3)) var(--s5) 2px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 160ms ease, border-color 160ms ease;
}

/* En üstteyken şerit görünmez (atmosfer arkadan görünsün); kaydırınca cam. */
.topbar.is-stuck {
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border-bottom-color: var(--line);
}
@supports (backdrop-filter: blur(1px)) {
  .topbar.is-stuck { backdrop-filter: saturate(1.4) blur(14px); }
}

.wordmark {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.topbar-actions { display: flex; align-items: center; gap: var(--s1); }

/* Kütüphane ana ekranının alt başlığı. */
.tagline {
  margin: 0;
  padding: 0 var(--s5) var(--s3);
  font-size: 14px;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}

/* Okunmamış bildirim işareti. Sayı değil nokta: kaç tane olduğu değil,
   bakılacak bir şey olup olmadığı önemli. */
.bell-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--brand);
  border: 2px solid var(--surface);
}

/* ---------------------------------------------------------- bildirim listesi */

.notice-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.notice-row:first-child { border-top: 0; }
.notice-text { flex: 1; min-width: 0; color: var(--ink); }
.notice-time { flex: 0 0 auto; font-size: 12px; color: var(--ink-3); }

.notice-empty {
  padding: var(--s6) 0;
  text-align: center;
  color: var(--ink-3);
}
.notice-empty .ph { margin: 0 auto var(--s3); color: var(--ink-3); }
.notice-empty p { margin: 0; font-size: 14px; }

/* -------------------------------------------------------------------- arama
   Üst şeritte değil, başlığın altında ve her zaman görünür. */

.search {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 var(--s4) var(--s3);
}

.search-icon {
  position: absolute;
  left: calc(var(--s4) + 16px);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 48px;
  padding: 0 92px 0 46px;
  border: 1px solid var(--card-line);
  border-radius: var(--r-pill);
  background: var(--card);
  box-shadow: var(--shadow-card);
  font-size: 15px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
  box-shadow: var(--shadow-card), 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent);
}
.search input::-webkit-search-cancel-button { display: none; }

/* Temizle, süzgecin solunda; süzgeç her zaman sağda. */
.search-clear {
  position: absolute;
  right: calc(var(--s4) + 46px);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.search-clear:hover { background: var(--line-2); color: var(--ink); }

.search-filter {
  position: absolute;
  right: calc(var(--s4) + 6px);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--line-2);
  color: var(--ink-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 120ms ease, color 120ms ease;
}
.search-filter:hover { background: var(--brand-soft); color: var(--brand-dark); }
.search-filter:active { transform: scale(0.95); }

/* ----------------------------------------------------------- hızlı erişim
   Yalnızca logo. Etiket yok: alan adı zaten logonun kendisi ve etiket
   eklemek satırı iki katına çıkarırdı. */

.quick {
  display: flex;
  gap: 10px;
  /* Gölgeler kırpılmasın diye dikeyde biraz pay. */
  padding: 2px var(--s4) var(--s3);
  margin-bottom: -2px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--s4);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.quick::-webkit-scrollbar { display: none; }

.quick-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 70px;
  height: 74px;
  padding: 6px 3px;
  border: 1px solid var(--card-line);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  scroll-snap-align: start;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.quick-item:active { transform: scale(0.95); }

.quick-logo {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
}
.quick-logo .thumb {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: transparent;
}
.quick-logo .thumb-icon { padding: 3px; background: transparent; }
.quick-logo .thumb-letter {
  background: var(--brand-soft);
  font-size: 14px;
}

.quick-label {
  max-width: 100%;
  padding: 0;
  font-size: 11px;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* "Ekle": aynı kart, içinde yuvarlak artı. */
.quick-add .quick-logo {
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  color: var(--ink-2);
}
.quick-add .quick-label { color: var(--ink-3); font-weight: 600; }

/* Kısayol seçici listesi */
.shortcut-list { margin-top: var(--s2); }
.shortcut-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  padding: var(--s2) var(--s1);
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.shortcut-row:hover { background: var(--line-2); }
.shortcut-row .ph { color: var(--brand); }
.shortcut-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shortcut-title, .shortcut-host {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shortcut-title { font-size: 14.5px; font-weight: 650; color: var(--ink); }
.shortcut-host { font-size: 12.5px; color: var(--ink-3); }

/* ---------------------------------------------------------- gözat ekranı */

.browse-list { margin-bottom: var(--s5); }

/* Tür ve etiket: çip. Yan yana duruyor, satır gibi tam genişlik kaplamıyor.
   İlk tasarımda her biri kart büyüklüğünde bir satırdı ve altı linklik bir
   kütüphanede bile ekranın yarısını dolduruyordu. */
.browse-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-bottom: var(--s5);
}

.browse-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 var(--s3) 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 120ms ease, transform 120ms ease;
}
.browse-chip:hover { border-color: var(--ink-3); }
.browse-chip:active { transform: scale(0.97); }
.browse-chip .ph { width: 16px; height: 16px; color: var(--ink-2); }
.browse-chip-label { white-space: nowrap; }
.browse-chip-count {
  min-width: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--line-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.browse-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  padding: 10px var(--s3);
  margin-bottom: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 120ms ease, transform 120ms ease;
}
.browse-row:hover { border-color: var(--ink-3); }
.browse-row:active { transform: scale(0.994); }

/* Site satırında sitenin kendi logosu; kartlarla aynı modülden geliyor. */
.browse-logo {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: contain;
  background: var(--line-2);
}
.browse-letter {
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}

.browse-label {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browse-count {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.browse-hint {
  margin: 0 0 var(--s5);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* Tür rozeti: küçük, ikonlu kapsül. Renk yalnızca metinde; zemin aynı
   rengin çok açık hali, böylece rozetler göz yormuyor. */
.kind-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 19px;
  padding: 0 7px 0 6px;
  border-radius: var(--r-pill);
  --k: var(--ink-2);
  background: color-mix(in srgb, var(--k) 11%, transparent);
  color: var(--k);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
}
.kind-badge .ph { flex: 0 0 auto; }
.k-haber  { --k: var(--k-haber); }
.k-video  { --k: var(--k-video); }
.k-yazi   { --k: var(--k-yazi); }
.k-urun   { --k: var(--k-urun); }
.k-belge  { --k: var(--k-belge); }
.k-sosyal { --k: var(--k-sosyal); }
.k-arac   { --k: var(--k-arac); }
.k-match  { --k: var(--brand); }

/* Toplu seçimde işaretli kart. */
.card.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}

/* ------------------------------------------------------------------- özet
   Üç küçük kart. Sayı öne, etiket ikincil; ikon yumuşak tonlu bir dairede. */

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s2);
  padding: 0 var(--s4);
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--card-line);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.summary-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  --tone: var(--tone-green);
  background: color-mix(in srgb, var(--tone) 12%, transparent);
  color: var(--tone);
}
.tone-blue  .summary-icon { --tone: var(--tone-blue); }
.tone-amber .summary-icon { --tone: var(--tone-amber); }
/* Dar ekranda ikon yer kaplamasın; sayı ve etiket öncelikli. */
@media (max-width: 359px) {
  .summary-icon { display: none; }
}

.summary-text { display: flex; flex-direction: column; min-width: 0; }

.summary-value {
  font-size: 16px;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.summary-label {
  font-size: 11.5px;
  letter-spacing: -0.01em;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand-dark); }
.icon-btn:active { background: var(--line); }

/* Menü: beyaz, yuvarlak, hafif gölgeli. */
.icon-btn-raised {
  width: 40px;
  height: 40px;
  border: 1px solid var(--card-line);
  border-radius: var(--r-pill);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}
.icon-btn-raised:hover { background: var(--card); color: var(--brand-dark); }

/* --------------------------------------------------------------------- arama
   "Kapat" yerine geri oku: dönüş yönünü gösteren evrensel işaret. */

.searchbar {
  position: sticky;
  top: 0;
  z-index: 21;
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: calc(var(--safe-top) + var(--s3)) var(--s3) var(--s3);
  background: var(--surface);
}

.searchbar input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  font-size: 15px;
}
.searchbar input::placeholder { color: var(--ink-3); }
.searchbar input:focus { outline: none; border-color: var(--brand); }

/* -------------------------------------------------------------------- raflar */

.shelf { padding: 0 var(--s4) calc(150px + var(--safe-bottom)); }

.shelf-heading {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin: var(--s5) 0 10px;
  padding: 0 2px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.shelf-heading:first-child { margin-top: var(--s4); }

.shelf-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}

/* "Tümü >" — başlığın sağında, sade bağlantı. */
.shelf-action {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 4px 2px 4px 8px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.shelf-action:hover { background: var(--line-2); color: var(--ink); }
[dir="rtl"] .shelf-action .ph.is-directional { transform: scaleX(-1); }

/* ---------------------------------------------------------------------- kart
   Beyaz, yuvarlak, çok hafif gölgeli. Solda görsel, ortada başlık / site +
   tür / zaman, sağda yer imi ve menü. */

.card {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  margin-bottom: var(--s2);
  padding: 9px 2px 9px 10px;
  border: 1px solid var(--card-line);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-card);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.card:active { transform: scale(0.99); }

/* Görsel kutusu: açık gri zemin üstünde logo. */
.card-media {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--line-2);
  overflow: hidden;
}

.thumb {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--brand-soft);
}
.card-media .thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.thumb-letter {
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-dark);
}
.card-media .thumb-letter { font-size: 17px; }

/* Favicon küçük; gerdirmek yerine ikon gibi ortalanıyor. */
.thumb-icon {
  object-fit: contain;
  padding: 7px;
  background: var(--brand-soft);
}
.card-media .thumb-icon { padding: 10px; background: transparent; }

.card-body { flex: 1; min-width: 0; }

.card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc { display: none; }  /* kompakt kartta açıklama yok; detayda var */

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
}
.card-site { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.card-sub {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
}
.card-when { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.card-tags {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--brand);
  font-weight: 600;
}

.pending .card-title { color: var(--ink-3); }

.card-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Amber tek bir iş yapar: bu link değerli işaretli. */
.mark-btn,
.more-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 36px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mark-btn .ph, .more-btn .ph { width: 20px; height: 20px; }
.mark-btn:hover, .more-btn:hover { background: var(--line-2); color: var(--ink); }
.mark-btn[aria-pressed="true"] { color: var(--amber); }

/* ---------------------------------------------------------------- boş durum */

.empty {
  padding: var(--s8) var(--s7);
  text-align: center;
}
.empty-art {
  display: inline-grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: var(--s5);
  border-radius: 22px;
  background: var(--brand-soft);
  color: var(--brand);
}
.empty h2 {
  margin: 0 0 var(--s2);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.empty p { margin: 0 0 var(--s2); color: var(--ink-2); font-size: 14px; }
.empty .primary-btn { margin-top: var(--s5); }

/* ------------------------------------------------------------------- kayan */

/* -------------------------------------------------------- alt gezinme
   Üç bölüm: kütüphane, kasa, arşiv. Bunlar menünün dibinde saklıydı; en çok
   geçilen yerler başparmağın ulaştığı yere taşındı. */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 24;
  display: flex;
  gap: var(--s1);
  padding: 6px var(--s3) calc(6px + var(--safe-bottom));
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border-top: 1px solid var(--card-line);
  box-shadow: 0 -6px 24px -18px rgba(10, 42, 51, 0.25);
}

@supports (backdrop-filter: blur(1px)) {
  .bottom-nav { backdrop-filter: saturate(1.4) blur(16px); }
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 50px;
  padding: 5px 0;
  border: 0;
  border-radius: 16px;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 160ms ease, color 160ms ease;
}
/* Etkin bölüm: yeşil, hafif yeşil kapsül içinde. */
.nav-item.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}
.nav-label { font-size: 11px; font-weight: 650; }
.nav-icon { display: grid; place-items: center; }

.fab {
  position: fixed;
  right: var(--s4);
  bottom: calc(76px + var(--safe-bottom));
  z-index: 25;
  display: flex;
  align-items: center;
  gap: var(--s2);
  height: 44px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.005em;
  box-shadow:
    0 2px 6px rgba(10, 42, 51, 0.12),
    0 14px 28px -10px color-mix(in srgb, var(--brand) 70%, transparent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease, background-color 120ms ease;
}
.fab:active { background: var(--brand-dark); transform: translateY(1px) scale(0.99); }

/* ------------------------------------------------------------- alt sayfa
   dialog öğesi alta yaslanıyor; üstte tutamak, dışına dokunarak kapanıyor. */

.sheet,
.dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: none;
  max-height: none;
}
.sheet::backdrop,
.dialog::backdrop { background: rgba(10, 42, 51, 0.38); }

@supports (backdrop-filter: blur(1px)) {
  .sheet::backdrop, .dialog::backdrop { backdrop-filter: blur(2px); }
}

.sheet {
  width: 100%;
  margin: auto auto 0;
}

.sheet > form,
.sheet-surface {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--s2) var(--s4) calc(var(--s5) + var(--safe-bottom));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--card);
  box-shadow: var(--lift-sheet);
  animation: sheet-rise 220ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes sheet-rise {
  from { transform: translateY(14px); opacity: 0.85; }
  to   { transform: none; opacity: 1; }
}

.sheet-handle {
  width: 38px;
  height: 4px;
  margin: var(--s2) auto var(--s4);
  border-radius: var(--r-pill);
  background: var(--line);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s2);
}
.sheet-head h3 {
  margin: 0;
  /* Rengi açıkça veriliyor: <dialog> tarayıcının varsayılan metin rengini
     (siyah) taşıyor ve karanlık kipte başlık zemine karışıyordu. */
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-note {
  margin: 0 0 var(--s3);
  font-size: 13.5px;
  color: var(--ink-2);
}

/* Menü satırı: ikon, etiket, isteğe bağlı sağ taraf. */
.sheet-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  padding: var(--s3) var(--s2);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--ink);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sheet-item:hover { background: var(--line-2); }
.sheet-item:active { background: var(--line); }
.sheet-item .ph:first-child { color: var(--ink-2); }

.sheet-item.danger { color: var(--danger); }
.sheet-item.danger .ph:first-child { color: var(--danger); }
.sheet-item.danger:hover { background: var(--danger-soft); }

/* Tehlikeli işlem ayrı alanda: üstünde ince bir ayraç. */
.sheet-danger-zone {
  margin-top: var(--s2);
  padding-top: var(--s2);
  border-top: 1px solid var(--line);
}

/* Ana menüdeki gruplar */
.menu-group { margin-bottom: var(--s3); }
.menu-group + .menu-group {
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}
.menu-label {
  margin: 0 var(--s2) var(--s1);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.menu-meta {
  margin: var(--s3) var(--s2) 0;
  font-size: 12px;
  color: var(--ink-3);
}

/* ------------------------------------------------------------------ diyalog */

.dialog {
  width: 100%;
  margin: auto;
}
.dialog > form,
.dialog-surface {
  width: min(440px, calc(100vw - 2 * var(--s4)));
  margin: 0 auto;
  padding: var(--s5);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--lift-toast);
}
.dialog h3 { margin: 0 0 var(--s4); font-size: 17px; font-weight: 750; }

.dialog input {
  width: 100%;
  height: 46px;
  padding: 0 var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
}
.dialog input:focus { outline: none; border-color: var(--brand); }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s2);
  margin-top: var(--s4);
}

/* ------------------------------------------------------------------ butonlar */

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 46px;
  padding: 0 var(--s5);
  border: 0;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.primary-btn:hover { background: var(--brand-dark); }
.primary-btn:disabled { opacity: 0.55; cursor: default; }

.text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 0 var(--s3);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--brand-dark);
  font-size: 14.5px;
  font-weight: 650;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.text-btn:hover { background: var(--brand-soft); }
.text-btn:disabled { opacity: 0.55; cursor: default; }

.ghost-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}
.ghost-btn:hover { background: var(--line-2); }

.vault-danger { color: var(--danger); }
.vault-danger:hover { background: var(--danger-soft); }

/* --------------------------------------------------------------- panel içi
   Aktarım, yedekleme, detay ve tanılama ekranları bu bileşenleri paylaşıyor. */

.transfer-lead {
  margin: 0 0 var(--s4);
  font-size: 14px;
  color: var(--ink-2);
}

.transfer-warn {
  margin: var(--s3) 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.transfer-busy { margin: 0; font-size: 14px; color: var(--ink-2); }
.transfer-error:not(:empty) {
  margin: var(--s3) 0 0;
  font-size: 14px;
  color: var(--danger);
}

.transfer-actions {
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
  margin-top: var(--s4);
}
.transfer-actions .primary-btn { flex: 1 1 auto; }

/* Bilgi kartı: durum ve uyarı metinleri için ortak kap. */
.info-card {
  display: flex;
  gap: var(--s3);
  margin: var(--s4) 0;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  background: var(--brand-soft);
  font-size: 13px;
  color: #1B4E3E;
}
.info-card .ph { color: var(--brand); margin-top: 1px; }
.info-card p { margin: 0; }

.info-card.is-warning { background: #FDF3E3; color: #6B4A12; }
.info-card.is-warning .ph { color: var(--amber); }

.info-card.is-danger { background: var(--danger-soft); color: #7C1D18; }
.info-card.is-danger .ph { color: var(--danger); }

/* Durum satırı: etiket solda, değer sağda, rozetli. */
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.status-row:first-of-type { border-top: 0; }
.status-label { color: var(--ink-2); }
.status-value { font-weight: 650; text-align: right; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px var(--s2);
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 650;
}
.badge-ok   { background: var(--brand-soft); color: #1B5E47; }
.badge-warn { background: #FDF3E3; color: #7A5510; }
.badge-bad  { background: var(--danger-soft); color: #8C201A; }

/* tanılama — status-row ile aynı iskelet */
.diag-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.diag-row:first-child { border-top: 0; }
.diag-label { color: var(--ink-2); flex-shrink: 0; }
.diag-value { font-weight: 650; text-align: right; }
.diag-ok   { color: #1B5E47; }
.diag-warn { color: #7A5510; }
.diag-bad  { color: var(--danger); }

/* ----------------------------------------------------------------- aktarım */

.qr-box {
  margin: 0 auto var(--s4);
  width: min(232px, 60vw);
  padding: var(--s3);
  border-radius: var(--r-lg);
  background: #fff;
  border: 1px solid var(--line);
}
.qr-box svg { display: block; width: 100%; height: auto; stroke: none; }

/* Kod: elle yazılabilir olmalı — sabit genişlik, iri, gruplu. */
.code-block {
  margin: 0 0 var(--s3);
  padding: var(--s4);
  border-radius: var(--r-md);
  background: var(--brand-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.07em;
  line-height: 1.7;
  color: #14513C;
  text-align: center;
  word-break: break-all;
  user-select: all;
}

/* ------------------------------------------------------------------- kasa */

.vault {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow-y: auto;
  padding: calc(var(--safe-top) + var(--s3)) var(--s4)
           calc(var(--s7) + var(--safe-bottom));
  background: var(--surface);
}

.vault-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s5);
}
.vault-top h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.vault-lead { margin: 0 0 var(--s4); font-size: 13.5px; color: var(--ink-2); }
.vault-warn { margin: 0 0 var(--s4); font-size: 12.5px; color: var(--ink-3); }
.vault-or {
  margin: var(--s4) 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
}

.vault-field { display: block; margin-bottom: var(--s3); }
.vault-field span {
  display: block;
  margin-bottom: var(--s1);
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
}
.vault-field input,
.vault-field textarea {
  width: 100%;
  padding: 0 var(--s4);
  height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  font-size: 15px;
}
.vault-field textarea { height: auto; padding: var(--s3) var(--s4); resize: vertical; }
.vault-field input:focus,
.vault-field textarea:focus { outline: none; border-color: var(--brand); }

.vault-check {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  margin: var(--s1) 0 var(--s4);
  font-size: 13.5px;
  color: var(--ink-2);
}
.vault-check input { margin-top: 3px; width: 18px; height: 18px; }

.vault-wide { width: 100%; }

.vault-error:not(:empty) {
  margin: 0 0 var(--s3);
  font-size: 13.5px;
  color: var(--danger);
}

.vault-inline { display: flex; gap: var(--s1); margin: 0 0 var(--s4); flex-wrap: wrap; }

.vault-tabs { display: flex; gap: var(--s1); margin-bottom: var(--s4); }
.vault-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 38px;
  padding: 0 var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink-2);
  cursor: pointer;
}
.vault-tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.vault-list { margin-bottom: var(--s4); }
.vault-empty {
  margin: var(--s6) 0;
  color: var(--ink-3);
  font-size: 13.5px;
  text-align: center;
}

.vault-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3);
  margin-bottom: var(--s2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}
.vault-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
}
.vault-icon img { width: 100%; height: 100%; object-fit: contain; padding: 7px; }
.vault-icon img.is-cover { padding: 0; object-fit: cover; }

.vault-row-body { flex: 1; min-width: 0; }
.vault-row-title {
  font-size: 14.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vault-row-sub {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vault-row-actions { display: flex; flex: 0 0 auto; }
.vault-row-actions .text-btn { min-height: 36px; padding: 0 var(--s2); font-size: 13px; }

.vault-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- okuyucu

   Arşivlenmiş sayfa metni. Panelin kendi tipografisiyle: aynı yazı ailesi,
   aynı renkler; yalnızca uzun metin için satır aralığı ve genişlik ayarlı. */

.reader-meta {
  margin: 0 0 var(--s2);
  font-size: 12.5px;
  color: var(--ink-3);
}
.reader-actions { margin: 0 0 var(--s3); flex-wrap: wrap; }
.reader-actions .text-btn { min-height: 36px; padding: 0 var(--s2); font-size: 13px; }
.text-btn.is-danger { color: var(--danger); }
.text-btn.is-danger:hover { background: var(--danger-soft); }

.reader {
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.reader p { margin: 0 0 0.9em; }
.reader h3 {
  margin: 1.3em 0 0.5em;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.35;
}
.reader h3:first-child { margin-top: 0; }
.reader .reader-item {
  position: relative;
  margin-bottom: 0.45em;
  padding-inline-start: 1.1em;
}
.reader .reader-item::before {
  content: "";
  position: absolute;
  inset-inline-start: 0.2em;
  top: 0.68em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-3);
}
.reader mark {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--brand-soft);
  color: inherit;
  box-shadow: inset 0 -2px 0 var(--brand);
}

/* Koleksiyon seçimi: seçili satır marka rengiyle işaretli. */
.collection-list { margin: var(--s2) 0 var(--s3); }
.sheet-item.is-on .ph:first-child { color: var(--brand); }
.browse-chip.is-on {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.browse-chip.is-on .ph { color: var(--brand); }
.add-collections { margin: var(--s3) 0 0; }
.detail-collections {
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-collections .ph { width: 14px; height: 14px; flex: none; }

/* ---------------------------------------------------------------- bildirim */

.toast {
  position: fixed;
  /* Ortalanmış, içeriği kadar geniş bir kutu. Boydan boya uzanan bir şerit
     kısa bir mesaj için fazla yer kaplıyor ve arayüzün parçası gibi
     duruyordu. Genişlik için transform kullanmıyoruz: giriş/çıkış
     animasyonları translateY ile çalışıyor, ikisi çakışırdı. */
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  max-width: min(92vw, 420px);
  bottom: calc(140px + var(--safe-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  background: var(--ink);
  color: #EAF2F1;
  font-size: 14px;
  box-shadow: var(--lift-toast);
  animation: toast-in 200ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.toast-text { flex: 1; min-width: 0; }
.toast button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 var(--s2);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: #74E0B6;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* Kapanış: aniden yok olmak yerine kısa bir sönme. */
.toast.is-leaving {
  animation: toast-out 220ms ease forwards;
  pointer-events: none;
}

@keyframes toast-out {
  from { transform: none; opacity: 1; }
  to   { transform: translateY(6px); opacity: 0; }
}

/* ---------------------------------------------------------- sağdan sola
   Arapçada yerleşim aynalanmalı. Yön bağımlı olan az sayıda yeri burada
   düzeltiyoruz; geri kalan her şey flex ve gap kullandığı için kendiliğinden
   dönüyor. */

[dir="rtl"] .card-title,
[dir="rtl"] .card-meta,
[dir="rtl"] .vault-row-title,
[dir="rtl"] .vault-row-sub,
[dir="rtl"] .sheet-item,
[dir="rtl"] .menu-label { text-align: right; }

[dir="rtl"] .card { text-align: right; }

[dir="rtl"] .fab { right: auto; left: var(--s4); }

[dir="rtl"] .status-value,
[dir="rtl"] .diag-value { text-align: left; }

/* Geri oku yön değiştirmeli: sağdan sola okurken "geri" sağa bakar. */
[dir="rtl"] #btn-search-close .ph,
[dir="rtl"] .text-btn .ph.is-directional { transform: scaleX(-1); }

/* Kod ve karekod her dilde soldan sağa okunur. */
[dir="rtl"] .code-block { direction: ltr; }

/* ---------------------------------------------------------- geniş ekran

   Uygulama telefon için tasarlandı ve masaüstünde olduğu gibi geriliyordu:
   kartlar 1920 piksel boyunca uzuyor, alt gezinme tüm genişliği kaplıyor,
   kayan düğme içerikten kopuk bir köşede duruyordu.

   Çözüm sütun genişliğini sınırlamak. İki sütunlu bir ızgara denemedim:
   bu bir liste ve "son ziyaret edilenler" gibi raflar sıralı okunuyor; iki
   sütun okuma sırasını belirsizleştirirdi.

   Eşik 720px: tabletin dik hâli hâlâ telefon yerleşimini alıyor, yatay
   çevirince masaüstü yerleşimine geçiyor. */

@media (min-width: 720px) {
  :root { --column: 680px; }

  .topbar,
  .tagline,
  .search,
  .quick,
  .summary,
  .shelf {
    max-width: var(--column);
    margin-left: auto;
    margin-right: auto;
  }

  /* Üst şerit tüm genişlikte yapışkan kalmalı, içeriği ortalanmalı. */
  .topbar {
    max-width: none;
    padding-left: calc((100vw - var(--column)) / 2 + var(--s5));
    padding-right: calc((100vw - var(--column)) / 2 + var(--s4));
  }

  /* Alt gezinme ekranın dibine yapışmak yerine sütunun altında yüzen bir
     şerit. Tüm genişliği kaplaması masaüstünde telefon taklidi gibi
     duruyordu. */
  .bottom-nav {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: min(var(--column), calc(100vw - 2 * var(--s4)));
    margin-bottom: var(--s4);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--lift-fab);
  }

  /* Kayan düğme sütunun sağ kenarına hizalansın, ekranın değil. */
  .fab {
    right: max(var(--s4), calc((100vw - var(--column)) / 2));
  }

  /* Bildirim kutusuna dokunmuyoruz: tabanda zaten `margin: auto` ile
     ortalanıyor. transform ile ortalamak, giriş/çıkış animasyonlarının
     translateY'siyle çakışırdı. */

  /* Fare varken kartlar biraz daha belirgin tepki versin. */
  .card:hover { border-color: #C9D6D2; }

  /* Alt sayfalar ekranın tamamına yayılmasın. */
  .sheet > .sheet-surface { max-width: var(--column); }
}

/* Çok geniş ekranlarda sütun büyümüyor: satır uzunluğu okunabilirliğin
   sınırı, ekran genişliği değil. */

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

/* Karanlık kip bileşen ayarları — DOSYANIN SONUNDA.
   Önceden :root'un hemen altındaydı; aynı özgüllükteki asıl kurallar daha
   sonra geldiği için hiçbiri uygulanmıyordu (ör. açık yeşil düğmede beyaz
   yazı, okunurluk 2.3:1). */
@media (prefers-color-scheme: dark) {
  /* Açık yeşil zeminde koyu yazı okunuyor; beyaz okunmuyor. */
  .primary-btn { color: #08201A; }
  .fab { color: #08201A; }
  .toast { background: #1E2C30; }
  .thumb, .vault-icon { background: var(--brand-soft); }
  .card-media .thumb-icon, .quick-logo .thumb-icon { background: transparent; }
  .bottom-nav { box-shadow: none; }
}
