:root {
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --surface-2: #efe6d4;
  --text: #2b2117;
  --muted: #7a6a58;
  --border: #e2d6c0;
  --brand: #8a3b12;
  --brand-2: #b4561f;
  --brand-soft: #f6e2d2;
  --ok: #2f7d4a;
  --ok-soft: #dff0e3;
  --warn: #9a6a00;
  --warn-soft: #fbefcc;
  --err: #a8322a;
  --err-soft: #f8dcd8;
  --plus: #6a3fb5;
  --plus-soft: #ece4fa;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 20px rgba(60, 40, 20, .06);
}
/* Karanlık tema: sistem ayarı karanlıksa (kullanıcı aydınlık seçmediyse) ya da kullanıcı karanlık seçtiyse */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17120d; --surface: #211a13; --surface-2: #2b2219; --text: #f1e8da; --muted: #b3a28c;
    --border: #3a2f23; --brand: #e4884f; --brand-2: #f0a06c; --brand-soft: #3a2416;
    --ok: #6fcf8f; --ok-soft: #1c3324; --warn: #f0c35a; --warn-soft: #3a2f12;
    --err: #f08a80; --err-soft: #3d1d1a; --plus: #b89af0; --plus-soft: #2c2140;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17120d; --surface: #211a13; --surface-2: #2b2219; --text: #f1e8da; --muted: #b3a28c;
  --border: #3a2f23; --brand: #e4884f; --brand-2: #f0a06c; --brand-soft: #3a2416;
  --ok: #6fcf8f; --ok-soft: #1c3324; --warn: #f0c35a; --warn-soft: #3a2f12;
  --err: #f08a80; --err-soft: #3d1d1a; --plus: #b89af0; --plus-soft: #2c2140;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* Arka plan videosu: ekranı kaplar, tıklanamaz, üstünde okunabilirlik için yarı saydam katman */
.bg-video { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.bg-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-overlay { position: fixed; inset: 0; z-index: -1; background: var(--bg); opacity: .72; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .bg-video { display: none; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0; background: transparent; color: var(--text);
  font: 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ---------- Header: tam genişlik, tek satır, keskin ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 8px 24px -16px rgba(0,0,0,.25);
}
.topbar-inner {
  display: flex; align-items: center; gap: 32px;
  height: 68px; padding: 0 clamp(16px, 3vw, 40px);
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.logo img { width: 40px; height: 40px; display: block; }
.logo span { font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; }

.nav { display: flex; align-items: stretch; height: 100%; gap: 2px; flex: 1; min-width: 0; overflow: hidden; }
.nav a {
  position: relative; display: flex; align-items: center; padding: 0 14px;
  color: var(--muted); font-size: .92rem; font-weight: 600; letter-spacing: .005em; white-space: nowrap;
  transition: color .15s;
}
.nav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px;
  background: var(--brand); transform: scaleX(0); transition: transform .18s ease;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); }
.nav a.active::after, .nav a:hover::after { transform: scaleX(1); }
.nav a:hover:not(.active)::after { background: var(--border); }
.nav .nav-admin { margin-left: auto; color: var(--brand); }

.nav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-link { color: var(--text); font-weight: 600; font-size: .92rem; padding: 0 6px; }
.topbar .btn { border-radius: 6px; }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--text);
  transition: border-color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--brand-2); background: var(--surface-2); }
.theme-toggle .i-sun { display: none; }
.theme-toggle.is-dark .i-sun { display: block; }
.theme-toggle.is-dark .i-moon { display: none; }
.burger { display: none; }

/* Hesap menüsü */
.user-menu { position: relative; }
.user-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px;
  height: 38px; padding: 0 10px 0 4px; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-weight: 600; font-size: .9rem; user-select: none;
  transition: border-color .15s, background .15s;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { border-color: var(--brand-2); background: var(--surface-2); }
