/* Yazi tipleri sitenin kendi sunucusundan (OFL; dis yazi tipi servisi yok, CSP font-src 'self'). */
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/playfair-display-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/playfair-display-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/playfair-display-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/playfair-display-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/playfair-display-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/playfair-display-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/playfair-display-latin-ext-400-italic.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/playfair-display-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 600; font-display: swap; src: url("../fonts/playfair-display-latin-ext-600-italic.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 600; font-display: swap; src: url("../fonts/playfair-display-latin-600-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext-300-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-300-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext-400-italic.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext-600-italic.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Amiri"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/amiri-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Amiri"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/amiri-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Amiri"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/amiri-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Amiri"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/amiri-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Amiri"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/amiri-latin-ext-400-italic.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Amiri"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/amiri-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ═══════════════════════════════════════════════════════════
   Collectio Ultima Sapientiae — eski sitenin tasarimi (kasiskeletkonseyi.com/collectio-ultima-sapientiae,
   bilgelik.css), kullanici karariyla (2026-10-18) yalniz renk paleti lapis + yaldiz.
   Sunucuda uretilen sayfalara uyarlama eklemeleri dosyanin sonunda ("UYARLAMA").
   ═══════════════════════════════════════════════════════════ */

/* ─── TOKENS ─── */
:root {
  --bg-deep: #0d1828;
  --bg-primary: #13233b;
  --bg-card: #1a2c48;
  --bg-card-hover: #213659;
  --bg-input: #0f1c30;
  --bg-surface: #1c3152;

  --text-primary: #ecebe4;
  --text-secondary: #a9b4c6;
  --text-muted: #8391a8;
  --text-hint: #5d6c86;

  --accent: #d6a13f;
  --accent-hover: #e3b65e;
  --accent-dim: rgba(214, 161, 63, 0.13);
  --accent-glow: rgba(214, 161, 63, 0.06);

  --red: #3ab5a0;
  --red-dim: rgba(58, 181, 160, 0.12);
  --gold: #c9b37a;
  --gold-dim: rgba(201, 179, 122, 0.12);
  --purple: #8c78c8;
  --purple-dim: rgba(140, 120, 200, 0.12);

  --cat1-color: var(--accent);
  --cat1-bg: var(--accent-dim);
  --cat2-color: var(--red);
  --cat2-bg: var(--red-dim);
  --cat3-color: var(--gold);
  --cat3-bg: var(--gold-dim);
  --cat4-color: var(--purple);
  --cat4-bg: var(--purple-dim);

  --border: #263a5a;
  --border-light: #33507a;
  --border-accent: rgba(214, 161, 63, 0.3);

  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(214, 161, 63, 0.07);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 100px;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-content: 'Amiri', 'Noto Serif', Georgia, serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.25s;
}

/* ─── LIGHT MODE ─── */
.light-mode {
  --bg-deep: #ecebe5;
  --bg-primary: #f5f4ef;
  --bg-card: #ffffff;
  --bg-card-hover: #f6f5f0;
  --bg-input: #efeee8;
  --bg-surface: #e9e7df;

  --text-primary: #13233b;
  --text-secondary: #3b4a63;
  --text-muted: #5f6b80;
  --text-hint: #9aa3b5;

  --accent: #8a6215;
  --accent-hover: #6f4e0f;
  --accent-dim: rgba(176, 125, 30, 0.12);
  --accent-glow: rgba(176, 125, 30, 0.05);

  --red: #1a7a6c;
  --red-dim: rgba(26, 122, 108, 0.08);
  --gold: #7a6a3a;
  --gold-dim: rgba(122, 106, 58, 0.08);
  --purple: #6a58a8;
  --purple-dim: rgba(106, 88, 168, 0.08);

  --cat1-color: var(--accent);
  --cat1-bg: var(--accent-dim);
  --cat2-color: var(--red);
  --cat2-bg: var(--red-dim);
  --cat3-color: var(--gold);
  --cat3-bg: var(--gold-dim);
  --cat4-color: var(--purple);
  --cat4-bg: var(--purple-dim);

  --border: #d6d4cb;
  --border-light: #c5c2b6;
  --border-accent: rgba(138, 98, 21, 0.28);

  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 30px rgba(138, 98, 21, 0.05);
}

.light-mode .app-header {
  background: rgba(245, 244, 239, 0.92);
}

.light-mode body::before {
  background:
    radial-gradient(ellipse at 15% 30%, rgba(176, 125, 30, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 70%, rgba(19, 35, 59, 0.03) 0%, transparent 50%);
}

.light-mode body::after {
  opacity: 0.03;
}

.light-mode .logo-text {
  color: var(--accent);
}

.light-mode .graph-overlay {
  background: var(--bg-primary);
}


/* ─── RESET & BASE ─── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}


/* ─── BACKGROUND TEXTURE ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 30%, rgba(214, 161, 63, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 70%, rgba(58, 120, 200, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(214, 161, 63, 0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* İznik geometric pattern overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.015;
  background-image:
    repeating-linear-gradient(60deg, var(--accent) 0px, transparent 1px, transparent 30px),
    repeating-linear-gradient(-60deg, var(--accent) 0px, transparent 1px, transparent 30px),
    repeating-linear-gradient(0deg, var(--accent) 0px, transparent 1px, transparent 30px);
  pointer-events: none;
  z-index: 0;
}


/* ─── SCROLLBAR ─── */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* ─── HEADER ─── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 24, 40, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: default;
  user-select: none;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.logo-text .logo-sub {
  display: block;
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-family: var(--font-body);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}


/* ─── BUTTONS ─── */
.btn {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 18px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-accent {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
  font-weight: 700;
}

.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg-deep);
  box-shadow: 0 4px 20px rgba(214, 161, 63, 0.25);
}

.btn-danger {
  border-color: rgba(196, 64, 64, 0.4);
  color: var(--red);
}

.btn-danger:hover {
  background: var(--red-dim);
  border-color: var(--red);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.75rem;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.1rem;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-card);
  border-color: var(--border);
}


