/* Ortak yerleşim */
:root {
    --bg: #0b0e0c;
    --panel: #111613;
    --panel-2: #171d19;
    --panel-3: #202822;
    --border: rgba(213,235,217,.13);
    --muted: #a0aba0;
    --lime: #c2f781;
    --nav-height: 64px;
}

body.dashboard-body {
    background: var(--bg);
}

.app-layout {
    width: min(1060px,100%);
    grid-template-columns: 184px minmax(0, 1fr);
    gap: 34px;
    min-height: 100dvh;
    padding-inline: 26px;
}

.sidebar {
    height: 100dvh;
    min-height: 0;
    padding: 26px 13px 18px 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

.logo {
    margin: 1px 0 34px 9px;
    font-size: 27px;
}

.main-nav {
    gap: 4px;
}

.nav-item {
    min-height: 42px;
    gap: 10px;
    padding-inline: 10px;
}

.nav-item.active {
    background: #24341e;
    box-shadow: none;
}

.nav-icon {
    width: 23px;
    flex-shrink: 0;
    font-size: 19px;
}

.nav-more summary,
.post-more summary,
.comment-disclosure summary,
.composer-attachment summary {
    cursor: pointer;
    list-style: none;
}

.nav-more summary::-webkit-details-marker,
.post-more summary::-webkit-details-marker,
.comment-disclosure summary::-webkit-details-marker,
.composer-attachment summary::-webkit-details-marker {
    display: none;
}

.nav-more-links {
    margin: 5px 0 7px 11px;
    border-inline-start: 1px solid var(--border);
}

.nav-more-links .nav-item {
    margin-inline-start: 5px;
    min-height: 37px;
    font-size: 13px;
}

.sidebar-bottom {
    padding: 20px 3px 0;
}

.feed {
    padding-block: 26px 48px;
}

.topbar {
    min-height: 44px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}

.topbar h1 {
    margin-block: 0 3px;
    font-size: clamp(24px, 4vw, 31px);
}

.topbar p {
    font-size: 13px;
    overflow-wrap: anywhere;
}

.post-card,
.composer-card,
.profile-page .profile-card {
    background: var(--panel);
    border-color: var(--border);
    border-radius: 16px;
    box-shadow: none;
}

.post-card {
    margin-bottom: 12px;
}

.composer-card {
    margin-bottom: 22px;
}

.composer-card textarea {
    min-height: 83px;
}

.composer-attachment {
    margin: 8px 0 4px;
}

.composer-attachment .edit-field {
    margin: 9px 0 4px;
}

.composer-footer {
    flex-wrap: wrap;
    gap: 8px;
}

.post-actions {
    padding: 10px 0 0;
    margin-top: 12px;
    border-bottom: 0;
}

.post-tools-compact,
.comment-disclosure {
    display: inline-flex;
    align-items: start;
    vertical-align: top;
    margin: 9px 6px 0 0;
}

.comment-disclosure[open] {
    display: block;
    margin-right: 0;
}

.comment-disclosure [id^="comment-"]:target {
    outline: 1px solid var(--lime);
    outline-offset: 5px;
    border-radius: 5px;
}

.post-more {
    position: relative;
}

.post-menu-panel {
    position: absolute;
    z-index: 12;
    top: calc(100% + 6px);
    inset-inline-start: 0;
    display: grid;
    gap: 4px;
    padding: 6px;
    width: max-content;
    max-width: min(240px,80vw);
    background: #202822;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 28px #0007;
}

.post-menu-panel .action-button {
    width: 100%;
    background: transparent;
    text-align: start;
}

.post-menu-panel .action-button:hover,
.post-menu-panel .action-button:focus-visible {
    background: #334331;
}

.post-saved-mark {
    color: var(--lime);
}

.post-copy-feedback {
    min-width: 0;
    padding-top: 9px;
}

.dashboard-body :focus-visible {
    outline: 2px solid var(--lime);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Mesajlar */
body.chat-page {
    overflow: hidden;
    padding: 0;
}

.chat-page .app-layout {
    width: min(1420px,100%);
    height: var(--chat-viewport,100dvh);
    min-height: 0;
    gap: 22px;
}

.chat-page .feed {
    min-height: 0;
    height: 100%;
    padding: 18px 0;
}

.chat-shell {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(215px, 300px) minmax(0,1fr);
    border: 1px solid var(--border);
    border-radius: 17px;
    background: var(--panel);
    overflow: hidden;
}

.chat-shell [hidden] {
    display: none !important;
}

.chat-inbox,
.chat-panel,
.chat-main,
.chat-scroll,
.chat-inbox-scroll {
    min-width: 0;
    min-height: 0;
}

.chat-inbox {
    display: grid;
    grid-template-rows: auto minmax(0,1fr);
    border-inline-end: 1px solid var(--border);
}

.chat-inbox-head {
    padding: 17px 12px 10px;
    border-bottom: 1px solid var(--border);
}

.chat-heading-row,
.chat-filters,
.chat-inbox-search,
.chat-thread-search,
.chat-compose,
.chat-request-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-heading-row {
    justify-content: space-between;
    margin: 0 0 12px;
}

.chat-heading-row h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 23px;
    letter-spacing: -.6px;
    margin: 0;
}

.chat-filters {
    flex-wrap: wrap;
    margin-top: 8px;
}

.chat-filters [aria-current="page"] {
    color: var(--lime);
    background: #253420;
}

.chat-inbox-search input,
.chat-thread-search input,
.chat-compose textarea {
    min-width: 0;
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 9px 11px;
    background: #0e120f;
    color: var(--text);
}

.chat-inbox-scroll,
.chat-scroll {
    overflow-y: auto;
    scrollbar-width: thin;
    overscroll-behavior: contain;
}

.chat-contact {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 66px;
    padding: 9px;
    margin: 3px 5px;
    border-radius: 10px;
}

.chat-contact:hover,
.chat-contact.current {
    background: #263520;
}

.chat-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
}

