/* =========================================================
   v4.6 — dashboard compacto + presença online + chat efêmero
   ========================================================= */

/* Card de desempenho: mesma informação, muito menos altura. */
.profile-dashboard {
    grid-template-columns: minmax(250px, 1.25fr) minmax(390px, 1.75fr);
    gap: 0;
    margin-bottom: 8px;
    overflow: hidden;
    background: linear-gradient(160deg, var(--navy-strong), var(--navy-deep));
    border: 1px solid var(--navy-mid);
    border-radius: 8px;
}

.profile-dashboard .profile-identity,
.profile-dashboard .profile-metrics {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.profile-dashboard .profile-identity {
    gap: 11px;
    min-width: 0;
    padding: 11px 14px;
}

.profile-dashboard .profile-avatar {
    width: 44px;
    height: 44px;
    border-width: 1px;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

.profile-copy { min-width: 0; }
.profile-dashboard .profile-kicker { font-size: 8px; }
.profile-dashboard .profile-identity h1 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 1px 0;
    font-size: 18px;
    line-height: 1.15;
}
.profile-dashboard .profile-identity p { font-size: 9px; }

.profile-dashboard .profile-metrics {
    grid-template-columns: repeat(3, 1fr);
    border-left: 1px solid rgba(205,217,236,.18);
}

.profile-dashboard .profile-metric {
    min-height: 66px;
    padding: 8px 12px;
}
.profile-dashboard .profile-metric span,
.profile-dashboard .profile-metric small { font-size: 8px; }
.profile-dashboard .profile-metric strong {
    margin: 1px 0;
    font-size: 22px;
    line-height: 1;
}

.profile-dashboard .account-insignia {
    padding: 2px 6px;
    font-size: 8px;
    line-height: 1.25;
}

/* Pequena faixa de comunidade logo abaixo do desempenho. */
.community-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 38px;
    margin-bottom: 12px;
    padding: 6px 7px 6px 12px;
    background: var(--panel-surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    box-shadow: var(--card-shadow);
}

.community-presence {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--text-muted);
    font: 600 10px/1.35 var(--type-ui);
}
.community-presence strong { color: var(--text-main); }
#onlineSpotlight {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.community-presence .account-insignia {
    padding: 1px 5px;
    font-size: 7px;
    vertical-align: 1px;
}
.presence-divider { opacity: .55; }
.presence-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    background: var(--success);
    border: 2px solid color-mix(in srgb, var(--success) 22%, transparent);
    border-radius: 50%;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 11%, transparent);
}
.inline-dot { margin-right: 5px; vertical-align: 1px; }

.community-chat-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 28px;
    padding: 5px 8px;
    color: var(--text-accent);
    background: var(--canvas-soft);
    border: 1px solid var(--line);
    border-radius: 5px;
    font: 800 10px var(--type-ui);
    cursor: pointer;
}
.community-chat-button:hover {
    border-color: var(--navy-mid);
    transform: translateY(-1px);
}
.community-chat-button b {
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    color: #fff;
    background: var(--navy-strong);
    border-radius: 10px;
    font-size: 9px;
}