/* ─── LAYOUT ─── */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1025px;
  margin: 0 auto;
  padding: 32px 24px 100px;
}


/* ─── NAVIGATION ─── */
.nav-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.nav-tab {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 12px 24px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  position: relative;
}

.nav-tab:hover {
  color: var(--text-secondary);
}

.nav-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-tab .tab-count {
  font-size: 0.68rem;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  margin-left: 6px;
  font-weight: 700;
}


/* ─── STATS BAR ─── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
  transition: border-color var(--duration) var(--ease);
}

.stat-item:hover {
  border-color: var(--border-light);
}

.stat-clickable {
  cursor: pointer;
}

.stat-clickable:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.stat-clickable:hover .stat-num {
  color: var(--accent-hover);
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 1.03rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 2px;
}

.stat-pages {
  letter-spacing: -0.35em;
  font-size: 0.85em;
}

.stat-mono {
  filter: grayscale(1);
  font-size: 0.85em;
}


/* ─── WISDOM CARD ─── */
.wisdom-display {
  animation: fadeUp 0.5s var(--ease);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.wisdom-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 24px 28px;
  position: relative;
  overflow: visible;
  box-shadow: var(--shadow-glow);
}

.wisdom-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.wisdom-card[data-cat="1"]::before { background: linear-gradient(90deg, var(--cat1-color), transparent); }
.wisdom-card[data-cat="2"]::before { background: linear-gradient(90deg, var(--cat2-color), transparent); }
.wisdom-card[data-cat="3"]::before { background: linear-gradient(90deg, var(--cat3-color), transparent); }
.wisdom-card[data-cat="4"]::before { background: linear-gradient(90deg, var(--cat4-color), transparent); }

/* Decorative çini corner */
.wisdom-card::after {
  content: '✦';
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1rem;
  opacity: 0.08;
  color: var(--accent);
}

.category-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
}