.avatar {
  width: 28px; height: 28px; border-radius: 4px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; font-size: .85rem;
}
.user-menu .badge { border-radius: 4px; font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; }
.user-menu .chev { color: var(--muted); transition: transform .15s; }
.user-menu[open] .chev { transform: rotate(180deg); }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,.35);
}
.menu-head { display: flex; flex-direction: column; padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu a, .menu-logout {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 9px 12px; border-radius: 4px; color: var(--text); font: inherit; font-size: .9rem; font-weight: 500;
  background: none; border: 0; cursor: pointer; text-align: left;
}
.menu a:hover, .menu-logout:hover { background: var(--surface-2); }
.menu form { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.menu-logout { color: var(--err); }

/* Mobil */
@media (min-width: 1241px) and (max-width: 1440px) {
  .topbar-inner { gap: 16px; }
  .nav a { padding: 0 9px; }
  .nav a::after { left: 9px; right: 9px; }
}
@media (max-width: 1240px) {
  .topbar-inner { gap: 12px; }
  .burger { display: grid; }
  .user-name { display: none; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 68px; height: auto;
    flex-direction: column; gap: 0; padding: 8px clamp(16px, 3vw, 40px) 14px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 32px -16px rgba(0,0,0,.35);
  }
  .topbar.open .nav { display: flex; }
  .nav a { padding: 12px 4px; border-bottom: 1px solid var(--border); }
  .nav a:last-child { border-bottom: 0; }
  .nav a::after { left: 0; right: auto; width: 3px; top: 10px; bottom: 10px; height: auto; transform: scaleY(0); }
  .nav a.active::after { transform: scaleY(1); }
  .nav a:hover::after { transform: scaleY(0); }
  .nav a.active:hover::after { transform: scaleY(1); }
  .nav a.active { padding-left: 14px; }
  .nav .nav-admin { margin-left: 0; }
  .nav-right { margin-left: auto; }
}
@media (max-width: 480px) {
  .logo span { font-size: 1rem; }
  .user-menu .badge { display: none; }
}
.linklike { background: none; border: 0; cursor: pointer; font: inherit; color: var(--brand); padding: 0; }

/* Layout */
main { padding: 28px 0 60px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-stats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 18px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; }
.card-link { display: block; color: inherit; transition: transform .15s, border-color .15s; }
.card-link:hover { text-decoration: none; border-color: var(--brand-2); transform: translateY(-2px); }

.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff; border-radius: 20px; padding: 48px 36px; margin-bottom: 28px;
}
.hero { position: relative; overflow: hidden; }
.hero h1 { font-size: 2.4rem; max-width: 640px; }
.hero-logo {
  position: absolute; right: 32px; top: 50%; transform: translateY(-50%);
  width: 220px; height: 220px; filter: drop-shadow(0 8px 18px rgba(0,0,0,.3));
}
@media (max-width: 900px) { .hero-logo { position: static; transform: none; width: 110px; height: 110px; margin-bottom: 8px; } }
.hero p { font-size: 1.1rem; opacity: .92; max-width: 640px; }
.hero .btn { background: #fff; color: var(--brand); }
.hero .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid transparent; background: var(--brand); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer; font-size: .95rem; line-height: 1.2;
}
.btn:hover { text-decoration: none; filter: brightness(1.07); }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--border); }
.btn.ok { background: var(--ok); }
.btn.danger { background: var(--err); }
.btn.plus { background: var(--plus); }
.btn.sm { padding: 5px 10px; font-size: .85rem; border-radius: 8px; }

/* Badges */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: var(--surface-2); color: var(--muted); vertical-align: middle;
}
.badge.plus { background: var(--plus-soft); color: var(--plus); }
.badge.researcher { background: var(--ok-soft); color: var(--ok); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.messages li { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; background: var(--surface-2); }
.messages .success { background: var(--ok-soft); color: var(--ok); }
.messages .error { background: var(--err-soft); color: var(--err); }
.messages .info { background: var(--brand-soft); color: var(--brand); }

/* Forms */
.form { display: grid; gap: 14px; max-width: 640px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .92rem; }
.field .help { color: var(--muted); font-size: .8rem; margin-top: 3px; }
.field .errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--err); font-size: .85rem; }
.field.checkbox { display: flex; gap: 8px; align-items: center; }
.field.checkbox label { margin: 0; }
.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit;
}
.input:focus { outline: 2px solid var(--brand-2); outline-offset: 1px; border-color: transparent; }
textarea.input { resize: vertical; }
.check { width: 18px; height: 18px; accent-color: var(--brand); }

