:root {
  --bg: #f5f0e6;
  --surface: #fffdf8;
  --surface-2: #efe8da;
  --border: #e2d8c4;
  --text: #23201a;
  --muted: #7a7062;
  --accent: #1e5b52;
  --accent-ink: #ffffff;
  --accent-soft: #e2ece7;
  --gold: #a07a2c;
  --gold-soft: #f3e8cf;
  --shadow: 0 1px 2px rgba(60,45,20,.06), 0 8px 24px rgba(60,45,20,.07);
  --radius: 14px;
  --topbar: 68px;
  --sidebar: 256px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11100d; --surface: #1a1814; --surface-2: #24211b; --border: #353026;
    --text: #f1ebde; --muted: #a69d8c; --accent: #6cbcab; --accent-ink: #0d1a17; --accent-soft: #1b2b27;
    --gold: #d4af61; --gold-soft: #2c2618;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11100d; --surface: #1a1814; --surface-2: #24211b; --border: #353026;
  --text: #f1ebde; --muted: #a69d8c; --accent: #6cbcab; --accent-ink: #0d1a17; --accent-soft: #1b2b27;
  --gold: #d4af61; --gold-soft: #2c2618;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 12px); }
html, body { margin: 0; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .005em; }
.eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar);
  display: flex; align-items: center; gap: 16px; padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.2) blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.brand-logo svg { width: 42px; height: 42px; display: block; }
.lg-bg { fill: var(--accent); stroke: none; }
.lg-ring { fill: none; stroke: var(--gold); stroke-width: 1.4; }
.lg-ticks { stroke: var(--gold); stroke-width: 1.6; }
.brand-logo text { font-family: var(--serif); font-size: 15px; font-weight: 700; fill: #fff; stroke: none; letter-spacing: .5px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-family: var(--serif); font-size: 22px; }
.brand-text small { font-size: 12px; color: var(--muted); }
.search { position: relative; flex: 1; max-width: 640px; margin: 0 auto; }
.search > svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search input {
  width: 100%; height: 44px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); padding: 0 44px 0 44px; outline: none; font-size: 15px;
}
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.kbd { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 12px var(--sans); color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; background: var(--surface-2); pointer-events: none; }
.search input:focus ~ .kbd, .search input:not(:placeholder-shown) ~ .kbd { display: none; }
.suggest {
  position: absolute; top: 52px; left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; z-index: 40; padding: 6px;
}
.suggest button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: 9px; }
.suggest button:hover, .suggest button.active { background: var(--surface-2); }
.suggest .s-kind { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.suggest .s-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .s-ico { color: var(--gold); display: grid; }
.suggest .s-ico svg { width: 16px; height: 16px; }
.top-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--text); flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.yt-link {
  display: inline-flex; align-items: center; gap: 8px; margin-left: 6px; padding: 9px 16px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.yt-link:hover { filter: brightness(1.08); }
.yt-link svg { width: 18px; height: 18px; }
.menu-btn { display: none; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
  position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto;
  padding: 14px 12px 24px; border-right: 1px solid var(--border); display: flex; flex-direction: column; scrollbar-width: thin;
}
.sidebar-head { display: none; }
.nav-title { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); padding: 18px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; font-size: 14px; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item .ico { display: grid; color: var(--muted); }
.nav-item.active .ico { color: var(--accent); }
.nav-item .ico svg { width: 18px; height: 18px; }
.nav-item .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sidebar-foot { margin-top: auto; padding: 18px 12px 0; font-size: 12px; color: var(--muted); }
.scrim { display: none; }

.main { padding: 26px 32px 40px; min-width: 0; }

/* ---------- home ---------- */
.hero {
  position: relative; overflow: hidden; padding: 44px 40px 34px; border-radius: 22px; margin-bottom: 30px;
  background: linear-gradient(160deg, #1e5b52 0%, #12392f 100%);
  color: #fff;
}
.hero-pattern {
  position: absolute; inset: 0; opacity: .13; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23f3d58a' stroke-width='1'%3E%3Cpath d='M40 8l9.4 22.6L72 40l-22.6 9.4L40 72l-9.4-22.6L8 40l22.6-9.4z'/%3E%3Crect x='22' y='22' width='36' height='36' transform='rotate(45 40 40)'/%3E%3Crect x='22' y='22' width='36' height='36'/%3E%3Ccircle cx='40' cy='40' r='6'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(90deg, transparent 15%, #000 85%); mask-image: linear-gradient(90deg, transparent 15%, #000 85%);
}
.hero > * { position: relative; }
.hero .eyebrow { color: #f3d58a; }
.hero h1 { margin: 0 0 10px; font-size: clamp(34px, 5vw, 54px); line-height: 1.05; font-weight: 700; }
.hero-desc { margin: 0; max-width: 620px; font-size: 16px; opacity: .88; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 26px; }
.stat b { display: block; font-family: var(--serif); font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; color: #f3d58a; }
.stat span { font-size: 13px; opacity: .8; }

.home section { margin-bottom: 34px; }
.sec-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-head h2 { margin: 0; font-size: 28px; }
.sec-head p { margin: 0; color: var(--muted); font-size: 14px; }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.topic {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); cursor: pointer; text-align: left;
  background: var(--surface); border: 1px solid var(--border); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.topic:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow); }
.topic .t-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; flex: none; }
.topic .t-ico svg { width: 22px; height: 22px; }
.topic b { display: block; font-family: var(--serif); font-size: 19px; line-height: 1.15; }
.topic span { font-size: 13px; color: var(--muted); }

.sure-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sure {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; cursor: pointer; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
}
.sure:hover { border-color: var(--accent); }
.sure .no {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--gold);
  background: var(--gold-soft); clip-path: polygon(50% 0, 64% 14%, 85% 15%, 86% 36%, 100% 50%, 86% 64%, 85% 85%, 64% 86%, 50% 100%, 36% 86%, 15% 85%, 14% 64%, 0 50%, 14% 36%, 15% 15%, 36% 14%);
}
.sure .nm { font-family: var(--serif); font-size: 17px; font-weight: 600; flex: 1; line-height: 1.1; }
.sure .c { font-size: 12px; color: var(--muted); }
.more-btn { margin-top: 10px; }