.category-badge[data-cat="1"] { background: var(--cat1-bg); color: var(--cat1-color); }
.category-badge[data-cat="2"] { background: var(--cat2-bg); color: var(--cat2-color); }
.category-badge[data-cat="3"] { background: var(--cat3-bg); color: var(--cat3-color); }
.category-badge[data-cat="4"] { background: var(--cat4-bg); color: var(--cat4-color); }

.wisdom-content {
  font-family: var(--font-content);
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--text-primary);
  margin-bottom: 16px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding: 4px 6px;
}

/* Markdown rendered content */
.wisdom-content p { margin: 0 0 0.8em; }
.wisdom-content p:last-child { margin-bottom: 0; }
.wisdom-content strong { font-weight: 700; }
.wisdom-content em { font-style: italic; }
.wisdom-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
}
.wisdom-content blockquote {
  border-left: 3px solid var(--accent-dim);
  padding-left: 16px;
  margin: 12px 0;
  color: var(--text-secondary);
  font-style: italic;
}
.wisdom-content ul, .wisdom-content ol {
  padding-left: 24px;
  margin: 8px 0;
}
.wisdom-content li { margin-bottom: 4px; }
.wisdom-content h1, .wisdom-content h2, .wisdom-content h3 {
  font-family: var(--font-display);
  margin: 16px 0 8px;
  color: var(--text-primary);
}
.wisdom-content h1 { font-size: 1.4em; }
.wisdom-content h2 { font-size: 1.2em; }
.wisdom-content h3 { font-size: 1.05em; }
.wisdom-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* Aforizma — büyük ve italik */
.wisdom-card[data-cat="1"] .wisdom-content {
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.7;
  text-align: center;
  padding: 20px 12px;
  position: relative;
}

.wisdom-card[data-cat="1"] .wisdom-content::before {
  content: '"';
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--accent);
  opacity: 0.15;
  position: absolute;
  top: -12px;
  left: 0;
  line-height: 1;
}

/* Uzun yazılar — scroll */
.wisdom-card[data-cat="3"] .wisdom-content,
.wisdom-card[data-cat="4"] .wisdom-content {
  font-size: 1.05rem;
  line-height: 1.9;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 16px;
}

.wisdom-author {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  text-align: right;
  margin-bottom: 20px;
  font-style: italic;
}

.wisdom-author:empty {
  display: none;
}

.summary-inline {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
}

.summary-inline:empty {
  display: none;
}

.summary-tools {
  display: inline;
  margin-left: 2px;
}

.summary-tool {
  font-size: 0.68rem;
  color: var(--text-hint);
  cursor: pointer;
  margin-left: 3px;
  opacity: 0;
  transition: opacity var(--duration) var(--ease), color var(--duration) var(--ease);
}

.summary-inline:hover .summary-tool,
.summary-tools:hover .summary-tool {
  opacity: 0.6;
}

.summary-tool:hover {
  opacity: 1 !important;
  color: var(--accent);
}

/* ─── TRUTHS LIST ─── */
.truths-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.truth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  border-left: 3px solid var(--gold, #c8b450);
}

.truth-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold, #c8b450);
  transform: translateX(4px);
}

.truth-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.5;
}