.chat-contact-text,
.chat-person > span:last-child,
.chat-contact-meta {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.chat-contact strong,
.chat-contact small,
.chat-person strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-contact small,
.chat-person small {
    color: var(--muted);
    font-size: 11px;
}

.chat-contact-meta {
    text-align: end;
    justify-items: end;
}

.chat-contact-meta small {
    font-size: 10px;
}

.chat-count {
    min-width: 19px;
    padding: 2px 5px;
    border-radius: 999px;
    background: var(--lime);
    color: #10160e;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
}

.chat-list-empty,
.chat-list-more {
    margin: 9px;
}

.chat-panel {
    display: grid;
    grid-template-rows: auto minmax(0,1fr) auto;
    background: #101511;
}

.chat-panel > .chat-welcome {
    grid-row: 1 / -1;
    align-self: center;
}

.chat-chooser {
    grid-row: 1 / -1;
    width: min(100%, 560px);
    padding: 20px 14px;
    margin-inline: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.chat-chooser h2 {
    margin-block: 12px;
}

.chat-chooser .chat-inbox-search {
    margin-bottom: 10px;
}

.chat-welcome {
    text-align: center;
    color: var(--muted);
    padding: 22px;
}

.chat-welcome h2 {
    margin: 0;
    color: var(--text);
}

.chat-thread-head {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    min-width: 0;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
}

.chat-person {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    margin-inline-end: auto;
}

.chat-back {
    display: none;
}

.chat-search-toggle {
    flex: 0 0 auto;
}

.chat-main {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0,1fr);
}

.chat-thread-search {
    grid-row: 1;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
}

.chat-scroll {
    grid-row: 2;
    padding: 14px;
    overflow-anchor: none;
}

.chat-history {
    display: flex;
    margin: 0 auto 10px;
}

.chat-log,
.chat-results {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

.chat-day {
    margin: 8px auto;
    color: var(--muted);
    font-size: 11px;
}

.chat-message {
    display: grid;
    max-width: min(83%,560px);
    padding: 8px 11px;
    background: #1e2821;
    border: 1px solid #334038;
    border-radius: 12px 12px 12px 4px;
}

.chat-message-mine {
    align-self: flex-end;
    background: #253b23;
    border-color: #3b5635;
    border-radius: 12px 12px 4px 12px;
}

.chat-message-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.42;
}

.chat-message time {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    justify-self: end;
}

.chat-jump {
    position: absolute;
    inset-inline-end: 18px;
    bottom: 9px;
    box-shadow: 0 4px 15px #0008;
}

.chat-bottom {
    min-width: 0;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
}

.chat-compose {
    align-items: stretch;
}

.chat-compose textarea {
    min-height: 42px;
    max-height: 112px;
    resize: vertical;
}

.chat-status,
.chat-state-note {
    margin: 3px 0;
    font-size: 13px;
}

.chat-status {
    color: #ffadbb;
}

.chat-state-note {
    color: var(--muted);
}

.auth-layout {
    min-height: 100dvh;
}

.auth-page h1 {
    font-size: clamp(40px,5.2vw,74px);
}

@media (max-width: 900px) and (min-width: 741px) {
    .app-layout,
    .chat-page .app-layout {
        grid-template-columns: 158px minmax(0,1fr);
        gap: 18px;
        padding-inline: 16px;
    }

    .chat-shell {
        grid-template-columns: minmax(190px, 35%) minmax(0,1fr);
    }
}

@media (max-width: 740px) {
    body.dashboard-body {
        padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
    }

    .app-layout {
        display: block;
        padding-inline: 13px;
        min-height: 0;
    }

    .sidebar {
        position: static;
        display: block;
        height: auto;
        padding: 12px 2px 8px;
        border-inline-end: 0;
        overflow: visible;
    }

    .sidebar .logo {
        display: inline-block;
        margin: 0;
        font-size: 22px;
    }

    .sidebar .main-nav,
    .sidebar .sidebar-bottom {
        display: none;
    }

    .feed {
        padding-block: 15px 24px;
    }

    .topbar {
        margin-bottom: 13px;
        padding-bottom: 10px;
    }

    .mobile-nav {
        position: fixed;
        z-index: 100;
        inset: auto 0 0;
        height: calc(var(--nav-height) + env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: repeat(5,minmax(0,1fr));
        align-items: center;
        gap: 0;
        padding: 4px 5px calc(4px + env(safe-area-inset-bottom));
        background: #111713f5;
        border-top: 1px solid var(--border);
    }

    .mobile-nav a {
        display: grid;
        justify-items: center;
        align-content: center;
        gap: 4px;
        min-height: 40px;
        color: var(--muted);
        border-radius: 10px;
    }

    .mobile-nav a span:last-child {
        font-size: 10px;
        line-height: 1;
    }

    .mobile-nav a .nav-icon {
        font-size: 18px;
        line-height: 1;
    }

    .mobile-nav .mobile-nav-active {
        color: var(--lime);
        background: #22321d;
    }

    body.chat-page {
        padding: 0;
    }

    .chat-page .app-layout {
        height: calc(var(--chat-viewport,100dvh) - var(--nav-height) - env(safe-area-inset-bottom));
        padding: 0;
    }

    .chat-page .sidebar {
        display: none;
    }

    .chat-page .feed {
        padding: 0;
    }

    .chat-shell {
        display: grid;
        grid-template-columns: minmax(0,1fr);
        border: 0;
        border-radius: 0;
    }

    .chat-shell.chat-has-thread .chat-inbox,
    .chat-shell:not(.chat-has-thread) .chat-panel {
        display: none;
    }

    .chat-inbox {
        border: 0;
    }

    .chat-back {
        display: inline-flex;
    }

    .chat-thread-head,
    .chat-bottom {
        padding-inline: 10px;
    }

    .chat-scroll {
        padding: 10px;
    }

    .chat-compose textarea,
    .chat-inbox-search input,
    .chat-thread-search input {
        font-size: 16px;
    }

    body.chat-keyboard .app-layout {
        height: var(--chat-viewport,100dvh);
    }

    body.chat-keyboard .mobile-nav {
        display: none;
    }
}

/* Odalar, kişisel akış ve içerik araçları */
.feed-explanation {
    margin: -6px 0 16px;
    color: var(--muted);
    font-size: 13px;
}

.room-announcement,
.room-weekly,
.room-rules {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    overflow-wrap: anywhere;
}

.room-announcement {
    border-inline-start: 3px solid var(--lime);
}

.room-announcement p,
.room-rules p {
    margin: 6px 0 0;
    line-height: 1.55;
    color: var(--muted);
}

.room-rules summary {
    cursor: pointer;
}

.room-weekly {
    display: grid;
    gap: 6px;
    background: #24341e;
    color: var(--lime);
}

.room-weekly span {
    color: var(--text);
}

.saved-note {
    margin: 0 0 12px;
}

.saved-note form {
    margin-top: 10px;
}

/* Mesajlar 2.0 */
.chat-person small.chat-typing {
    color: var(--lime);
}

.chat-message {
    position: relative;
}

.chat-message-meta {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 7px;
    color: var(--muted);
    font-size: 10px;
}

.chat-message-meta [data-chat-receipt] {
    color: #c2f781;
}

.chat-reference {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 6px 8px;
    margin-bottom: 6px;
    border: 0;
    border-inline-start: 3px solid var(--lime);
    border-radius: 6px;
    text-align: start;
    background: #101713a6;
    color: var(--text);
    cursor: pointer;
}

.chat-reference span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
}

.chat-photo-link {
    display: block;
    width: min(270px,100%);
    margin-bottom: 5px;
}

.chat-photo-link img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #121913;
    border-radius: 8px;
}