/* Feeding list */
.feed-list { list-style: none; margin: 0; padding: 0; }
.feed-list li {
  display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.feed-list li:last-child { border-bottom: 0; }
.feed-list .done .what { text-decoration: line-through; color: var(--muted); }
.tick {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); background: transparent;
  cursor: pointer; display: grid; place-items: center; color: #fff; font-weight: 800; flex-shrink: 0;
}
.done .tick { background: var(--ok); border-color: var(--ok); }
.food-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.food-protein { background: #c0532b; } .food-sugar { background: #e0a800; }
.food-seed { background: #8a6b3a; } .food-water { background: #3b8ed0; } .food-other { background: #888; }

/* Weekly schedule */
.week { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 10px; overflow-x: auto; }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-height: 160px; }
.day.today { border-color: var(--brand-2); box-shadow: 0 0 0 2px var(--brand-soft); }
.day h3 { font-size: .95rem; display: flex; justify-content: space-between; }
.slot { background: var(--surface-2); border-radius: 8px; padding: 8px; margin-bottom: 8px; font-size: .85rem; }
.slot strong { display: block; }
.slot .actions { display: flex; gap: 8px; margin-top: 4px; font-size: .78rem; }
@media (max-width: 900px) { .week { grid-template-columns: 1fr; } .day { min-height: 0; } }

/* ---------- Besleme takvimi ---------- */
:root { --ice: #e4f3fc; --ice-2: #cfe8f7; --ice-line: #9fcfec; --ice-text: #1d5f87; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ice: #12252f; --ice-2: #173241; --ice-line: #2c6789; --ice-text: #a5d8f5; }
}
:root[data-theme="dark"] { --ice: #12252f; --ice-2: #173241; --ice-line: #2c6789; --ice-text: #a5d8f5; }

.badge.ice { background: var(--ice-2); color: var(--ice-text); border-color: var(--ice-line); }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 12px 14px; margin-bottom: 10px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.seg a { padding: 7px 14px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.seg a + a { border-left: 1px solid var(--border); }
.seg a.on { background: var(--brand); color: #fff; }
.cal-nav { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 240px; }
.cal-nav .icon-btn { font-size: 1.3rem; line-height: 1; text-align: center; }
.cal-title { margin: 0 0 0 8px; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.cal-filter select { min-width: 170px; padding: 7px 10px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 2px 12px; align-items: center; }
.cal-legend .lg { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: 3px; }
.lg-done { background: var(--ok); } .lg-missed { background: var(--err); } .lg-planned { background: var(--brand-2); }
.lg-late { background: var(--warn); } .lg-ice { background: var(--ice-2); border: 1px solid var(--ice-line); }
.cal-sum { margin-left: auto; }

/* Yıl */
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cal-mini { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px 12px; }
.cal-mini.winter, .cal-month.winter .dow { background: var(--ice); border-color: var(--ice-line); }
.cal-mini-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--text); }
.cal-mini-head .small { margin-left: auto; }
.cal-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-mini-grid .dow { font-size: .68rem; color: var(--muted); font-weight: 700; }
.mini-day { font-size: .74rem; padding: 4px 0; border-radius: 5px; color: var(--text); position: relative; }
.mini-day:hover { background: var(--surface-2); }
.mini-day.today { outline: 2px solid var(--brand); outline-offset: -2px; font-weight: 800; }
.mini-day[class*="st-"]::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; }
.mini-day.st-planned::after { background: var(--brand-2); } .mini-day.st-late::after { background: var(--warn); }
.mini-day.st-done { background: var(--ok-soft); } .mini-day.st-done::after { background: var(--ok); }
.mini-day.st-partial::after { background: var(--ok); }
.mini-day.st-missed { background: var(--err-soft); } .mini-day.st-missed::after { background: var(--err); }

/* Ay */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--border); gap: 1px; }
.cal-month > .dow { background: var(--surface-2); text-align: center; font-weight: 700; font-size: .8rem; padding: 7px 0; color: var(--muted); }
.cal-cell { background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-cell.winter { background: var(--ice); }
.cal-cell.out { opacity: .5; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-cell-head { display: flex; justify-content: space-between; align-items: center; }
.cal-daynum { font-weight: 700; font-size: .85rem; color: var(--text); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-cell.today .cal-daynum { background: var(--brand); color: #fff; }
.cal-add { opacity: 0; font-weight: 800; color: var(--muted); padding: 0 6px; border-radius: 6px; }
.cal-cell:hover .cal-add, .cal-add:focus { opacity: 1; }
.cal-add:hover { background: var(--surface-2); color: var(--brand); }

/* Besleme kalemi (ay/hafta/gün ve panel) */
.cal-item { display: flex; gap: 6px; align-items: flex-start; background: var(--surface-2); border-radius: 8px; padding: 5px 6px; font-size: .78rem; border-left: 3px solid var(--brand-2); min-width: 0; }
.cal-cell.winter .cal-item, .day.winter .cal-item, .cal-day.winter .cal-item { background: var(--ice-2); }
.cal-item .what { min-width: 0; flex: 1; }
.cal-item strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-food { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item.is-done { border-left-color: var(--ok); background: var(--ok-soft); }
.cal-item.is-done strong, .cal-item.is-done .cal-food, .feed-list .cal-item.is-done .small { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.cal-item.is-missed { border-left-color: var(--err); background: var(--err-soft); }
.cal-actions { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; align-items: center; }
.cal-actions form { display: inline; }
.mark { display: flex; gap: 3px; flex-shrink: 0; }
.mark.busy { opacity: .5; pointer-events: none; }
.mark-btn { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 800; font-size: .8rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.mark-btn.ok:hover { border-color: var(--ok); color: var(--ok); }
.mark-btn.no:hover { border-color: var(--err); color: var(--err); }
.mark-btn.ok[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.mark-btn.no[aria-pressed="true"] { background: var(--err); border-color: var(--err); color: #fff; }

/* Hafta / gün: daha büyük */
.cal-week .day.winter { background: var(--ice); border-color: var(--ice-line); }
.cal-week .day h3 a { color: var(--text); }
.cal-week .cal-item, .cal-day .cal-item, .feed-list .cal-item { font-size: .88rem; padding: 8px; margin-bottom: 8px; }
.cal-week .cal-item strong, .cal-day .cal-item strong, .cal-week .cal-food, .cal-day .cal-food { white-space: normal; }
.cal-day .mark-btn, .feed-list .mark-btn { width: 34px; height: 34px; font-size: 1.05rem; border-radius: 9px; }
.cal-day.winter { background: var(--ice); border-color: var(--ice-line); }
.ice-note { background: var(--ice-2); color: var(--ice-text); border: 1px solid var(--ice-line); border-radius: 10px; padding: 10px 12px; }
.feed-list li.cal-item { border-bottom: 0; align-items: center; }

/* Besleme formu: tekrar seçeneği */
.feeding-form [data-field="repeat"] > div { display: flex; flex-wrap: wrap; gap: 8px; }
.feeding-form [data-field="repeat"] label { font-weight: 500; }
.feeding-form [data-field="repeat"] > div > div label { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; cursor: pointer; background: var(--surface); }

@media (max-width: 760px) {
  .cal-month { grid-template-columns: 1fr; }
  .cal-month > .dow { display: none; }
  .cal-cell.out { display: none; }
  .cal-cell { min-height: 0; }
  .cal-add { opacity: 1; }
  .cal-item strong, .cal-food { white-space: normal; }
  .cal-sum { margin-left: 0; }
}

/* Makale görselleri */
.article-cover { margin: 0 0 20px; }
.article-cover img, .article-figure img { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid var(--border); }
.article-figure { margin: 20px 0; }
figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; text-align: center; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 24px; }
.gallery .article-figure { margin: 0; }
.gallery img { aspect-ratio: 4/3; object-fit: cover; }
.card-cover { width: calc(100% + 40px); margin: -20px -20px 12px; aspect-ratio: 16/9; object-fit: cover; display: block; border-radius: var(--radius) var(--radius) 0 0; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.img-item { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.img-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 4px; }
.img-item code { font-size: .8rem; }

/* Android uygulaması içinde: menü/alt bilgi uygulamanın kendisinde */
.app-mode .topbar, .app-mode footer { display: none; }
.app-mode main { padding: 16px 0 32px; }
.app-mode .hero { padding: 28px 22px; border-radius: 14px; }

/* İndirme sayfası */
.dl-hero { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.dl-card { display: flex; flex-direction: column; }
.dl-icon { font-size: 2rem; line-height: 1; margin-bottom: 6px; }
.dl-steps { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 16px; }
.token-box { display: flex; gap: 6px; }
.token-box .input { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }

/* Tür fotoğrafları */
.sp-photo { margin: 0 0 18px; }
.sp-photo img { width: 100%; max-height: 460px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.sp-photo figcaption { text-align: left; }
.sp-thumb { aspect-ratio: 4/3; }
.sp-row { display: flex; gap: 14px; align-items: center; }
.sp-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
/* Fotoğrafı olmayan türler için temsili çizim (renk alt familyaya göre) */
.sp-art {
  --c1: #8a3b12; --c2: #c4682c;
  position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 4/3;
  background: radial-gradient(120% 90% at 30% 20%, var(--c2), var(--c1)); color: #fff; border-radius: 8px;
}
.sp-art img { width: 62%; opacity: .9; filter: brightness(0) invert(1) drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.sp-art-genus { position: absolute; left: 10px; bottom: 8px; font-size: .8rem; font-weight: 700; opacity: .9; }
.sp-art-note { position: absolute; right: 10px; top: 8px; font-size: .7rem; background: rgba(0,0,0,.25); padding: 2px 8px; border-radius: 4px; }
.sf-myrmicinae { --c1: #6b2c10; --c2: #b4561f; }
.sf-formicinae { --c1: #3d2a17; --c2: #8a6b3a; }
.sf-dolichoderinae { --c1: #2c3e50; --c2: #4f6d8a; }
.sf-ponerinae, .sf-proceratiinae, .sf-amblyoponinae { --c1: #4a2040; --c2: #8a4a7a; }
.sf-dorylinae { --c1: #5a1f1f; --c2: #a33b3b; }
.card-cover.sp-art { border-radius: var(--radius) var(--radius) 0 0; }
.sp-suggest img.art { background: var(--brand-soft); padding: 4px; object-fit: contain; }
.sp-row .sp-art { width: 64px; height: 64px; aspect-ratio: auto; flex-shrink: 0; border-radius: 6px; }
.sp-row .sp-art .sp-art-genus { display: none; }
.sp-suggest img, .sp-suggest .noimg { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; flex-shrink: 0; margin-right: 6px; background: var(--surface-2); }

/* Canlı tür arama */
.sp-search { position: relative; }
.sp-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; list-style: none; margin: 0; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,.35); max-height: 340px; overflow-y: auto;
}
.sp-suggest li { padding: 9px 10px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; color: var(--text); }
.sp-suggest li .badge { margin-left: auto; }
.sp-suggest li.active, .sp-suggest li[role=option]:hover { background: var(--surface-2); }
.sp-suggest .empty-row { color: var(--muted); cursor: default; }
.hero .sp-search { max-width: 460px; margin-top: 18px; }
.hero .sp-search input { border: 0; padding: 13px 14px; }

/* Tür listesi */
.filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr) auto auto; gap: 10px; align-items: center; padding: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .filters { grid-template-columns: 1fr 1fr; } .filters .sp-search { grid-column: 1 / -1; } }
.sp-card { display: flex; flex-direction: column; gap: 2px; }
.sp-meta { margin-top: auto; padding-top: 6px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 22px; }
.hint { background: var(--surface-2); border-left: 3px solid var(--brand); border-radius: 4px; padding: 10px 12px; font-size: .88rem; }
.hint:empty { display: none; }

/* Yönetim sekmeleri */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Stats */
.stat { text-align: left; }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--brand); }
.stat .lbl { color: var(--muted); font-size: .85rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: .92rem; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }

/* Article */
.prose { max-width: 720px; font-size: 1.05rem; }
.prose p { margin: 0 0 1em; }
.locked { position: relative; max-height: 220px; overflow: hidden; }
.locked::after { content: ""; position: absolute; inset: auto 0 0 0; height: 140px; background: linear-gradient(transparent, var(--bg)); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.fact { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.fact .k { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.price { font-size: 2.2rem; font-weight: 800; }
.price s { font-size: 1.1rem; color: var(--muted); font-weight: 400; margin-right: 6px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: .9rem; }
pre.mail { white-space: pre-wrap; background: var(--surface-2); padding: 14px; border-radius: 10px; font-size: .9rem; }