.truth-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ─── TRUTH HERO (detail page) ─── */
.truth-hero {
  text-align: center;
  padding: 32px 20px 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.truth-hero-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.truth-hero-text {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  font-style: italic;
  color: var(--gold, #c8b450);
  line-height: 1.5;
}

/* ─── PRINCIPLE IN MODAL ─── */
.principle-roots-header {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  font-style: normal;
  text-align: left;
  color: var(--text-secondary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.principle-roots-group {
  margin-bottom: 12px;
}

.principle-roots-cat {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

/* Principle content in modal — bigger, bold, centered */
.principle-content {
  font-family: var(--font-display) !important;
  font-size: 1.6rem !important;
  font-weight: 700 !important;
  font-style: italic !important;
  text-align: center !important;
  line-height: 1.5 !important;
  color: var(--gold, #c8b450) !important;
  padding: 12px 0 !important;
}

.category-badge[data-cat="principle"] {
  background: var(--gold, #c8b450);
  color: var(--bg-dark, #141828);
}

/* ─── TRUTH PICKER POPUP ─── */
.truth-picker-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  max-width: 420px;
  width: 90%;
  max-height: 70vh;
  overflow-y: auto;
}

.truth-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.truth-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.truth-picker-item:hover {
  background: var(--bg-surface);
}

.truth-picker-icon {
  flex-shrink: 0;
  font-size: 0.9rem;
}

.truth-picker-text {
  flex: 1;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-style: italic;
  color: var(--text-primary);
}

.truth-picker-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.truth-picker-new {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}

.truth-add-btn {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  transition: color var(--duration) var(--ease);
  margin-left: auto;
}

.truth-add-btn:hover {
  color: var(--accent-hover);
}

/* ─── TAG AUTOCOMPLETE ─── */
.tag-autocomplete {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 220px;
  overflow-y: auto;
  margin-top: 4px;
}

.tag-ac-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.tag-ac-item:hover {
  background: var(--bg-surface);
}

.tag-ac-name {
  font-size: 0.88rem;
  color: var(--text-primary);
}

.tag-ac-alt {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.tag-ac-count {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ─── ROOTS LIST (write form) ─── */
.roots-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.root-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.root-cat {
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 600;
  text-transform: uppercase;
}

.root-text {
  flex: 1;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.root-remove {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.75rem;
  opacity: 0.5;
  transition: opacity var(--duration) var(--ease), color var(--duration) var(--ease);
}

.root-remove:hover {
  opacity: 1;
  color: var(--danger, #c44040);
}

@media (hover: none) {
  .summary-tool {
    opacity: 0.4;
  }
}

.wisdom-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.wisdom-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.btn-arrow {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color var(--duration) var(--ease), transform var(--duration) var(--ease);
  user-select: none;
}

.btn-arrow:hover {
  color: var(--accent-hover);
  transform: scale(1.15);
}

.wisdom-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}


/* ─── AUTHOR LINK ─── */
.author-link {
  cursor: pointer;
  transition: color var(--duration) var(--ease);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}

.author-link:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent);
}


/* ─── LANG TOGGLE ─── */
.lang-toggle,
.ui-lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 2;
}

.lang-toggle {
  position: absolute;
  top: 14px;
  right: 16px;
}

.ui-lang-toggle {
  margin-right: 4px;
}

.lang-btn {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  user-select: none;
}

.lang-btn:hover {
  color: var(--text-secondary);
  background: var(--bg-surface);
}

.lang-btn.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.lang-sep {
  font-size: 0.72rem;
  color: var(--text-hint);
  user-select: none;
}


/* ─── EXPLAIN (Aforizma only) ─── */
.explain-area {
  margin: 12px 0 16px;
}

.explain-trigger {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--duration) var(--ease);
  border-bottom: 1px dashed var(--text-hint);
  padding-bottom: 1px;
}

.explain-trigger:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.explain-content {
  font-family: var(--font-content);
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--text-secondary);
  padding: 14px 18px;
  background: var(--bg-surface);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 8px;
  animation: fadeUp 0.3s var(--ease);
}

.explain-text {
  margin-bottom: 4px;
}

.explain-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.explain-toolbar .summary-tool {
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--duration) var(--ease);
}

.explain-toolbar .summary-tool:hover {
  color: var(--accent);
}

.explain-close-inline {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
  opacity: 0.5;
  transition: opacity var(--duration) var(--ease), color var(--duration) var(--ease);
}

.explain-close-inline:hover {
  opacity: 1;
  color: var(--text-primary);
}

/* ─── TRANSLATION TOOLS ─── */
.translation-tools {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.translation-tools:empty {
  display: none;
}

.trans-tool-btn {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--duration) var(--ease), color var(--duration) var(--ease);
}

.trans-tool-btn:hover {
  opacity: 1;
  color: var(--accent);
}

.trans-tool-btn.trans-save {
  color: var(--accent);
  opacity: 0.8;
  font-weight: 600;
}

.translation-edit-area {
  min-height: 120px;
}


/* ─── TAGS ─── */
.tag {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-dim);
  color: var(--accent);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-block;
}

.tag:hover {
  background: rgba(214, 161, 63, 0.25);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tag.active {
  background: var(--accent);
  color: var(--bg-deep);
}


/* ─── TAG GRAPH OVERLAY ─── */
.graph-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--bg-deep);
  display: none;
}

.graph-overlay.visible {
  display: block;
}

.graph-close {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 410;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.graph-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent);
}

#tag-graph-canvas {
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: grab;
}