.chat-message-highlight {
    outline: 2px solid var(--lime);
    outline-offset: 2px;
}

.chat-message-menu summary {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 30px;
    min-height: 25px;
    color: var(--muted);
    list-style: none;
    cursor: pointer;
}

.chat-message-menu summary::-webkit-details-marker {
    display: none;
}

.chat-message-menu:not([open]) {
    justify-self: end;
}

.chat-shell:not([data-state="accepted"]) .chat-message-menu {
    display: none;
}

.chat-message-options,
.chat-reactions,
.chat-emoji-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.chat-emoji-options {
    padding-top: 3px;
}

.chat-reactions:not(:empty) {
    margin-top: 5px;
}

.chat-reaction-button {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 2px 6px;
    color: var(--text);
    background: #18211b;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
}

.chat-reaction-button[aria-pressed="true"] {
    border-color: var(--lime);
}

.chat-compose {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: stretch;
}

.chat-photo-pick {
    justify-content: center;
    align-self: center;
}

.chat-compose:has(#chat-photo:focus-visible) .chat-photo-pick {
    outline: 2px solid var(--lime);
    outline-offset: 2px;
}

.chat-compose textarea {
    width: 100%;
}

.chat-reply-draft,
.chat-photo-status {
    grid-column: 1 / -1;
    min-width: 0;
}

.chat-reply-draft {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-inline-start: 3px solid var(--lime);
    background: #18231a;
}

.chat-reply-draft span,
.chat-photo-status span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
}

.chat-photo-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
}

@media (max-width: 740px) {
    .chat-compose {
        gap: 5px;
    }

    .chat-compose .share-button {
        padding-inline: 10px;
    }

    .chat-photo-pick {
        margin: 0;
        padding-inline: 5px;
        white-space: nowrap;
    }
}