/* Chat temporário. */
#chatModal { overflow: hidden; }
.chat-modal {
    display: flex;
    flex-direction: column;
    width: min(720px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    height: min(76dvh, 680px);
    max-height: calc(100dvh - 32px);
    overflow: hidden;
}
.chat-modal-header { flex: 0 0 auto; }
.chat-modal-header p:not(.section-kicker) { display: flex; align-items: center; flex-wrap: wrap; }
.chat-body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    flex: 1 1 auto;
    min-height: 0;
    background: var(--canvas);
}
.chat-privacy-note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 9px 14px;
    color: var(--text-muted);
    background: var(--canvas-soft);
    border-bottom: 1px solid var(--line);
    font: 600 10px/1.4 var(--type-ui);
}
.chat-privacy-note > span:first-child {
    color: var(--text-accent);
    font-size: 15px;
    line-height: 1;
}
.chat-messages {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px;
}
.chat-empty {
    display: grid;
    place-items: center;
    min-height: 140px;
    color: var(--text-muted);
    text-align: center;
    font-size: 12px;
}
.chat-message {
    width: min(82%, 520px);
    margin: 0 auto 8px 0;
    padding: 9px 11px;
    background: var(--panel-surface);
    border: 1px solid var(--line);
    border-radius: 8px 8px 8px 2px;
}
.chat-message.is-own {
    margin-right: 0;
    margin-left: auto;
    background: color-mix(in srgb, var(--navy-strong) 8%, var(--panel-surface));
    border-color: color-mix(in srgb, var(--navy-mid) 45%, var(--line));
    border-radius: 8px 8px 2px 8px;
}
.chat-message-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 4px;
}
.chat-message-head strong {
    color: var(--text-accent);
    font: 800 10px var(--type-ui);
}
.chat-message-head time {
    margin-left: auto;
    color: var(--text-muted);
    font: 500 9px var(--type-ui);
}
.chat-message-head .account-insignia {
    padding: 1px 5px;
    font-size: 7px;
}
.chat-message p {
    margin: 0;
    color: var(--text-main);
    font: 500 13px/1.45 var(--type-body);
    overflow-wrap: anywhere;
}
.chat-compose {
    padding: 10px 12px;
    background: var(--panel-surface);
    border-top: 1px solid var(--line);
}
.chat-compose textarea {
    width: 100%;
    min-height: 54px;
    max-height: 120px;
    resize: vertical;
    padding: 9px 10px;
    color: var(--text-main);
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: 6px;
    font: 500 13px/1.4 var(--type-body);
}
.chat-compose textarea:focus {
    outline: none;
    border-color: var(--navy-mid);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy-mid) 12%, transparent);
}
.chat-compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}
.chat-compose-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-compose-tools > span {
    color: var(--text-muted);
    font: 600 9px var(--type-ui);
}
.chat-compose-footer .ui-button { min-height: 32px; padding: 6px 14px; }
.emoji-toggle {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--canvas-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    font-size: 17px;
}
.emoji-toggle:hover,
.emoji-toggle[aria-expanded="true"] {
    background: color-mix(in srgb, var(--navy-mid) 10%, var(--canvas-soft));
    border-color: var(--navy-mid);
}
.openmoji-picker {
    margin-top: 7px;
    overflow: hidden;
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(9, 27, 52, .14);
}
.openmoji-header {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px;
    background: var(--canvas-soft);
    border-bottom: 1px solid var(--line);
}
.openmoji-header input {
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    color: var(--text-main);
    background: var(--panel-surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    font: 600 11px var(--type-ui);
}
.openmoji-header button {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 22px;
}
.openmoji-categories {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}
.openmoji-categories button {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 31px;
    padding: 0 7px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
}
.openmoji-categories button:hover,
.openmoji-categories button.is-active {
    background: color-mix(in srgb, var(--navy-mid) 10%, var(--canvas-soft));
    border-color: color-mix(in srgb, var(--navy-mid) 45%, var(--line));
}
.openmoji-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(34px, 1fr));
    gap: 3px;
    max-height: 180px;
    padding: 8px;
    overflow-y: auto;
}
.openmoji-item {
    display: grid;
    place-items: center;
    min-width: 0;
    height: 40px;
    padding: 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
}
.openmoji-item:hover,
.openmoji-item:focus-visible {
    background: var(--canvas-soft);
    border-color: var(--line);
    outline: none;
}
.openmoji-item img {
    display: block;
    width: 30px;
    height: 30px;
}
.openmoji-picker > small {
    display: block;
    padding: 6px 9px;
    color: var(--text-muted);
    background: var(--canvas-soft);
    border-top: 1px solid var(--line);
    font: 500 8px/1.35 var(--type-ui);
    text-align: right;
}
.openmoji-picker > small a { color: var(--text-accent); }
.openmoji-empty {
    grid-column: 1 / -1;
    margin: 18px 0;
    color: var(--text-muted);
    text-align: center;
    font-size: 11px;
}

@media (max-width: 820px) {
    .profile-dashboard {
        grid-template-columns: 1fr;
    }
    .profile-dashboard .profile-metrics {
        border-top: 1px solid rgba(205,217,236,.18);
        border-left: 0;
    }
}

@media (max-width: 560px) {
    .profile-dashboard .profile-identity { padding: 9px 11px; }
    .profile-dashboard .profile-avatar { width: 38px; height: 38px; font-size: 13px; }
    .profile-dashboard .profile-identity h1 { font-size: 16px; }
    .profile-dashboard .profile-metrics { grid-template-columns: repeat(3, 1fr); }
    .profile-dashboard .profile-metric {
        min-height: 54px;
        padding: 6px 4px;
        border-top: 0;
        border-left: 1px solid rgba(205,217,236,.18);
    }
    .profile-dashboard .profile-metric:first-child { border-left: 0; }
    .profile-dashboard .profile-metric strong { font-size: 18px; }
    .profile-dashboard .profile-metric span,
    .profile-dashboard .profile-metric small { font-size: 7px; letter-spacing: .03em; }

    .community-strip {
        align-items: stretch;
        flex-direction: column;
        gap: 7px;
        padding-left: 9px;
    }
    .community-presence { flex: 1 1 auto; gap: 5px; }
    .presence-divider { display: none; }
    #onlineSpotlight { display: inline; }
    .community-chat-button { min-width: max-content; justify-content: center; }

    .chat-modal {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        height: calc(100dvh - 16px);
        max-height: calc(100dvh - 16px);
    }
    .chat-message { width: 92%; }
    .chat-modal .report-modal-header { padding: 16px 17px 14px; }
    .chat-modal .report-modal-header h2 { font-size: 21px; }
    .openmoji-grid { grid-template-columns: repeat(7, minmax(34px, 1fr)); }
}