#tag-graph-canvas:active {
  cursor: grabbing;
}


/* ─── TAG BROWSER ─── */
.tag-browser {
  animation: fadeUp 0.4s var(--ease);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow-glow);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.tag-cloud .tag {
  font-size: 0.82rem;
  padding: 7px 18px;
}

.tag-results {
  display: none;
}

.tag-results.visible {
  display: block;
  animation: fadeUp 0.3s var(--ease);
}

.tag-results-section {
  margin-bottom: 28px;
}

.tag-results-section h3,
.tag-results-section h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag-results-section h3 .count,
.tag-results-section h2 .count {
  font-family: var(--font-body);
  font-size: 0.72rem;
  background: var(--bg-surface);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.result-item {
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateX(4px);
}

.result-item-text {
  font-family: var(--font-content);
  font-size: 1.15rem;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 14px;
}

.result-item-author {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-style: italic;
}


/* ─── SEARCH ─── */
.search-bar {
  position: relative;
  margin-bottom: 24px;
}

.search-bar input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-bar input::placeholder {
  color: var(--text-hint);
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}


/* ─── INPUT FORM ─── */
.input-section {
  animation: fadeUp 0.4s var(--ease);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow-glow);
}

.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-select,
.form-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 11px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  outline: none;
}

.form-select:focus,
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-select option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.form-textarea {
  width: 100%;
  font-family: var(--font-content);
  font-size: 1.05rem;
  line-height: 1.8;
  padding: 16px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  resize: vertical;
  min-height: 180px;
  outline: none;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-textarea::placeholder {
  color: var(--text-hint);
  font-style: italic;
}


/* ─── TAG INPUT ─── */
.tag-input-area {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 48px;
  align-items: center;
  cursor: text;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.tag-input-area:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.tag-input-area .tag {
  padding-right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tag-remove {
  cursor: pointer;
  opacity: 0.5;
  font-size: 0.85rem;
  line-height: 1;
  padding: 2px;
  transition: opacity var(--duration);
}

.tag-remove:hover {
  opacity: 1;
}

.tag-input-field {
  border: none;
  background: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  flex: 1;
  min-width: 120px;
}

.tag-input-field::placeholder {
  color: var(--text-hint);
}


/* ─── AI PANEL ─── */
.ai-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
  display: none;
  animation: fadeUp 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}

.ai-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--purple), var(--accent));
}

.ai-panel.visible {
  display: block;
}

.ai-panel-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-suggestion {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}

.ai-suggestion-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.ai-suggestion-content {
  font-family: var(--font-content);
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.8;
  white-space: pre-wrap;
}

.ai-suggested-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.ai-suggested-tags .tag {
  border: 1px dashed var(--accent);
  background: transparent;
  transition: all var(--duration) var(--ease);
  opacity: 0.7;
}

.ai-suggested-tags .tag:hover {
  opacity: 1;
}

.ai-suggested-tags .tag.selected {
  background: var(--accent);
  color: var(--bg-deep);
  border: 1px solid var(--accent);
  font-weight: 700;
  opacity: 1;
  box-shadow: 0 0 12px rgba(214, 161, 63, 0.35);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}


/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.visible {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 1025px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 44px 40px;
  position: relative;
  animation: fadeUp 0.3s var(--ease);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color var(--duration);
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}


