/* adigebze.org — tasarım değerleri ve bileşenler (docs/design.md). Önce mobil (390 px), sonra tablet ve masaüstü. */

@font-face {
  font-family: "PT Sans";
  src: url("../fonts/pt-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PT Sans";
  src: url("../fonts/pt-sans-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Tema ------------------------------------------------------------------------------------------------------ */

:root {
  color-scheme: light;
  --bg: #FAF9F5;
  --surface: #FFFFFF;
  --card-head: #EFEDE6;
  --hover: #F0EEE6;
  --text: #141413;
  --body: #2E2D2A;
  --text2: #4D4C48;
  --text3: #73726C;
  --border: rgba(31, 30, 29, 0.15);
  --border2: rgba(31, 30, 29, 0.3);
  --input-border: rgba(31, 30, 29, 0.5);
  --button: #B5532F;
  --accent: #C6613F;
  --link: #B5532F;
  --mark: #F0E3D6;
  --info: rgba(198, 97, 63, 0.08);
  --shadow: 0 1px 0 rgba(31, 30, 29, 0.08), 0 4px 14px rgba(31, 30, 29, 0.07);
  --popup-shadow: 0 12px 32px rgba(31, 30, 29, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #262624;
    --surface: #30302E;
    --card-head: #3A3A37;
    --hover: #3A3A37;
    --text: #FAF9F5;
    --body: #DEDCD3;
    --text2: #C2C0B6;
    --text3: #9C9A92;
    --border: rgba(222, 220, 209, 0.15);
    --border2: rgba(222, 220, 209, 0.28);
    --input-border: rgba(222, 220, 209, 0.45);
    --button: #B5532F;
    --accent: #D97757;
    --link: #E59578;
    --mark: #4D4C48;
    --info: rgba(217, 119, 87, 0.12);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 6px 16px rgba(0, 0, 0, 0.32);
    --popup-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #262624;
  --surface: #30302E;
  --card-head: #3A3A37;
  --hover: #3A3A37;
  --text: #FAF9F5;
  --body: #DEDCD3;
  --text2: #C2C0B6;
  --text3: #9C9A92;
  --border: rgba(222, 220, 209, 0.15);
  --border2: rgba(222, 220, 209, 0.28);
  --input-border: rgba(222, 220, 209, 0.45);
  --button: #B5532F;
  --accent: #D97757;
  --link: #E59578;
  --mark: #4D4C48;
  --info: rgba(217, 119, 87, 0.12);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 6px 16px rgba(0, 0, 0, 0.32);
  --popup-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

/* --- Temel ----------------------------------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

/* `hidden` özniteliği her zaman gizler (bileşenlerin display kuralları onu ezmesin: paloçka notu Türkçe yazarken de
   görünüyordu) */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
/* Sabit üst çubuk: bağlantı hedefi ve klavyeyle odaklanan öğe altında kalmasın. html'deki scroll-padding-top
   kullanılmaz: tarayıcı üst çubuktaki arama kutusuna yazarken imleci "görünür yapmak" için sayfayı kaydırıyordu. */
.page * { scroll-margin-top: 80px; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "PT Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

a { color: var(--link); }
button { font: inherit; color: inherit; }
svg { flex: none; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 20;
  padding: 10px 14px; border-radius: 10px; background: var(--surface); color: var(--text);
}
.skip-link:focus { top: 12px; }

mark { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 3px; }
/* Sözcük içindeki harf vurgusu ("Bunu mu demek istediniz?"): yatay boşluk sözcüğü bölmesin */
mark.letter-mark { padding: 0; border-radius: 2px; }

.icon-button {
  width: 44px; height: 44px;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--text2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-button:hover { background: var(--hover); }

/* Tema düğmesi: açık temada ay (koyuya geç), koyu temada güneş */
.theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-icon-moon { display: none; }
}

/* --- Sayfa iskeleti ---------------------------------------------------------------------------------------------- */

.page { width: 100%; padding: 0 20px; flex: 1; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 720px; margin: 0 auto; }

/* --- Üst çubuk --------------------------------------------------------------------------------------------------- */

/* Kaydırınca da en üstte sabit (logo, arama kutusu, bağlantılar, menü) */
.topbar {
  position: sticky; top: 0; z-index: 3;
  height: 64px; padding: 0 12px 0 20px;
  background: var(--bg); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 6px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px;
  font-size: 19px; font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap;
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topbar-nav { display: none; }
.topbar-nav a {
  min-height: 44px; padding: 0 12px; white-space: nowrap;
  display: flex; align-items: center;
  font-size: 15px; color: var(--text2); text-decoration: none; border-radius: 10px;
}
.topbar-nav a[aria-current="page"] { color: var(--text); }
.topbar-nav a:hover { background: var(--hover); }
.topbar-nav a.support-link, .menu-nav a.support-link { color: var(--link); }

/* Sonuç sayfalarında mobil üst çubuk: yalnız simge, arama kutusu, menü */
.topbar--search { padding: 0 12px 0 8px; }
.topbar--search .brand { width: 44px; justify-content: center; }
.topbar--search .brand-name { display: none; }
.topbar--search .topbar-search { flex: 1; min-width: 0; }
.topbar--search .theme-toggle { display: none; }
.topbar--search .topbar-actions { margin-left: 0; }

/* --- Arama kutusu ------------------------------------------------------------------------------------------------ */

.search { position: relative; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  height: 56px; padding: 0 6px 0 18px;
  background: var(--surface);
  border: 0.5px solid var(--input-border); border-radius: 16px;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.search-input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 17px; color: var(--text);
}
.search-input::placeholder { color: var(--text3); }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-submit {
  width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 12px;
  background: var(--button); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.search-back, .search-clear { display: none; }
.search-clear { width: 40px; height: 40px; color: var(--text3); }

.topbar .search-box { height: 44px; padding: 0 4px 0 14px; border-radius: 14px; }
.topbar .search-submit { width: 36px; height: 36px; border-radius: 10px; }

.search-panel {
  display: none;
  flex-direction: column; gap: 8px;
}
.search-panel.is-open { display: flex; }

/* Paloçka bilgi notu */
.info-note {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--info); border-left: 3px solid var(--accent);
  font-size: 14px; line-height: 1.45; color: var(--text);
}
.info-note svg { margin-top: 1px; color: var(--link); }
.info-note-example { display: block; margin-top: 4px; font-size: 13px; color: var(--text2); }

/* Öneri listesi */
.suggestions { margin: 0; padding: 0; list-style: none; }
.suggestion {
  min-height: 52px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 0.5px solid var(--border);
  color: var(--text); text-decoration: none; cursor: pointer;
}
.suggestion svg { color: var(--text3); }
.suggestion-text { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.suggestion-key { font-size: 18px; overflow-wrap: normal; white-space: nowrap; }
.suggestion-gloss {
  font-size: 14px; color: var(--text3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.suggestion[aria-selected="true"] { background: var(--hover); }

/* Mobilde arama kutusuna dokununca: kutu en üste çıkar, başlıklar kaybolur (ana sayfa ve sonuç sayfaları) */
html.is-searching, body.is-searching { overflow: hidden; }
body.is-searching .search--focusable {
  position: fixed; inset: 0; z-index: 10;
  top: var(--search-top, 0px); bottom: auto; height: var(--search-height, 100dvh);
  background: var(--bg);
  display: flex; flex-direction: column;
}
body.is-searching .search--focusable .search-bar {
  padding: 10px 12px 10px 8px;
  display: flex; align-items: center; gap: 4px;
  box-shadow: var(--shadow);
}
body.is-searching .search--focusable .search-box {
  flex: 1; height: 48px; padding: 0 4px 0 14px;
  border: 1px solid var(--accent); border-radius: 14px;
}
body.is-searching .search--focusable .search-back { display: inline-flex; }
body.is-searching .search--focusable .search-submit { display: none; }
body.is-searching .search--focusable .search-clear { display: inline-flex; }
body.is-searching .search--focusable .search-panel { padding: 12px 16px 0; overflow-y: auto; flex: 1; }
body.is-searching .search--focusable .suggestions { padding: 0 4px; }

/* Kiril ekran klavyesi (docs/design.md "Ekran klavyesi"): yalnız fare/dokunmatik yüzey kullanılan, en az 768 px
   genişlikteki ekranlarda. Telefon ve tablette simge görünmez, panel açılmaz. */
.kb-toggle, .osk { display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 768px) {
  .kb-toggle {
    width: 44px; height: 44px; flex: none;
    border: 0; border-radius: 12px;
    background: transparent; color: var(--text2);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
  }
  .kb-toggle:hover { background: var(--hover); }
  .kb-toggle[aria-pressed="true"] { background: var(--hover); color: var(--text); }
  .topbar .kb-toggle { width: 36px; height: 36px; border-radius: 10px; }

  /* Panel arama kutusuyla aynı genişlikte ve hizada (öneri penceresi gibi); aynı köşe (16 px) ve kenarlık (0,5 px).
     Kutunun hemen altında sabit durur; öneriler panelin altında açılır (öneri sayısı değişince tuşlar kaymaz). */
  .osk:not([hidden]) {
    position: absolute; z-index: 6;
    top: calc(100% + 8px); left: 0; right: 0;
    padding: 12px; border-radius: 16px;
    background: var(--surface); border: 0.5px solid var(--border2);
    box-shadow: var(--popup-shadow);
    display: flex; flex-direction: column; gap: 6px;
  }
  /* Tuş birimi: en uzun sıra (12 tuş + 11 aralık) panelin içine sığar, en fazla 44 px. Bütün tuşlar ve aralıklar
     eşit; geniş tuşlar birimin katı (Ӏ, Sil, Kapat = 2 tuş + 1 aralık; boşluk = 7 tuş + 6 aralık). */
  .osk-row {
    --gap: 6px;
    --key: min(44px, calc((100% - 11 * var(--gap)) / 12));
    display: flex; justify-content: center; gap: var(--gap);
  }
  .osk-key {
    width: var(--key); height: 44px; flex: none;
    border: 0.5px solid var(--border); border-radius: 8px;
    background: var(--bg); color: var(--text);
    font-size: 18px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
  }
  .osk-key:hover { background: var(--hover); }
  .osk-key:active { transform: translateY(1px); }
  .osk-key--backspace, .osk-key--palochka, .osk-key--close { width: calc(2 * var(--key) + var(--gap)); }
  .osk-key--space { width: calc(7 * var(--key) + 6 * var(--gap)); font-size: 14px; color: var(--text3); }
  .osk-key--close { font-size: 14px; color: var(--text2); }

  /* Klavye açıkken öneriler ve paloçka notu panelin altında; ikisi üst üste binmez */
  .search.osk-open .search-panel { top: calc(100% + 8px + var(--osk-height, 218px) + 8px); }
}

/* --- Ana sayfa ----------------------------------------------------------------------------------------------- */

.home { padding-top: 150px; display: flex; flex-direction: column; gap: 14px; }
.home-titles { margin: 0 0 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.home-title { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 700; }
.home-subtitle { margin: 0; font-size: 16px; line-height: 1.3; color: var(--text3); }

/* Mobil ana sayfa: akışta yer kaplamaz (eksi alt boşluk), arama alanının ve alt bölümün yeri değişmez */
.home-support {
  position: relative; top: -24px; z-index: 1;
  margin-top: auto; margin-bottom: -44px; align-self: center;
  height: 44px; padding: 0 16px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 12px; background: var(--button);
  font-size: 15px; font-weight: 700; color: #FFFFFF; text-decoration: none;
}
.home-support + .guide-link { margin-top: 0; }
.guide-link {
  margin-top: auto; align-self: center;
  min-height: 44px; padding-top: 40px;
  display: flex; align-items: center; gap: 6px;
  font-size: 15px; color: var(--link); text-decoration: none;
}

/* --- Destek Ver sayfası ------------------------------------------------------------------------------------- */

.support-page { width: 100%; max-width: 480px; margin: 0 auto; padding: 12px 0 32px; }
.support-back {
  min-height: 44px; margin-bottom: 4px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 15px; color: var(--link); text-decoration: none;
}
.support-page h1 { margin: 0 0 14px; font-size: 26px; font-weight: 700; }
.support-page .form { display: flex; flex-direction: column; gap: 12px; }
.support-page .button { margin-top: 6px; width: 100%; }
.support-done { margin: 0; font-size: 16px; }
.support-done:focus { outline: 0; }

/* --- Alt bilgi ----------------------------------------------------------------------------------------------- */

.footer {
  margin-top: 8px; padding: 18px 0 24px;
  border-top: 0.5px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
  text-align: center; font-size: 13px; color: var(--text3);
}
.page > .footer { margin-top: auto; }
.form-note a { color: inherit; }
.form-note { margin: 0; font-size: 13px; color: var(--text3); }
.guide-link + .footer { margin-top: 8px; }

/* --- Menü (mobil) -------------------------------------------------------------------------------------------- */

.menu {
  position: fixed; inset: 0; z-index: 12;
  padding: 0 20px;
  background: var(--bg);
  display: flex; flex-direction: column;
}
.menu[hidden] { display: none; }
.menu-head { height: 64px; display: flex; justify-content: space-between; align-items: center; }
.menu-nav { padding-top: 20px; display: flex; flex-direction: column; border-top: 0.5px solid var(--border); }
.menu-nav a {
  min-height: 56px; display: flex; align-items: center;
  border-bottom: 0.5px solid var(--border);
  font-size: 22px; color: var(--text); text-decoration: none;
}
.menu-foot {
  margin-top: auto; padding: 18px 0 24px;
  display: flex; flex-direction: column; gap: 2px;
  text-align: center; font-size: 13px; color: var(--text3);
}
.theme-switch {
  align-self: center; margin-bottom: 18px;
  display: flex; gap: 4px; padding: 4px;
  border-radius: 999px; border: 0.5px solid var(--border);
}
.theme-switch button {
  width: 44px; height: 44px; border-radius: 50%;
  border: 0.5px solid transparent; background: transparent; color: var(--text3);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.theme-switch button[aria-checked="true"] { border-color: var(--border2); background: var(--surface); color: var(--text); }

/* --- Sonuç sayfası ------------------------------------------------------------------------------------------- */

.results { padding: 30px 0 32px; display: flex; flex-direction: column; gap: 18px; }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.result-title { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 700; }
/* Türkçe karakter yedeği birden çok madde başına uyduysa (docs/search.md bölüm 3 adım 5) */
.also-search { margin: -10px 0 0; font-size: 15px; line-height: 1.4; color: var(--text2); }
.share-button {
  width: 44px; height: 44px; flex: none;
  border: 0.5px solid var(--input-border); border-radius: 12px;
  background: transparent; color: var(--text2);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.share-button:hover { background: var(--hover); }

/* Kaynak kartı */
/* Kartlarda italik yok (okumayı zorlaştırıyor; proje sahibi, 26 Ekim 2026): bilimsel ad da düz. "Kitapta geçtiği
   hali" (.book) kitaptaki gibi kalır, italikleri dahil. */
.card i, .card em { font-style: normal; }
.card .book i, .card .book em { font-style: italic; }
.card {
  background: var(--surface);
  border: 0.5px solid var(--border); border-radius: 14px;
  overflow: hidden;
}
.card > summary { list-style: none; }
.card > summary::-webkit-details-marker { display: none; }
.card-head {
  padding: 2px 8px 2px 16px;
  background: var(--card-head);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  cursor: pointer;
}
.card[open] > .card-head { border-bottom: 0.5px solid var(--border); }
.card-title { margin: 0; font-size: 14px; font-weight: 700; color: var(--text2); }
.chevron {
  width: 44px; height: 44px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text3);
}
details:not([open]) > summary .chevron svg { transform: rotate(180deg); }
.card-body { padding: 10px 16px 0; }
/* Diyalekt başlığı olmayan kartta (Abaze) ilk satırın üst çizgisi başlık şeridinin hemen altına düşmesin */
.card-body > .entry:not(.expl-entry):first-child > :first-child,
.card-body > .entry:first-child > .senses:first-child > .sense:first-child,
.card-body > .reverse-intro:first-child,
.card-body > .meaning:first-child { border-top: 0; padding-top: 2px; }

/* Eş sesli maddeler arasında tek çizgi (border2, satır çizgilerinden biraz koyu): yeni maddenin ilk satırının ya da
   notunun kendi üst çizgisi kaldırılır, yoksa iki çizgi üst üste görünür */
.entry + .entry { border-top: 0.5px solid var(--border2); }
.entry + .entry > :first-child,
.entry + .entry > .senses:first-child > .sense:first-child { border-top: 0; }
.entry-meta {
  padding: 8px 0 4px; border-top: 0.5px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  font-size: 14px; color: var(--text3);
}
.entry-meta i { color: var(--text2); }
/* Not (ya da alan etiketi) altındaki ilk satırla birlikte tek öğe: aralarında çizgi yok ("Bu maddedeki ifadeler"
   listesindeki gibi). Çizgiler yalnız maddeler ve aynı maddenin satırları arasında. */
.entry-meta + .senses > .sense:first-child { border-top: 0; padding-top: 2px; }
/* Karşılık grubunun etiketi ("onun gözü"): notla aynı görünüm, gruplarıyla tek öğe */
.row-label { padding: 4px 0 2px; font-size: 14px; color: var(--text3); }

/* Huvaj: üç grup (Ortak, Doğu, Batı). Solda küçük büyük harfli etiket (12 px, kalın, text3), sağda alt alta
   sözcükler (18 px). Gruplar arasında çizgi yok; bloklar (etiketli karşılık grupları) ince çizgiyle ayrılır. */
.dblock { padding: 6px 0 8px; }
.entry > .dblock:first-child { padding-top: 10px; }
.entry-meta + .dblock { padding-top: 0; }
.dblock + .dblock { border-top: 0.5px solid var(--border); }
.dgroup {
  padding: 4px 0;
  display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 12px; align-items: baseline;
}
.dgroup-label { font-size: 12px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; color: var(--text3); }
.dgroup-terms { display: flex; flex-direction: column; font-size: 18px; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
.dgroup-terms > span { padding: 2px 0; }
.dgroup-terms mark { font-weight: 700; }

.senses { margin: 0; padding: 0; list-style: none; }
.sense {
  padding: 9px 0; border-top: 0.5px solid var(--border);
  display: grid; grid-template-columns: 24px minmax(0, 1fr);
  align-items: baseline;  /* numara ile karşılığın ilk satırı aynı çizgide */
  font-size: 19px; line-height: 1.35;
}
.sense--plain { grid-template-columns: minmax(0, 1fr); }
.sense-no { font-size: 14px; color: var(--text3); }
.sense-terms { display: flex; flex-direction: column; gap: 4px; }

.entry-note { padding: 0 0 8px; font-size: 15px; color: var(--text2); }

/* Açılır bölümler: "Bu maddedeki ifadeler", "Kitapta geçtiği hali" */
.fold { border-top: 0.5px solid var(--border); }
.fold > summary {
  min-height: 48px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 15px; color: var(--link);
  list-style: none; cursor: pointer;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .chevron { width: 18px; height: 18px; color: inherit; }
.fold:not([open]) > summary .chevron svg { transform: rotate(180deg); }
.phrases { padding-bottom: 8px; display: flex; flex-direction: column; }
.phrase { padding: 8px 0; border-top: 0.5px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.phrase-text { font-size: 15px; color: var(--text2); }
.phrase-terms { font-size: 17px; display: flex; flex-direction: column; gap: 2px; }  /* karşılıklar satır satır */
.phrase.is-match .phrase-text { color: var(--text); }
/* Huvaj ifade maddesi: Doğu | Batı satırları ifade adıyla tek öğe, aralarında çizgi yok */
.phrase--rows .dblock { padding: 2px 0 0; }
.book {
  margin: 0 0 12px; padding: 10px 12px;
  border-left: 2px solid var(--border2); border-radius: 0 10px 10px 0;
  background: var(--bg);
  font-size: 15px; line-height: 1.6; color: var(--text2);
}
.book b { color: var(--text); }
.book p { margin: 0; }
.book p + p { margin-top: 8px; }
.book-note { display: block; margin-top: 6px; font-size: 13px; color: var(--text3); }

/* Çerkesçe aramada anlam grupları */
.meaning { padding: 12px 0 4px; border-top: 0.5px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.meaning .dblock { padding: 2px 0 4px; }
.meaning-title { display: flex; flex-direction: column; }
.meaning-heading { font-size: 19px; font-weight: 700; }
.meaning-note { font-size: 14px; color: var(--text3); }
/* Çerkesçe kartta kitaptaki göndermeler ("шы → къош") */
.see-also { margin: 0; padding: 12px 0; border-top: 0.5px solid var(--border); font-size: 15px; color: var(--text2); }
.card-body > .meaning:last-child, .card-body > .reverse-link:last-child { margin-bottom: 4px; }

/* Abaze: karşılık olarak geçtiği maddeler */
.reverse-intro { margin: 0; padding: 8px 0; border-top: 0.5px solid var(--border); font-size: 14px; color: var(--text2); }
.reverse-link {
  min-height: 48px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border-top: 0.5px solid var(--border);
  color: var(--text); text-decoration: none;
}
.reverse-link:hover { background: var(--hover); }
.reverse-link-text { display: flex; align-items: baseline; gap: 8px; }
.reverse-link-word { font-size: 18px; font-weight: 700; }
.reverse-link-label { font-size: 14px; color: var(--text3); }
.reverse-link svg { color: var(--text3); }

/* Açıklamalı sözlük kartı (docs/design.md "Açıklamalı sözlük kartı"): madde satırı (fiil biçimi, etiket hapı),
   numaralı anlamlar, Rusça satır (1999), örnek ve soluk kaynak, "+N örnek", "Еплъ: …", kapalı ifade bölümleri */
.expl-entry { padding-bottom: 4px; }
.expl-entry + .expl-entry { padding-top: 12px; }
.expl-headword { margin: 0 0 8px; font-size: 19px; font-weight: 700; }
.expl-part + .expl-part { padding-top: 12px; border-top: 0.5px solid var(--border2); }
/* Eş sesliye gönderme bağlantısıyla gelinen bölüm ("#s3-es2") kısa süre vurgulanır */
.expl-part[id], .expl-entry[id] { border-radius: 8px; }
.expl-part:target, .expl-entry:target { animation: target-flash 2.4s ease-out; }
@keyframes target-flash { from { background: var(--mark); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .expl-part:target, .expl-entry:target { animation: none; background: var(--mark); }
}
.expl-block { display: flex; flex-direction: column; gap: 8px; }
.expl-part > .expl-block { padding-bottom: 8px; }
.expl-block > p { margin: 0; }
.expl-sense { padding: 12px 0 0; border-top: 0.5px solid var(--border); }
/* Kendi tanımı olmayan bölümde ilk anlamın üstünde çizgi yok (üstünde ayrılacak bir şey yok) */
.expl-block > .expl-sense:first-child { padding-top: 0; border-top: 0; }
.expl-block > .expl-sense:last-child { padding-bottom: 0; }
.expl-headline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; font-size: 17px; color: var(--text2); }
.expl-def { font-size: 17px; line-height: 1.5; }
.expl-no { color: var(--text3); font-weight: 700; }
.expl-ru { display: flex; gap: 8px; align-items: baseline; font-size: 14px; line-height: 1.45; color: var(--text3); }
.ru-tag {
  flex: none; padding: 0 5px;
  border: 0.5px solid var(--border2); border-radius: 4px;
  font-size: 11px; letter-spacing: 0.3px;
}
.expl-equiv { font-size: 16px; color: var(--text2); }
.expl-example { font-size: 16px; line-height: 1.55; color: var(--body); overflow-wrap: anywhere; }
/* Açıklama ile örnekler arasında: anlam çizgisinden ayırt edilsin diye noktalı */
.expl-example--first { padding-top: 8px; border-top: 1px dotted var(--border); }
.expl-source { display: block; margin-top: 3px; font-size: 13px; font-style: normal; color: var(--text3); }
.expl-see { font-size: 16px; color: var(--text2); }
.expl-see-label { color: var(--text2); }
.expl-see a, .expl-def a { text-decoration-thickness: 0.5px; text-underline-offset: 3px; }

/* Etiket hapı; dokununca Türkçe açıklaması (app/static/js/site.js, data-label-tip) */
.label { position: relative; display: inline-block; }
.label-pill {
  display: inline-block; padding: 1px 8px;
  border: 0.5px solid var(--border2); border-radius: 999px; background: transparent;
  font: inherit; font-size: 13px; font-weight: 400; line-height: 1.5; color: var(--text2);
  vertical-align: 2px;
}
button.label-pill { cursor: pointer; }
button.label-pill:hover, button.label-pill[aria-expanded="true"] { background: var(--hover); color: var(--text); }
/* Dokunma alanı 44 px: hap küçük görünür, basılabilir alan dışa taşar */
button.label-pill { position: relative; }
button.label-pill::after { content: ""; position: absolute; inset: -12px -4px; }
.label-tip {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 3;
  padding: 8px 12px; border-radius: 10px;
  background: var(--hover); border: 0.5px solid var(--border2); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  font-size: 14px; font-style: normal; line-height: 1.3; color: var(--text); white-space: nowrap;
}
.label-tip[hidden] { display: none; }

/* "+N örnek" ve "N deyim daha": açılınca düğme kaybolur, kalan içerik yerinde görünür */
.more { display: flex; flex-direction: column; gap: 8px; }
.more > summary {
  align-self: flex-start; min-height: 32px;
  display: flex; align-items: center;
  font-size: 14px; color: var(--link);
  list-style: none; cursor: pointer;
}
.more > summary::-webkit-details-marker { display: none; }
.more[open] > summary { display: none; }
.expl-block > .more:not([open]) { margin-top: -4px; }

/* İfade bölümleri: "Deyimler (22)", "Atasözleri (1)", "Bu maddedeki ifadeler (18)" */
.expl-phrase-list { padding-bottom: 8px; }
.expl-phrase { padding: 12px 0; border-top: 0.5px solid var(--border); gap: 6px; }
.expl-phrase-head { font-size: 17px; font-weight: 700; }
.expl-phrase .expl-sense { padding-bottom: 0; }
.more-phrases > summary {
  align-self: stretch; min-height: 44px; margin: 4px 0;
  justify-content: center;
  border: 0.5px solid var(--border2); border-radius: 10px;
}
.more-phrases { gap: 0; }

/* Düzeltme Öner: her kaynak kartının en altında, ince çizgiyle ayrılmış satır; sağa yaslı, düşük vurgulu (text3) */
.card-foot { display: flex; justify-content: flex-end; border-top: 0.5px solid var(--border); }
.correction-button {
  min-height: 44px; padding: 0 2px;
  border: 0; background: transparent;
  font-size: 14px; color: var(--text3);
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.correction-button:hover { color: var(--text2); }

/* --- Sonuç bulunamadı ------------------------------------------------------------------------------------------ */

.not-found { padding: 28px 0 32px; display: flex; flex-direction: column; gap: 22px; }
.not-found-head { display: flex; align-items: flex-start; gap: 12px; }
.not-found-head svg { margin-top: 2px; color: var(--text3); }
.not-found-title { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 700; }
.not-found-text { margin: 4px 0 0; font-size: 15px; line-height: 1.45; color: var(--text2); }

.dym { background: var(--surface); border: 0.5px solid var(--border); border-radius: 14px; overflow: hidden; }
.dym-title { margin: 0; padding: 10px 16px; background: var(--card-head); font-size: 14px; font-weight: 700; color: var(--text2); }
.dym ul { margin: 0; padding: 0 16px; list-style: none; }
.dym a {
  min-height: 56px;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  border-top: 0.5px solid var(--border);
  color: var(--text); text-decoration: none;
}
.dym li:first-child a { border-top: 0; }
.dym-key { font-size: 18px; }
.dym-gloss { font-size: 14px; color: var(--text3); }

.tips { display: flex; flex-direction: column; gap: 8px; }
.tips-title { margin: 0; font-size: 15px; font-weight: 700; }
.tips ul { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.45; color: var(--text2); }
.tips b { color: var(--text); }

/* --- Metin sayfaları (rehber, hakkında) ----------------------------------------------------------------------- */

.prose { padding: 32px 4px 48px; display: flex; flex-direction: column; gap: 36px; }
.prose h1 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.2px; }
.prose section { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 104px; }
.prose h2 { margin: 0 0 2px; font-size: 20px; line-height: 1.3; font-weight: 700; }
.prose p { margin: 0; font-size: 17px; line-height: 1.65; color: var(--body); }
.prose b { color: var(--text); }
.legal-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 17px; line-height: 1.65; color: var(--body); }
.prose .eyebrow {
  margin-top: 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--text3);
}
.examples {
  background: var(--surface); border: 0.5px solid var(--border); border-radius: 12px;
  padding: 4px 14px;
}
.example {
  display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
  align-items: baseline; gap: 8px; padding: 9px 0; font-size: 17px;
}
.example + .example { border-top: 0.5px solid var(--border); }
.example-from { color: var(--text2); }
.example-arrow { color: var(--text3); }
.source-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.source-item {
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 0.5px solid var(--border);
  font-size: 16px; line-height: 1.5; color: var(--body);
}
.source-item b { display: block; color: var(--text); }

.toc { display: none; }

/* --- Bildirim (paylaşım: "Bağlantı kopyalandı") ---------------------------------------------------------------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 30;
  transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px);
  padding: 10px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg);
  font-size: 15px; box-shadow: var(--popup-shadow);
}
.toast[hidden] { display: none; }

/* --- Tablet: 768–1023 px ----------------------------------------------------------------------------------------- */

@media (min-width: 768px) {
  .page { padding: 0 32px; }
  .content { max-width: 640px; }

  .page * { scroll-margin-top: 88px; }
  .prose section { scroll-margin-top: 112px; }
  .topbar { height: 72px; padding: 0 32px; }
  .topbar-nav { display: flex; align-items: center; gap: 4px; }
  .home-support { display: none; }
  .home-support + .guide-link { margin-top: auto; }
  .menu-button { display: none; }

  .topbar--search { padding: 0 24px 0 20px; gap: 12px; }
  .topbar--search .theme-toggle { display: inline-flex; }
  .topbar--search .topbar-nav a { padding: 0 10px; }
  .topbar .search-box { height: 48px; padding: 0 6px 0 18px; border-radius: 16px; }
  .topbar .search-submit { width: 36px; height: 36px; border-radius: 12px; }

  /* Masaüstünde öneriler kutunun altında açılan pencerede */
  .search-panel {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 5;
    padding: 10px; border-radius: 16px;
    background: var(--surface); border: 0.5px solid var(--border2);
    box-shadow: var(--popup-shadow);
  }
  /* Masaüstü: not tek satır; örnek aynı boyutta, soluk renkte, cümleyle aynı satırda; simge satırın ortasında */
  .search-panel .info-note { align-items: center; }
  .search-panel .info-note svg { margin-top: 0; }
  .search-panel .info-note-example { display: inline; margin: 0; font-size: inherit; }
  .suggestion { min-height: 44px; padding: 0 16px; border-bottom: 0; border-radius: 10px; }
  .suggestion svg { display: none; }
  .suggestion-key { font-size: 17px; }
  .suggestion:hover { background: var(--hover); }

  .home { width: 100%; max-width: 640px; margin: 0 auto; }
  .home-title { font-size: 40px; }
  .home-subtitle { font-size: 18px; }
  .home .search-input { font-size: 18px; }

  .footer { flex-direction: row; justify-content: center; gap: 18px; padding: 20px 0 28px; }
  .results { padding-top: 40px; gap: 20px; }
}

/* --- Masaüstü: 1024+ px ---------------------------------------------------------------------------------------- */

@media (min-width: 1024px) {
  .content { max-width: 720px; }

  /* Sonuç sayfalarında üst çubuk: solda logo + ad, ortada 560 px arama kutusu, sağda bağlantılar ve tema */
  .topbar--search { display: grid; grid-template-columns: 1fr minmax(0, 560px) 1fr; gap: 24px; padding: 0 32px; }
  .topbar--search .brand { width: auto; justify-content: flex-start; }
  .topbar--search .brand-name { display: inline; }
  .topbar--search .topbar-actions { justify-self: end; }
  .topbar--search .topbar-nav a { padding: 0 12px; }
  .prose-layout {
    width: 100%; max-width: 1000px; margin: 0 auto;
    display: grid; grid-template-columns: 240px minmax(0, 680px); column-gap: 80px;
  }
  .toc { display: block; padding-top: 56px; }
  .toc-inner { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 8px; }  /* sabit üst çubuğun altında */
  .toc-title { padding: 0 12px; font-size: 13px; font-weight: 700; color: var(--text3); }
  .toc ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
  .toc a { display: block; padding: 7px 12px; border-radius: 8px; font-size: 15px; color: var(--text2); text-decoration: none; }
  .toc a:hover { background: var(--hover); }
  .toc a[aria-current="true"] { background: var(--surface); color: var(--text); font-weight: 700; }
  .prose { padding: 48px 0 64px; gap: 40px; }
}

@media (min-width: 1440px) {
  .content { max-width: 760px; }
}

@media (prefers-reduced-motion: no-preference) {
  .chevron svg { transition: transform 0.15s ease; }
}

/* --- Formlar ve pencereler (docs/design.md "Formlar") ---------------------------------------------------------- */

.dialog {
  margin: 0; padding: 0; border: 0;
  max-width: none; max-height: none;
  background: var(--surface); color: var(--text);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.dialog .form { height: 100%; display: flex; flex-direction: column; min-height: 0; }
html.has-dialog, html.has-dialog body { overflow: hidden; }

.dialog-head { display: flex; align-items: center; gap: 8px; }
.dialog-title { margin: 0; font-size: 20px; font-weight: 700; }
.dialog-close { margin-left: auto; color: var(--text2); }
.dialog-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 12px;
}
/* Düzeltme Öner: başlığın altında sözcük (kalın) ve sözlüğün adı, tıklanan karttan */
.correction-info {
  padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 0.5px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.correction-word { font-size: 16px; font-weight: 700; }
.correction-source { font-size: 13px; color: var(--text3); }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions .button--secondary { border-width: 1px; }  /* 0,5 px kenarlık iPhone'da kesik görünüyordu */
/* Destek Ver: uzun form; başlık ve Gönder sabit, araya kalan alan kendi içinde kayar */
#support-dialog[open] { display: flex; flex-direction: column; }
#support-dialog .form { flex: 1 1 auto; height: auto; min-height: 0; }
#support-title:focus, #correction-title:focus { outline: 0; }
.support-intro { display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--text2); }
.support-intro p { margin: 0; }
.support-accent { color: var(--link); }
.consent { min-height: 44px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text2); cursor: pointer; }
.consent input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent); }
.consent a { color: var(--link); }
.consent input[aria-invalid="true"] { outline: 1px solid var(--link); }


/* Alanlar */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { display: flex; align-items: baseline; gap: 8px; padding: 0; font-size: 14px; color: var(--text2); }
.optional { font-size: 12px; color: var(--text3); }
.input {
  height: 44px; padding: 0 12px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--bg);
  border: 0.5px solid var(--input-border); border-radius: 12px;
}
.input::placeholder { color: var(--text3); }
.input:focus { outline: 0; border: 1px solid var(--accent); box-shadow: 0 0 0 3px var(--info); }
.textarea { height: auto; padding: 10px 12px; resize: none; line-height: 1.45; }
.input[aria-invalid="true"] { border-color: var(--link); }
.field-error, .form-error { margin: -4px 0 0; font-size: 13px; color: var(--link); }
.form-error { margin: 0; font-size: 14px; }

.choices { margin: 0; padding: 0; border: 0; min-width: 0; }
.choices legend { padding: 0 0 4px; }
.choices--list .choice {
  min-height: 44px; display: flex; align-items: center; gap: 10px;
  border-top: 0.5px solid var(--border); font-size: 16px; cursor: pointer;
}
.choice input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent); }
.choices[aria-invalid="true"] legend { color: var(--link); }

.button {
  height: 48px; padding: 0 18px;
  border-radius: 12px; font-size: 16px; cursor: pointer;
}
.button--primary { border: 0; background: var(--button); color: #FFFFFF; font-weight: 700; }
.button--secondary { border: 0.5px solid var(--input-border); background: transparent; color: var(--text); }
.button[disabled] { opacity: 0.6; cursor: progress; }

.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (min-width: 768px) {
  /* Pencereler yalnız masaüstü ve tablette açılır (mobilde ayrı sayfa): ortada 480 px, arka plan karartılır, altta sağa yaslı Vazgeç / Gönder */
  .dialog--sheet {
    position: fixed; inset: 0; margin: auto;
    width: min(480px, calc(100% - 48px)); height: fit-content;
    max-height: calc(100dvh - 96px);
    transform: none; padding: 0;
    border: 0.5px solid var(--border2); border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  }
  .dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
  .dialog--sheet .dialog-head {
    min-height: 60px; padding: 8px 8px 8px 24px;
    display: flex; border-bottom: 0.5px solid var(--border); box-shadow: none;
  }
  .dialog--sheet .dialog-title { font-size: 19px; }
  .dialog-body { padding: 18px 24px 4px; gap: 14px; }
  .dialog--sheet .form { gap: 0; }
  .dialog-actions { display: flex; justify-content: flex-end; padding: 16px 24px 20px; }
  .dialog-actions .button { height: 44px; font-size: 15px; }
}