.series-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 260px); gap: 14px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.series { cursor: pointer; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); overflow: hidden; text-align: left; padding: 0; }
.series:hover { border-color: var(--gold); }
.series .thumb { border-radius: 0; }
.series .s-count { position: absolute; inset: 0 0 0 auto; width: 38%; background: rgba(17,16,13,.78); color: #fff; display: grid; place-content: center; text-align: center; gap: 2px; }
.series .s-count b { font-family: var(--serif); font-size: 26px; line-height: 1; }
.series .s-count span { font-size: 11px; opacity: .8; }
.series .s-body { padding: 10px 14px 12px; }
.series .s-body b { font-family: var(--serif); font-size: 18px; display: block; line-height: 1.2; }

.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 280px); gap: 16px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }

/* ---------- page head (filtered) ---------- */
.page-head { padding: 6px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; }
.page-head .hero-desc { color: var(--muted); opacity: 1; }
.back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px 0; margin-bottom: 10px; font-size: 14px; }
.back:hover { color: var(--accent); }
.back svg { width: 16px; height: 16px; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.toolbar-left { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.toolbar-left h2 { margin: 0; font-size: 26px; }
.count { color: var(--muted); font-size: 14px; white-space: nowrap; }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 11px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 11px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--muted); display: grid; place-items: center; white-space: nowrap; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }
.seg svg { width: 16px; height: 16px; }
select { height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); padding: 0 10px; cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; border: 0; cursor: pointer; font-weight: 500; }
.chip svg { width: 14px; height: 14px; }
.tag { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tag:hover { border-color: var(--gold); }
.tag svg { width: 15px; height: 15px; color: var(--gold); }

/* ---------- grid / cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 26px 18px; }
.card { cursor: pointer; border-radius: var(--radius); outline: none; min-width: 0; }
.card:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.thumb { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.card:hover .thumb img, .series:hover .thumb img { transform: scale(1.04); }
.badge { position: absolute; right: 8px; bottom: 8px; background: rgba(17,16,13,.82); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.badge.new { left: 8px; right: auto; top: 8px; bottom: auto; background: var(--gold); color: #1a1408; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.35); }
.progress i { display: block; height: 100%; background: var(--gold); }
.watched-mark { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.card-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; }
.card-actions button { width: 32px; height: 32px; border-radius: 999px; border: 0; background: rgba(17,16,13,.72); color: #fff; display: grid; place-items: center; cursor: pointer; }
.card-actions button svg { width: 16px; height: 16px; }
.card-actions button.on { background: var(--gold); color: #1a1408; }
.card-actions button.on svg { fill: currentColor; }
.card-info { padding: 10px 2px 0; }
.card-cat { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 3px; display: block; }
.card-title {
  margin: 0 0 4px; font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { font-size: 13px; color: var(--muted); }
mark { background: color-mix(in srgb, var(--gold) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* list (fihrist) view */
.grid.list { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--border); }
.grid.list .card { display: grid; grid-template-columns: 34px 132px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 8px; border-radius: 0; border-bottom: 1px solid var(--border); }
.grid.list .card:hover { background: var(--surface); }
.grid.list .thumb { border-radius: 8px; }
.grid.list .card-actions { display: none; }
.grid.list .card-info { padding: 0; }
.grid.list .card-title { font-size: 18px; -webkit-line-clamp: 1; }
.grid.list .idx { font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.grid.list .row-end { display: flex; align-items: center; gap: 4px; }
.idx, .row-end { display: none; }
.grid.list .idx, .grid.list .row-end { display: flex; justify-content: flex-end; }
.row-end a, .row-end button { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px; color: var(--muted); border: 0; background: none; cursor: pointer; }
.row-end a:hover, .row-end button:hover { background: var(--surface-2); color: var(--accent); }
.row-end button.on { color: var(--gold); }
.row-end button.on svg { fill: currentColor; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--gold); }
.empty h3 { color: var(--text); margin: 10px 0 4px; font-size: 24px; }
.btn { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-size: 14px; font-weight: 500; }
.btn:hover { background: var(--surface-2); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.on { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.btn.on svg { fill: currentColor; }

.foot { margin-top: 50px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; text-align: center; }
.foot p { margin: 4px 0; }
.foot b { font-family: var(--serif); font-size: 18px; color: var(--text); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10,9,7,.78); backdrop-filter: blur(3px); }
.modal-box { position: relative; width: min(1180px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; background: var(--surface); border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.modal-top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.modal-top-title { flex: 1; min-width: 0; font-family: var(--serif); font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.modal-close:hover { background: var(--surface-2); }
.player { aspect-ratio: 16/9; background: #000; overflow: hidden; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.modal-body { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; padding: 22px 26px 28px; }
.modal-main h2 { margin: 0 0 6px; font-size: 30px; line-height: 1.15; }
.m-meta { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.m-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.m-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.m-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-nav:empty { display: none; }
.m-nav button { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; min-width: 0; }
.m-nav button:hover { border-color: var(--accent); }
.m-nav small { display: block; font-size: 12px; color: var(--muted); }
.m-nav span { display: block; font-family: var(--serif); font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-nav .nx { text-align: right; grid-column: 2; }
.modal-side h3 { margin: 0 0 10px; font-size: 21px; }
@media (min-width: 1101px) {
  .modal-side { max-height: 640px; overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }
}
.rel { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; padding: 6px; margin: 0 -6px; border-radius: 10px; cursor: pointer; }
.rel:hover { background: var(--surface-2); }
.rel .thumb { border-radius: 8px; }
.rel .badge { font-size: 11px; right: 4px; bottom: 4px; }
.rel h4 { margin: 0 0 3px; font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rel .card-meta { font-size: 12px; }
.rel.current { background: var(--accent-soft); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; transition: .2s; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.bottom-nav { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .modal-body { grid-template-columns: 1fr; }
  .brand-text small { display: none; }
}
@media (max-width: 900px) {
  :root { --topbar: 60px; }
  .layout { grid-template-columns: 1fr; }
  .menu-btn { display: grid; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100%; width: min(320px, 86vw); z-index: 45;
    background: var(--surface); transform: translateX(-100%); transition: transform .22s ease; padding-top: 10px; border-right: 0;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .sidebar-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 4px 12px; }
  .sidebar-head b { font-family: var(--serif); font-size: 24px; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 44; }
  .yt-link span { display: none; }
  .yt-link { padding: 0; width: 40px; height: 40px; justify-content: center; margin-left: 0; }
  .main { padding: 18px 16px calc(84px + env(safe-area-inset-bottom)); }
  .hero { padding: 30px 22px 24px; border-radius: 18px; }
  .stats { gap: 18px; }
  .stat b { font-size: 24px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; cursor: pointer; }
  .bottom-nav button.active { color: var(--accent); font-weight: 600; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .grid.list .card { grid-template-columns: 112px minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; }
  .grid.list .idx { display: none; }
  .grid.list .card-title { -webkit-line-clamp: 2; font-size: 17px; }
}
@media (max-width: 600px) {
  .topbar { padding: 0 8px; gap: 4px; }
  .brand-text, #randomBtn, .kbd { display: none; }
  .brand-logo svg { width: 36px; height: 36px; }
  .search input { height: 40px; padding: 0 12px 0 38px; font-size: 16px; }
  .search > svg { left: 12px; }
  .sec-head h2, .toolbar-left h2 { font-size: 24px; }
  .topic-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .topic { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .topic b { font-size: 18px; }
  .sure-grid { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr; gap: 22px; }
  .toolbar-right { width: 100%; display: grid; grid-template-columns: 1fr auto; }
  #durationSeg { grid-column: 1 / -1; }
  #durationSeg button { flex: 1; }
  select { width: 100%; }
  .modal { padding: 0; }
  .modal-box { max-height: 100%; height: 100%; border-radius: 0; }
  .player { position: sticky; top: 52px; z-index: 2; }
  .modal-top { padding-left: 16px; }
  .modal-body { padding: 16px 16px 40px; }
  .modal-main h2 { font-size: 25px; }
  .m-nav { grid-template-columns: 1fr; }
  .m-nav .nx { grid-column: 1; }
  .rel { grid-template-columns: 120px minmax(0, 1fr); }
}

/* ---------- üst yazı (sayfa notu) & yazılar ---------- */
.prose { font-size: 16.5px; line-height: 1.75; }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }
.prose h3 { font-size: 24px; margin: 1.2em 0 .4em; }
.prose blockquote { margin: 1em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--gold); font-family: var(--serif); font-size: 21px; line-height: 1.45; color: var(--text); }
.prose strong { font-weight: 600; }
.page-note {
  position: relative; margin: 0 0 26px; padding: 22px 26px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--gold);
}
.posts { display: grid; gap: 22px; margin-bottom: 34px; }
.post { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px 30px; }
.post > h2 { margin: 0 0 14px; font-size: clamp(26px, 3.2vw, 34px); line-height: 1.15; }
.post > h2::after { content: ""; display: block; width: 56px; height: 2px; background: var(--gold); margin-top: 12px; }
.post .prose { max-width: 760px; }
.post-videos { margin-top: 24px; padding-top: 18px; border-top: 1px dashed var(--border); }
.post-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px 16px; }
.post-grid .card-title { font-size: 17px; }
@media (max-width: 600px) {
  .post { padding: 20px 18px; border-radius: 14px; }
  .page-note { padding: 18px; }
  .prose { font-size: 16px; }
  .post-grid { grid-template-columns: 1fr; }
}