/* ─── LOGIN FORM ─── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(12px);
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-overlay.visible {
  display: flex;
}

.login-box {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  animation: fadeUp 0.4s var(--ease);
  box-shadow: var(--shadow);
}

.login-box .logo-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
}

.login-box h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.login-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.login-box .form-input {
  text-align: center;
  margin-bottom: 16px;
}

.login-error {
  font-size: 0.8rem;
  color: var(--red);
  margin-bottom: 12px;
  display: none;
}

.login-error.visible {
  display: block;
}


/* ─── SETTINGS ─── */
.settings-section {
  animation: fadeUp 0.4s var(--ease);
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}

.settings-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.settings-row + .settings-row {
  border-top: 1px solid var(--border);
}

.settings-row-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.settings-row-value {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}


/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.88rem;
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.6;
}


/* ─── TOAST ─── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 700;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  animation: slideIn 0.3s var(--ease);
  max-width: 440px;
  user-select: text;
}

.toast:not(.error) {
  animation: slideIn 0.3s var(--ease), fadeOut 0.3s var(--ease) 2.7s forwards;
}

.toast.success {
  border-left: 3px solid var(--accent);
}

.toast.error {
  border-left: 3px solid var(--red);
  cursor: default;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(8px); }
}


/* ─── LOADING ─── */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}


/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .app-header {
    padding: 0 16px;
    height: 56px;
  }

  .logo-text {
    font-size: 1rem;
  }

  .logo-text .logo-sub {
    display: none;
  }

  .app-container {
    padding: 20px 16px 80px;
  }

  .nav-tab {
    padding: 10px 14px;
    font-size: 0.78rem;
  }

  .wisdom-card {
    padding: 28px 22px 22px;
  }

  .tag-browser,
  .input-section {
    padding: 24px 18px;
  }

  .wisdom-card[data-cat="1"] .wisdom-content {
    font-size: 1.25rem;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal {
    padding: 24px 20px;
    max-height: 90vh;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .nav-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}


/* ─── LANG CONFIRM POPUP ─── */
.lang-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-confirm-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  text-align: center;
  max-width: 320px;
}


/* ─── THEME TOGGLE ─── */
.theme-toggle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 300;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease);
  line-height: 1;
  padding: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-card-hover);
}


/* ─── PRINT ─── */
@media print {
  body::before,
  body::after,
  .app-header,
  .nav-tabs,
  .wisdom-nav,
  .header-actions,
  .toast-container {
    display: none !important;
  }

  body {
    background: white;
    color: #222;
  }

  .wisdom-card {
    border: 1px solid #ddd;
    box-shadow: none;
  }
}

/* ─── DEPOT ─── */
.nav-tab-depot {
  margin-left: auto;
  opacity: 0.7;
}

.depot-section {
  max-width: 100%;
}

.depot-search-wrap {
  margin-bottom: 12px;
}

.depot-search-wrap .form-input {
  width: 100%;
}

.depot-textarea {
  width: 100%;
  min-height: 70vh;
  max-height: 85vh;
  padding: 18px;
  font-family: var(--font-content);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  outline: none;
  transition: border-color var(--duration) var(--ease);
  white-space: pre-wrap;
  overflow-y: auto;
}

.depot-textarea:focus {
  border-color: var(--accent);
}

.depot-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.depot-search-results {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.depot-search-hit {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.depot-search-hit:last-child {
  border-bottom: none;
}

.depot-search-hit:hover {
  background: var(--bg-card-hover);
}

.depot-search-hit mark {
  background: rgba(200, 180, 80, 0.3);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

.depot-preview {
  width: 100%;
  min-height: 70vh;
  max-height: 85vh;
  padding: 18px;
  font-family: var(--font-content);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-y: auto;
}

.depot-preview h1, .depot-preview h2, .depot-preview h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin: 1em 0 0.5em;
}

.depot-preview h1 { font-size: 1.5rem; }
.depot-preview h2 { font-size: 1.25rem; }
.depot-preview h3 { font-size: 1.1rem; }

.depot-preview ul, .depot-preview ol {
  padding-left: 24px;
  margin: 0.5em 0;
}

.depot-preview li {
  margin-bottom: 4px;
}

.depot-preview blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  margin: 0.8em 0;
  color: var(--text-secondary);
  font-style: italic;
}

.depot-preview code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 3px;
}

