/* Küllük — minimal theme */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg: #ffffff;
    --text: #111111;
    --muted: #666666;
    --border: #e0e0e0;
    --link: #111111;
    --font: system-ui, -apple-system, sans-serif;
    --mono: ui-monospace, monospace;
    --max-w: 900px;
}

/* ── Dark mode ───────────────────────────────── */

html.dark {
    --bg: #131313;
    --text: #e0e0e0;
    --muted: #888888;
    --border: #2c2c2c;
    --link: #e0e0e0;
}

html.dark .vote-btn:hover { background: #252525; }
html.dark .page-btn:hover { background: #252525; }
html.dark .form-input,
html.dark input[type="text"],
html.dark input[type="email"],
html.dark input[type="password"],
html.dark textarea,
html.dark select { background: #1a1a1a; color: var(--text); border-color: var(--border); }
html.dark .search-input { background: #1a1a1a; }
html.dark .search-dropdown { background: #1a1a1a; }
html.dark .search-result:hover { background: #252525; }
html.dark .inactive-badge { background: #222; }
html.dark .stat-card { border-color: var(--border); }
html.dark .alert-error { background: #2d1515; border-color: #7a2020; color: #f87171; }
html.dark .alert-info { background: #0a2030; border-color: #1a4060; color: #60aade; }
html.dark #blazor-error-ui { background: #2a1f00; border-color: #8a6000; }
html.dark .new-topic-row input { background: #1a1a1a; }
html.dark .period-tab.active { background: #7b1d2e; color: #fff; border-color: #7b1d2e; }

/* ── Base ────────────────────────────────────── */

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    font-size: 15.4px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────── */

.kulluk-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.kulluk-header {
    border-bottom: none;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 48px;
    gap: 1rem;
    position: relative;
}

.brand {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    flex-shrink: 0;
    color: #7b1d2e;
}
.brand:hover { text-decoration: none; }

.mirror-k {
    display: inline-block;
    transform: scaleX(-1);
    margin-left: 0.5px;
}

/* ── Header search ───────────────────────────── */

.header-search {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 360px;
    z-index: 10;
}

.search-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.search-input {
    flex: 1;
    min-width: 0;
    padding: 0.35rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.1s;
}

.search-input:focus { border-color: #999; }

.adv-btn {
    background: var(--bg);
    color: #7b1d2e;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.1s;
    line-height: 1.4;
}

.adv-btn:hover, .adv-btn.active { background: var(--bg); color: #5e1522; border-color: #7b1d2e; }

/* ── Advanced search panel ───────────────────── */

.adv-backdrop {
    position: fixed;
    inset: 0;
    z-index: 400;
}

.adv-panel {
    position: fixed;
    top: 54px;
    left: 50%;
    transform: translateX(-50%);
    width: 540px;
    max-width: calc(100vw - 2rem);
    z-index: 401;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.14);
    max-height: 75vh;
    overflow-y: auto;
}

.adv-panel-inner {
    padding: 0 1rem 1.25rem;
}

.adv-tabs {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.adv-close {
    background: none;
    border: none;
    padding: 0.5rem 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
    cursor: pointer;
    margin-left: auto;
    font-family: inherit;
    line-height: 1;
}

.adv-close:hover { color: var(--text); }

.adv-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.adv-label {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}

.adv-date {
    width: auto !important;
    padding: 0.3rem 0.5rem !important;
    font-size: 0.82rem !important;
}

.adv-num {
    width: 90px !important;
    padding: 0.3rem 0.5rem !important;
    font-size: 0.82rem !important;
}

.adv-count {
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0 0 0.5rem;
}

.adv-result-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.adv-result-row a { color: var(--text); }
.adv-result-row a:hover { text-decoration: underline; }
.adv-result-row span { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

.adv-group { margin-bottom: 1.25rem; }

.adv-group-header {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
}

.adv-entry-row {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.adv-entry-topic { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.15rem; }
.adv-entry-topic a { color: var(--muted); font-weight: 500; }
.adv-entry-topic a:hover { color: var(--text); }
.adv-entry-content { font-size: 0.875rem; line-height: 1.5; color: var(--text); margin-bottom: 0.2rem; }
.adv-entry-meta { font-size: 0.72rem; color: var(--muted); display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.adv-entry-meta a { color: var(--muted); }
.adv-entry-meta a:hover { color: var(--text); }

.search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 200;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    overflow: hidden;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 0.875rem;
    font-size: 0.85rem;
    color: var(--text);
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: background 0.1s;
}

.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--border); text-decoration: none; }
.search-result-new { color: #0070c0; font-style: italic; }
html.dark .search-result-new { color: #5aabff; }
.search-no-result { color: var(--muted); cursor: default; }
.search-no-result:hover { background: none; }
.sr-icon { opacity: 0.5; font-size: 0.75rem; flex-shrink: 0; }

/* ── Header right ────────────────────────────── */

.header-right {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-left: auto;
    flex-shrink: 0;
}

.header-link {
    font-size: 0.8rem;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
}

.header-link:hover { color: var(--text); text-decoration: none; }
.header-link.active { color: var(--text); font-weight: 500; }

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    padding: 0.2rem 0.3rem;
    color: #7b1d2e !important;
    line-height: 1;
    color: var(--muted);
    border-radius: 4px;
    font-family: inherit;
}

.theme-toggle:hover { color: #5e1522 !important; }

.mesaj-btn { padding: 0.15rem 0.4rem; border-radius: 3px; display: inline-block; }
.mesaj-unread { background: #32cd32 !important; color: #fff !important; font-weight: 600; }

/* DM layout — desktop defaults */
.dm-layout { display: flex; gap: 1.5rem; align-items: flex-start; }
.dm-userlist { min-width: 180px; max-width: 220px; flex-shrink: 0; }
.dm-messages { height: 340px; overflow-y: auto; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.85rem; }

@keyframes screen-shake {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    10%      { transform: translate(-8px, -5px) rotate(-1deg); }
    20%      { transform: translate(8px, 5px) rotate(1deg); }
    30%      { transform: translate(-8px, 5px) rotate(-1deg); }
    40%      { transform: translate(8px, -5px) rotate(1deg); }
    50%      { transform: translate(-5px, 3px) rotate(-0.5deg); }
    60%      { transform: translate(5px, -3px) rotate(0.5deg); }
    70%      { transform: translate(-3px, 3px); }
    80%      { transform: translate(3px, -3px); }
    90%      { transform: translate(-1px, 1px); }
}
.screen-shake { animation: screen-shake 0.8s ease-in-out; }

@keyframes kulluk-shake {
    0%        { transform: translateX(0); }
    15%       { transform: translateX(-5px) rotate(-3deg); }
    30%       { transform: translateX(5px) rotate(3deg); }
    45%       { transform: translateX(-5px) rotate(-2deg); }
    60%       { transform: translateX(5px) rotate(2deg); }
    75%       { transform: translateX(-3px) rotate(-1deg); }
    90%       { transform: translateX(3px) rotate(1deg); }
    100%      { transform: translateX(0); }
}
.kulluk-shake {
    animation: kulluk-shake 0.6s ease-in-out;
}

/* ── Main nav bar ────────────────────────────── */

.main-nav {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 48px;
    z-index: 95;
}

.main-nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.main-nav-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.main-nav-btn:hover { color: var(--text); border-bottom-color: #7b1d2e; text-decoration: none; }
.main-nav-btn.active { color: var(--text); border-bottom-color: #7b1d2e; }

/* ── Feed tabs bar ───────────────────────────── */

.feed-tabs-bar {
    background: var(--bg);
    position: sticky;
    top: 88px;
    z-index: 90;
}

.feed-tabs-bar .filter-tabs {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: center;
    margin-bottom: 0;
    flex-wrap: nowrap;
}

.period-tabs {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0.375rem 1rem 0.5rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.period-tab {
    padding: 0.2rem 0.75rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--muted);
    font-family: inherit;
    transition: all 0.1s;
}

.period-tab:hover { color: var(--text); border-color: #999; }
.period-tab.active { background: #7b1d2e; color: #fff; border-color: #7b1d2e; }

/* ── Main content ────────────────────────────── */

.kulluk-main { flex: 1; padding: 1.5rem 1rem; }
.content-container { max-width: var(--max-w); margin: 0 auto; }

.kulluk-footer { border-top: 1px solid var(--border); padding: 0 1rem; }

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
    font-size: 0.75rem;
    color: var(--muted);
}

/* ── Feed ────────────────────────────────────── */

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.feed-header-cols { display: flex; font-size: 0.78rem; color: var(--muted); gap: 0.75rem; }
.col-count { width: 40px; text-align: right; }
.col-author { width: 54px; text-align: right; }

.topic-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.topic-row a { font-size: 0.9375rem; color: var(--text); flex: 1; min-width: 0; }
.topic-row a:hover { text-decoration: underline; }

.topic-meta-cols {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.topic-last-author {
    font-size: 0.78rem;
    color: var(--muted);
    font-family: var(--mono);
    min-width: 54px;
    text-align: right;
    text-decoration: none;
}

.topic-last-author:hover { color: var(--text); text-decoration: underline; }

.topic-copy-btn {
    background: none;
    border: none;
    padding: 0 0.25rem;
    font-size: 0.78rem;
    color: var(--border);
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    transition: color 0.1s;
}

.topic-row:hover .topic-copy-btn { color: var(--muted); }
.topic-copy-btn:hover { color: var(--text) !important; }

.topic-count {
    width: 40px;
    text-align: right;
    font-size: 0.875rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* ── Best entries ────────────────────────────── */

.best-entry-row {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border);
}

.saved-entry-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.2rem 0;
}

.saved-entry-title {
    font-size: 0.9rem;
}

.best-entry-topic {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.best-entry-topic a { color: var(--muted); font-weight: 500; }
.best-entry-topic a:hover { color: var(--text); }

.best-entry-content {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 0.35rem;
}

.best-entry-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.best-entry-score {
    font-weight: 600;
    color: #2d6a2d;
}

html.dark .best-entry-score { color: #5da85d; }

/* ── Filter tabs ─────────────────────────────── */

.filter-tabs { display: flex; gap: 0.375rem; margin-bottom: 1.25rem; flex-wrap: wrap; }

.filter-tab {
    padding: 0.3rem 0.875rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--muted);
    font-family: inherit;
    transition: all 0.1s;
    white-space: nowrap;
}

.filter-tab:hover { color: var(--text); border-color: #999; }
.filter-tab.active { background: #7b1d2e; color: #fff; border-color: #7b1d2e; font-weight: 500; }
html.dark .filter-tab.active { background: #7b1d2e; border-color: #7b1d2e; }

/* ── Entry ───────────────────────────────────── */

.entry-card { padding: 1rem 0; border-bottom: 1px solid var(--border); }

.entry-content {
    font-size: 0.9375rem;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 0.5rem;
}

.entry-meta {
    font-size: 0.75rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.entry-actions { margin-top: 0.375rem; display: flex; gap: 0.5rem; }

.entry-actions button {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.75rem;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.entry-actions button:hover { color: var(--text); }
.entry-actions button.danger:hover { color: #c00; }

.share-btn {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    text-decoration: none;
    line-height: 1;
}
.share-btn svg {
    width: 11px;
    height: 11px;
    fill: currentColor;
}
.share-btn:hover { color: var(--text); }
.share-btn-x:hover { color: #000; }
.share-btn-wa:hover { color: #25d366; }
html.dark .share-btn-x:hover { color: #fff; }

.vote-btn {
    background: none;
    border: none;
    padding: 0.1rem 0.35rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--muted);
    border-radius: 3px;
    font-family: inherit;
}

.vote-btn:hover { background: #f0f0f0; color: var(--text); }
.vote-btn.voted-up { color: #2d6a2d; }
.vote-btn.voted-down { color: #a00; }

/* ── Author badge ────────────────────────────── */

.author-link { color: var(--muted); font-size: 0.8rem; }
.author-link:hover { color: var(--text); text-decoration: none; }
.author-num { font-family: var(--mono); font-size: 0.73rem; }

/* ── Cookie banner ───────────────────────────── */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    z-index: 500;
    padding: 0.75rem 1rem;
}

.cookie-banner-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.cookie-banner-text {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
}

.cookie-banner-text a { color: var(--muted); text-decoration: underline; }

.cookie-banner-actions { flex-shrink: 0; }

html.dark .cookie-banner { background: var(--bg); }

/* ── Auth pages ──────────────────────────────── */

.auth-page { max-width: 400px; margin: 3rem auto; }
.auth-page h1 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.875rem; margin-bottom: 0.25rem; color: var(--muted); }

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.1s;
    background: var(--bg);
    color: var(--text);
}

.form-input:focus { border-color: #999; }

.btn-primary {
    background: #7b1d2e;
    color: #fff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.1s;
}

.btn-primary:hover { background: #5e1522; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
    background: var(--bg);
    color: #7b1d2e;
    border: 1px solid var(--border);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover { background: var(--bg); color: #5e1522; border-color: #7b1d2e; text-decoration: none; }
.btn-secondary.danger { border-color: #c00; color: #c00; }
.btn-secondary.danger:hover { border-color: #900; color: #900; }

.alert-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 0.625rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    padding: 0.625rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ── Topic detail ────────────────────────────── */

.topic-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
    position: sticky;
    top: 86px;
    background: var(--bg);
    z-index: 10;
}
.topic-title { font-size: 1.35rem; font-weight: 600; margin: 0 0 0.35rem; }
.topic-meta { font-size: 0.78rem; color: var(--muted); }

.sort-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.75rem;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
}
.sort-btn:hover { color: var(--text); }
.sort-btn.active { color: var(--text); font-weight: 500; }

.pin-badge {
    display: inline-block;
    font-size: 0.65rem;
    background: var(--text);
    color: var(--bg);
    border-radius: 3px;
    padding: 0.1rem 0.4rem;
    vertical-align: middle;
    margin-right: 0.4rem;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.pin-indicator {
    font-size: 0.7rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
    font-style: italic;
}

.entry-pinned {
    border-left: 2px solid var(--text);
    padding-left: 0.75rem;
}

.topic-row a.pinned-topic { font-weight: 500; }

.admin-action {
    color: #c07000 !important;
}
html.dark .admin-action { color: #e0a040 !important; }

.topic-count.pinned { font-weight: 600; color: var(--text); }

.new-entry-area { margin-top: 1rem; padding-top: 0; }

.textarea-wrap { position: relative; }
.chat-input-wrap { position: relative; }
.chat-input-wrap input { padding-right: 2.2rem; }
.emoji-toggle-inline {
    position: absolute;
    bottom: 0.4rem;
    right: 0.4rem;
    background: none;
    border: none;
    padding: 0.15rem 0.25rem;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    color: var(--muted);
    opacity: 0.5;
    border-radius: 4px;
}
.emoji-toggle-inline:hover { opacity: 1; background: var(--hover); }

.new-entry-area textarea {
    width: 100%;
    padding: 0.625rem 2.25rem 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 90px;
    outline: none;
    background: var(--bg);
    color: var(--text);
}

.new-entry-area textarea:focus { border-color: #999; }
.entry-submit-row { display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }

.emoji-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    color: var(--muted);
}
.emoji-toggle:hover { border-color: #999; color: var(--text); }

.shake-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    opacity: 0.75;
}
.shake-btn:hover { opacity: 1; }
.shake-btn:disabled { opacity: 0.3; cursor: default; }

.send-btn {
    background: none;
    border: none;
    padding: 0 0.25rem;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    color: #7b1d2e;
    opacity: 0.85;
    flex-shrink: 0;
}
.send-btn:hover { opacity: 1; }
.send-btn:disabled { opacity: 0.25; cursor: default; }

.emoji-panel {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-top: 0.375rem;
    background: var(--card);
}
.emoji-group { display: flex; flex-wrap: wrap; gap: 0.125rem; }
.emoji-btn {
    background: none;
    border: none;
    padding: 0.2rem;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 3px;
    line-height: 1;
}
.emoji-btn:hover { background: var(--border); }

/* ── Avatars ─────────────────────────────────── */

.avatar-sm { width: 32px; height: 32px; border-radius: 50%; display: block; flex-shrink: 0; }
.avatar-md { width: 32px; height: 32px; border-radius: 50%; display: block; flex-shrink: 0; }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; display: block; margin-bottom: 0.75rem; }

.entry-author { display: flex; align-items: center; gap: 0.5rem; }

.header-avatar-link {
    position: relative;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.avatar-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    color: var(--text);
    pointer-events: none;
}

.header-avatar-link:hover .avatar-tooltip { display: block; }

/* ── Profile ─────────────────────────────────── */

.profile-header { margin-bottom: 1.75rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.profile-nick { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.1rem; font-family: var(--mono); }
.profile-num { font-family: var(--mono); font-size: 0.875rem; color: var(--muted); }
.profile-stats { font-size: 0.8rem; color: var(--muted); display: flex; gap: 1.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.profile-bio { font-size: 0.9rem; margin-top: 0.75rem; }

/* ── İstatistik ──────────────────────────────── */

.stat-row { display: flex; justify-content: space-between; align-items: baseline; padding: 0.45rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.stat-label { color: var(--muted); }
.stat-value { font-family: var(--mono); font-weight: 500; }

/* ── IRC Sohbet ──────────────────────────────── */

.irc-layout {
    display: flex;
    gap: 1rem;
    height: calc(100dvh - 120px);
    min-height: 400px;
}

.irc-sidebar {
    width: 160px;
    flex-shrink: 0;
    border-left: 1px solid var(--border);
    padding-left: 1rem;
    overflow-y: auto;
}

.irc-sidebar-title {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.irc-member {
    font-size: 0.8rem;
    padding: 0.15rem 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.irc-member-me { color: #7b1d2e; }
.irc-member:not(.irc-member-me) { cursor: pointer; }
.irc-member:not(.irc-member-me):hover { color: var(--text); }
.irc-prefix { color: #7b1d2e; font-weight: 700; margin-right: 1px; }

.irc-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4caf50;
    flex-shrink: 0;
    display: inline-block;
}

.irc-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.irc-messages {
    flex: 1;
    overflow-y: auto;
    font-size: 0.85rem;
    font-family: var(--mono);
    line-height: 1.6;
    padding-bottom: 0.5rem;
}

.irc-line {
    display: flex;
    gap: 0.5rem;
    padding: 0.05rem 0;
}

.irc-line-me .irc-nick { color: #7b1d2e; }

.irc-time { color: var(--muted); flex-shrink: 0; }
.irc-nick { font-weight: 600; flex-shrink: 0; }
.irc-text { word-break: break-word; }

.irc-empty { color: var(--muted); font-style: italic; font-family: inherit; }

.irc-action { color: var(--muted); }
.irc-action-text { font-style: italic; }

.irc-input-row {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

.irc-input { font-family: var(--mono); font-size: 0.875rem; width: 100%; }

.irc-readonly {
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
}

.irc-readonly a { color: #7b1d2e; }
.irc-readonly a:hover { color: #a02540; }

/* ── IRC MOTD Banner (kanal başı) ────────────── */

.irc-motd-block {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
}

.irc-motd-art {
    margin: 0.15rem 0 0.5rem;
    padding: 0;
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.25;
    color: #7b1d2e;
    white-space: pre;
    overflow: hidden;
    max-width: 100%;
}

.lakirti-messages {
    height: 260px;
    overflow-y: auto;
    padding: 0.65rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.8rem;
}

html.dark .irc-motd-art { color: #c94060; }

.irc-motd-server {
    margin: 0;
    color: var(--muted);
    font-style: italic;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.6;
}

.irc-motd-motd {
    margin: 0;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.6;
}

.irc-motd-motd a { color: #7b1d2e; }
.irc-motd-motd a:hover { color: #a02540; }
html.dark .irc-motd-motd a { color: #e06a80; }

.irc-motd-sep {
    border: none;
    border-top: 1px dashed var(--border);
    margin: 0.5rem 0 0.25rem;
}

/* ── MOTD / Welcome ──────────────────────────── */

.motd-wrap {
    padding: 0.5rem 0 2rem;
}

.motd-block {
    font-size: 0.85rem;
    font-family: var(--mono);
    line-height: 1.65;
}

.motd-server { color: var(--muted); font-style: italic; }
.motd-motd   { color: var(--text); }

.motd-art {
    margin: 0.4rem 0;
    padding: 0;
    font-family: var(--mono);
    font-size: 1rem;
    line-height: 1.2;
    color: #7b1d2e;
    overflow-x: auto;
    white-space: pre;
}

html.dark .motd-art { color: #c94060; }

.motd-link {
    color: #7b1d2e;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.motd-link:hover { color: #a02540; }
html.dark .motd-link { color: #e06a80; }
html.dark .motd-link:hover { color: #f08090; }

@keyframes motd-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.motd-in {
    opacity: 0;
    animation: motd-in 0.12s ease forwards;
    animation-delay: calc(var(--mi, 0) * 90ms);
}

/* ── Pagination ──────────────────────────────── */

.pagination { display: flex; gap: 0.375rem; margin-top: 1.5rem; align-items: center; }

.page-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    color: var(--text);
}

.page-btn:hover { background: #f5f5f5; }
.page-btn.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Admin ───────────────────────────────────── */

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

.admin-table th {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 2px solid var(--border);
    color: var(--muted);
    font-weight: 500;
}

.admin-table td { padding: 0.5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }

.admin-table button {
    background: none;
    border: 1px solid var(--border);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
    margin-right: 0.25rem;
}

.admin-table button:hover { background: #f5f5f5; }
.admin-table button.danger { border-color: #fca5a5; color: #c00; }
.admin-table button.danger:hover { background: #fef2f2; }

.stat-cards { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }

.stat-card { border: 1px solid var(--border); border-radius: 6px; padding: 1rem 1.5rem; min-width: 120px; }
.stat-card-value { font-size: 1.75rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-card-label { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }

/* ── Soy ağacı ───────────────────────────────── */

.vis-container { width: 100%; min-height: 480px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; position: relative; }
#family-tree-svg { width: 100%; display: block; }

/* ── Misc ────────────────────────────────────── */

.page-heading { font-size: 1rem; font-weight: 600; margin: 0 0 1.25rem; }
.text-muted { color: var(--muted); }
.text-danger { color: #c00; }
.text-small { font-size: 0.8rem; }

.inactive-badge {
    font-size: 0.7rem;
    background: #f5f5f5;
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.1rem 0.4rem;
    color: var(--muted);
    vertical-align: middle;
}

#blazor-error-ui {
    display: none;
    background: #fffbeb;
    border-top: 1px solid #fbbf24;
    padding: 0.5rem 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    font-size: 0.875rem;
    z-index: 1000;
}

#blazor-error-ui .reload { font-weight: 600; margin-left: 0.5rem; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }

/* ── Mobile ──────────────────────────────────── */

@media (max-width: 600px) {
    /* Header: stack brand + search vertically */
    .kulluk-header { padding: 0 0.75rem; }

    .header-inner {
        height: auto;
        flex-wrap: wrap;
        padding: 0.5rem 0;
        gap: 0.5rem;
    }

    .header-search {
        position: static;
        transform: none;
        width: 100%;
        order: 3;
        padding-bottom: 0.5rem;
    }

    .header-right {
        gap: 0.4rem;
    }

    /* Hide less critical nav items on mobile */
    .header-right .header-link.nav-secondary {
        display: none;
    }

    /* Main nav */
    .main-nav { top: 0; }
    .main-nav-btn { padding: 0.45rem 1rem; }
    .topic-header { top: 38px; }

    /* Feed tabs: scroll horizontally */
    .feed-tabs-bar { top: 40px; }

    .feed-tabs-bar .filter-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0;
        scrollbar-width: none;
    }

    .feed-tabs-bar .filter-tabs::-webkit-scrollbar { display: none; }

    .period-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .period-tabs::-webkit-scrollbar { display: none; }

    /* Main content spacing */
    .kulluk-main { padding: 1rem 0.75rem; }

    /* Topic row: tighter */
    .topic-row { gap: 0.5rem; }
    .topic-last-author { min-width: 44px; }

    /* Entry area */
    .new-entry-area textarea { min-height: 70px; }

    /* Admin table: horizontal scroll */
    .admin-table { display: block; overflow-x: auto; white-space: nowrap; }

    /* Stat cards: smaller */
    .stat-card { padding: 0.75rem 1rem; }
    .stat-card-value { font-size: 1.4rem; }

    /* Profile stats */
    .profile-stats { gap: 0.75rem; }

    /* vis containers on mobile */
    .vis-container { min-height: 320px; }

    /* Cookie banner on mobile */
    .cookie-banner-inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .cookie-btn { align-self: flex-end; }

    /* IRC oda: tam yükseklik */
    .irc-layout {
        flex-direction: column;
        height: calc(100dvh - 90px);
        min-height: 0;
    }

    .irc-messages {
        flex: 1;
        height: auto;
        min-height: 0;
    }

    /* Klasik IRC görünümü — taşma olmadan */
    .irc-line {
        flex-wrap: wrap;
        font-size: 0.78rem;
        gap: 0.15rem;
    }

    .irc-nick { flex-shrink: 0; }
    .irc-text { word-break: break-word; overflow-wrap: anywhere; min-width: 0; }
    .irc-time { flex-shrink: 0; }

    /* iOS zoom fix — input font-size 16px olunca zoom olmaz */
    .form-input, input[type="text"], textarea { font-size: 16px !important; }

    .irc-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: 0.75rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem 0.75rem;
        overflow-y: visible;
    }

    .irc-sidebar-title { width: 100%; margin-bottom: 0.25rem; }
    .motd-wrap { padding: 0; }
    .motd-art { font-size: 0.65rem; }
    .irc-motd-art { font-size: 0.48rem; }

    /* Lakirti (başlık sohbet) — sidebar gizle, tam genişlik */
    .lakirti-sidebar { display: none; }
    .lakirti-messages { height: 45vh; min-height: 180px; }

    /* Lakirti açıkken entry'leri gizle */
    .topic-chat-open .topic-entries-section { display: none; }
    .topic-chat-open .lakirti-messages { height: calc(100dvh - 155px); min-height: 300px; }

    /* Mesajlar sayfası: kolon → dikey */
    .dm-layout { flex-direction: column; gap: 1rem; }
    .dm-userlist { min-width: unset; max-width: unset; width: 100%; }
    .dm-userlist-inner { display: flex; flex-wrap: nowrap; gap: 0.25rem; overflow-x: auto; padding-bottom: 0.25rem; scrollbar-width: none; }
    .dm-userlist-inner::-webkit-scrollbar { display: none; }
    .dm-userlist-inner > div { margin-bottom: 0 !important; flex-shrink: 0; }
    .dm-messages { height: 50dvh; }

    /* Emoji toggle ve panel mobilde gizle — klavye zaten emoji destekliyor */
    .emoji-toggle-inline { display: none; }
    .emoji-panel { display: none !important; }
}

/* ── Yeni üye rozeti ── */
.new-badge {
    font-size: 0.65rem;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 3px;
    padding: 0.1rem 0.4rem;
    color: #388e3c;
    vertical-align: middle;
}
html.dark .new-badge {
    background: #1b2e1c;
    border-color: #2e5c30;
    color: #81c784;
}

/* ── Klavye navigasyonu — fokuslanmış entry ── */
.entry-card.entry-focused {
    outline: 2px solid var(--accent, #555);
    outline-offset: -2px;
    border-radius: 3px;
}

/* ── Karakter sayacı ── */

/* ── Yazar rozetleri (bot / noob / noob bot) ── */
.author-badge {
    font-size: 1.1rem;
    vertical-align: middle;
    line-height: 1;
}

/* ── Çok kademeli oy UI ── */
.vote-group { display: inline-flex; align-items: center; gap: 0.25rem; }
.vote-own {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 1.8rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.vote-pos  { color: #1565c0; }
.vote-neg  { color: #c62828; }
.vote-zero { color: var(--muted); }
.vote-score {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 2rem;
    font-variant-numeric: tabular-nums;
}
.score-pos { color: #1565c0; }
.score-neg { color: #c62828; }
html.dark .vote-pos,  html.dark .score-pos { color: #90caf9; }
html.dark .vote-neg,  html.dark .score-neg { color: #ef9a9a; }