.depot-preview p {
  margin: 0 0 0.8em;
}


/* ═══════════════════════════════════════════════════════════
   UYARLAMA (2026-10-18): eski tek sayfa uygulamasindaki tiklanabilir span/div/button ogeleri artik gercek
   baglanti (<a>) -- sunucuda uretilen, Google'in okuyabildigi sayfalar. Gorunum ayni kalsin diye sifirlama;
   cark (Ayarlar), cerez ucgeni (spine.academy'den), erisilebilirlik.
   ═══════════════════════════════════════════════════════════ */
a.nav-tab, a.lang-btn, a.category-badge, a.result-item, a.truth-card, a.stat-item, .author-link, .soz-bag {
  text-decoration: none;
}
a.nav-tab { display: inline-block; }
a.stat-item { display: block; color: inherit; }
.stat-label, .stat-num { display: block; }
a.result-item { color: inherit; }
a.truth-card { display: block; }
.truth-text, .truth-count { display: block; }
.author-link { color: inherit; }
.author-link:hover { text-decoration: underline; }
.soz-bag { color: inherit; }
.soz-bag:hover { color: var(--accent-hover); }
h1.wisdom-content { font-weight: 400; }
.wisdom-card[data-cat="1"] p.wisdom-content, .wisdom-card[data-cat="1"] h1.wisdom-content { margin: 0 0 16px; }
.wisdom-card .explain-area { margin-bottom: 16px; }
.wisdom-card .explain-content p + p { margin-top: 0.8em; }
.wisdom-meta { margin-top: 14px; }
.tag-ilke { background: var(--gold-dim); color: var(--gold); }
.tag-sayi { opacity: 0.55; }
.section-title .count { font-family: var(--font-body); font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }
.tag-cloud + .section-title { margin-top: 32px; }
.search-bar .search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* Cark: sag ustte Ayarlar */
.cark { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 50%; color: var(--text-muted); transition: color var(--duration) var(--ease), transform 0.4s var(--ease); }
.cark svg { width: 22px; height: 22px; }
.cark:hover, .cark.active { color: var(--accent); }
.cark:hover { transform: rotate(45deg); }

/* Ayarlar sayfasi */
.ayar { padding: 18px 0; border-top: 1px solid var(--border); }
.ayar-baslik { font-family: var(--font-body); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.ayar-secenekler { display: flex; flex-wrap: wrap; gap: 10px; }

/* Gizlilik */
.gizlilik-metin { color: var(--text-secondary); line-height: 1.75; max-width: 70ch; }
.gizlilik-metin h2 { font-family: var(--font-display); font-size: 1.05rem; color: var(--text-primary); margin: 20px 0 6px; }
.gizlilik-metin p + p { margin-top: 10px; }
.gizlilik-metin a { color: var(--accent); }
.empty-state h1 { font-family: var(--font-display); font-size: 1.4rem; margin: 8px 0; }

/* Erisilebilirlik */
.gizli { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.atla { position: absolute; left: 16px; top: -100px; z-index: 400; background: var(--accent); color: var(--bg-deep);
  padding: 10px 14px; font-weight: 700; border-radius: var(--radius-sm); }
.atla:focus { top: 10px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* CEREZ UCGENI (spine.academy cookie-consent.js'ten; renkler bu sitenin degiskenleri) */
.cerez-ucgen { position: fixed; bottom: 0; left: 0; z-index: 9998; width: 50px; height: 50px; padding: 0; border: none;
  background-color: var(--accent); clip-path: polygon(0% 0%, 0% 100%, 100% 100%); cursor: pointer;
  transition: background-color 180ms; }
.cerez-ucgen:hover { background-color: var(--accent-hover); }
.cerez-ucgen svg { position: absolute; bottom: 4px; left: 3px; width: 22px; height: 22px; pointer-events: none; }
.cerez-serit { position: fixed; bottom: 0; left: 0; right: 0; z-index: 9997; display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; padding: 14px 20px 14px 64px; background: var(--bg-primary); border-top: 1px solid var(--border-accent);
  font-size: 0.8rem; color: var(--text-secondary); box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3); }
.cerez-serit[hidden] { display: none; }
.cerez-serit p { flex: 1; min-width: 180px; margin: 0; line-height: 1.5; }
.cerez-serit a, .cerez-panel__giris a { color: var(--accent); text-decoration: none; }
.cerez-serit a:hover, .cerez-panel__giris a:hover { text-decoration: underline; }
.cerez-serit__dugmeler { display: flex; gap: 8px; flex-shrink: 0; }
.cerez-panel { position: fixed; bottom: 76px; left: 20px; z-index: 9999; width: 320px; max-height: 80vh; overflow-y: auto;
  background: var(--bg-primary); border: 1px solid var(--border-accent); border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); font-size: 0.78rem; transform: translateY(12px); opacity: 0;
  pointer-events: none; transition: transform 250ms var(--ease), opacity 250ms ease; }
.cerez-panel--acik { transform: translateY(0); opacity: 1; pointer-events: auto; }
.cerez-panel__ust { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border); }
.cerez-panel__baslik { font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-primary); }
.cerez-panel__kapat { background: none; border: none; cursor: pointer; padding: 4px; color: var(--text-muted); font-size: 1rem; }
.cerez-panel__kapat:hover { color: var(--text-primary); }
.cerez-panel__govde { padding: 14px 16px; }
.cerez-panel__giris { color: var(--text-secondary); line-height: 1.6; margin-bottom: 14px; }
.cerez-kategori { padding: 10px 0; border-top: 1px solid var(--border); }
.cerez-kategori__satir { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cerez-kategori__ad { font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.cerez-kategori__ek { font-weight: 400; opacity: 0.6; font-size: 0.9em; }
.cerez-kategori__aciklama { color: var(--text-muted); line-height: 1.5; font-size: 0.92em; }
.cerez-anahtar { position: relative; flex-shrink: 0; margin-top: 1px; }
.cerez-anahtar input { position: absolute; opacity: 0; width: 0; height: 0; }
.cerez-anahtar__ray { display: block; width: 34px; height: 18px; border-radius: 9px; background: var(--border-light);
  cursor: pointer; position: relative; transition: background 200ms; }
.cerez-anahtar__ray::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; transition: transform 200ms; }
.cerez-anahtar input:checked + .cerez-anahtar__ray { background: var(--accent); }
.cerez-anahtar input:checked + .cerez-anahtar__ray::after { transform: translateX(16px); }
.cerez-anahtar input:disabled + .cerez-anahtar__ray { opacity: 0.5; cursor: not-allowed; }
.cerez-anahtar input:focus-visible + .cerez-anahtar__ray { outline: 2px solid var(--accent); outline-offset: 2px; }
.cerez-panel__alt { padding: 12px 16px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.cerez-dugme { display: block; width: 100%; padding: 8px 12px; font-family: var(--font-body); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; border-radius: 2px; cursor: pointer; border: 1px solid transparent;
  text-align: center; transition: background 150ms, color 150ms, border-color 150ms; }
.cerez-serit .cerez-dugme { width: auto; white-space: nowrap; padding: 7px 14px; }
.cerez-dugme--ana { background: var(--accent); color: var(--bg-deep); border-color: var(--accent); }
.cerez-dugme--ana:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.cerez-dugme--ikinci { background: none; color: var(--text-secondary); border-color: var(--border-light); }
.cerez-dugme--ikinci:hover { color: var(--text-primary); border-color: var(--accent); }
.cerez-dugme--reddet { background: none; border: none; color: var(--text-muted); font-weight: 400; padding: 4px; }
.cerez-dugme--reddet:hover { color: var(--text-primary); }
@media (max-width: 400px) { .cerez-panel { left: 10px; right: 10px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .cark:hover { transform: none; } .cerez-panel { transition: none; } }
a.btn-arrow { text-decoration: none; display: inline-block; }
