/* ============================================================
   TOUON — chat interno corporativo
   direção: tech-industrial · grafite esverdeado + verde neon
   família visual: portfolio mrmendes / oficina online
   ============================================================ */

:root {
    --ink: #0a0f0c;
    --ink-2: #10170f;
    --ink-3: #161f16;
    --panel: #121a12;
    --line: rgba(233, 244, 236, 0.1);
    --line-strong: rgba(233, 244, 236, 0.18);
    --cream: #e9f4ec;
    --cream-dim: rgba(233, 244, 236, 0.55);
    --cream-faint: rgba(233, 244, 236, 0.28);
    --neon: #3dff9e;
    --neon-2: #2bd980;
    --neon-dim: rgba(61, 255, 158, 0.14);
    --neon-faint: rgba(61, 255, 158, 0.07);
    --danger: #ff7a68;
    --danger-dim: rgba(255, 122, 104, 0.14);
    --amber: #ffc400;
    --bubble-mine: #12291c;
    --bubble-mine-border: rgba(61, 255, 158, 0.22);
    --bubble-theirs: #161f16;
    --grid-line: rgba(233, 244, 236, 0.025);
    --quote-bg: rgba(10, 15, 12, 0.55);
    --scroll-thumb: rgba(233, 244, 236, 0.16);
    --disp: "Archivo", sans-serif;
    --body: "Albert Sans", sans-serif;
    --mono: "Fragment Mono", monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--ink);
    color: var(--cream);
    font-family: var(--body);
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--neon); color: var(--ink); }

/* scrollbars discretos */
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

.mono {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.09em;
    text-transform: lowercase;
}

/* wordmark texto — "tou" creme + "on" neon */
.brand-word {
    font-family: var(--disp);
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--cream);
    margin: 0;
    line-height: 1;
}
.brand-word b { color: var(--neon); font-weight: 900; }

.neon-rule {
    height: 2px;
    border: 0;
    margin: 0;
    background: linear-gradient(90deg, var(--neon), rgba(61,255,158,0) 75%);
}

/* ============ BOOTSTRAP OVERRIDES ============ */

.btn {
    --bs-btn-border-radius: 2px;
    font-family: var(--disp);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-sm { font-size: 0.72rem; }

.btn-primary, .btn-light {
    --bs-btn-bg: var(--neon);
    --bs-btn-border-color: var(--neon);
    --bs-btn-color: var(--ink);
    --bs-btn-hover-bg: var(--neon-2);
    --bs-btn-hover-border-color: var(--neon-2);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-active-bg: var(--neon-2);
    --bs-btn-active-border-color: var(--neon-2);
    --bs-btn-active-color: var(--ink);
    --bs-btn-disabled-bg: #29433a;
    --bs-btn-disabled-border-color: #29433a;
    --bs-btn-disabled-color: rgba(233,244,236,.4);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
}
.btn-primary:hover, .btn-light:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 rgba(0,0,0,.5); }
.btn-primary:active, .btn-light:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(0,0,0,.5); }
.btn-primary:disabled, .btn-light:disabled { box-shadow: none; }

.btn-outline-light, .btn-outline-secondary {
    --bs-btn-color: var(--cream-dim);
    --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-bg: transparent;
    --bs-btn-hover-border-color: var(--neon);
    --bs-btn-hover-color: var(--neon);
    --bs-btn-active-bg: var(--neon-dim);
    --bs-btn-active-border-color: var(--neon);
    --bs-btn-active-color: var(--neon);
    --bs-btn-disabled-color: rgba(233,244,236,.25);
    --bs-btn-disabled-border-color: var(--line);
}

.btn-outline-primary {
    --bs-btn-color: var(--neon);
    --bs-btn-border-color: rgba(61,255,158,.4);
    --bs-btn-hover-bg: var(--neon);
    --bs-btn-hover-border-color: var(--neon);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-active-bg: var(--neon-2);
    --bs-btn-active-border-color: var(--neon-2);
    --bs-btn-active-color: var(--ink);
}

.form-label {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.09em;
    text-transform: lowercase;
    color: var(--cream-dim);
    margin-bottom: 0.35rem;
}

.form-control, .form-select {
    background-color: var(--ink-2);
    border: 1px solid var(--line-strong);
    border-radius: 2px;
    color: var(--cream);
}
.form-control:focus, .form-select:focus {
    background-color: var(--ink-2);
    border-color: var(--neon);
    color: var(--cream);
    box-shadow: 0 0 0 3px var(--neon-dim);
}
.form-control::placeholder { color: rgba(233,244,236,.35); }
.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23e9f4ec' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
}
.form-select option { background: var(--ink-2); color: var(--cream); }

.modal {
    --bs-modal-bg: var(--panel);
    --bs-modal-color: var(--cream);
    --bs-modal-border-color: var(--line-strong);
    --bs-modal-border-radius: 4px;
    --bs-modal-header-border-color: var(--line);
    --bs-modal-footer-border-color: var(--line);
}
.modal-title {
    font-family: var(--disp);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.btn-close { filter: invert(1) grayscale(1) brightness(1.6); }
.modal hr { border-color: var(--line-strong); opacity: 1; }
.operation-modal-dialog {
    width: 90vw;
    max-width: 1320px;
}
.operation-modal-dialog .modal-content {
    max-height: calc(100dvh - 48px);
}
.operation-modal-dialog .modal-body {
    overflow-x: hidden;
    overflow-y: auto;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--cream);
    --bs-table-border-color: var(--line);
    --bs-table-striped-color: var(--cream);
    --bs-table-hover-color: var(--cream);
    --bs-table-hover-bg: var(--neon-faint);
}
.table thead th {
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.09em;
    text-transform: lowercase;
    color: var(--cream-dim);
    border-bottom: 1px solid var(--line-strong);
}
.table td { font-size: 0.9rem; }

.text-danger { color: var(--danger) !important; }
.text-success { color: var(--neon) !important; }

.input-group .btn { z-index: 0; }

/* ============ LOGIN ============ */

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    position: relative;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse 70% 55% at 78% 12%, rgba(61, 255, 158, 0.06), transparent 60%),
        radial-gradient(ellipse 55% 45% at 12% 92%, rgba(61, 255, 158, 0.04), transparent 60%),
        var(--ink);
}

.login-panel {
    width: min(940px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: clamp(32px, 6vw, 72px);
    align-items: center;
    padding: 32px 0;
}

.brand-block { display: grid; gap: 20px; justify-items: start; }
.brand-mark { width: 62px; height: 62px; display: block; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-block .brand-word { font-size: clamp(3rem, 7vw, 4.6rem); }
.brand-block h2 {
    margin: 0;
    font-family: var(--disp);
    font-weight: 800;
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    letter-spacing: 0.01em;
    color: var(--cream);
    max-width: 380px;
    line-height: 1.25;
}
.brand-block h2 em { font-style: normal; color: var(--neon); }
.brand-tagline { color: var(--cream-dim); }
.brand-features {
    margin: 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
    list-style: none;
    display: grid;
    gap: 8px;
    color: var(--cream-dim);
}
.brand-features li::before { content: "// "; color: var(--neon); }

.login-card {
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    padding: 30px 28px 26px;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.35);
}
.login-card .neon-rule { margin: -30px -28px 26px; height: 3px; }
.login-card-label { display: block; color: var(--cream-dim); margin-bottom: 18px; }
.login-forgot { text-align: center; font-size: .9rem; }
.login-forgot a { color: var(--cream-dim); text-decoration: none; border-bottom: 1px dashed currentColor; padding-bottom: 1px; }
.login-forgot a:hover { color: var(--neon); }
.login-note { color: var(--cream-dim); font-size: .85rem; margin: 12px 0 0; }
.login-note strong { color: var(--cream); }
.login-alert { padding: 12px 14px; border-radius: 6px; font-size: .9rem; }
.login-alert-success { background: rgba(61, 255, 158, 0.09); color: var(--cream); border: 1px solid rgba(61, 255, 158, 0.35); }
.login-alert-error { background: rgba(255, 92, 92, 0.08); color: #ffb4b4; border: 1px solid rgba(255, 92, 92, 0.35); }
.login-back { display: inline-block; margin-top: 14px; color: var(--cream-dim); font-size: .85rem; text-decoration: none; }
.login-back:hover { color: var(--neon); }
.login-method-choice { display: grid; gap: 8px; margin: 6px 0 4px; }
.login-method-choice label { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.login-method-choice label:hover { border-color: var(--neon); }
.login-method-choice input[type="radio"] { margin-top: 3px; }
.login-method-choice .method-title { display: block; font-weight: 600; color: var(--cream); }
.login-method-choice .method-hint { display: block; font-size: .8rem; color: var(--cream-dim); margin-top: 2px; }
.login-footer {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(233, 244, 236, 0.32);
}

/* ============ APP SHELL ============ */

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 330px 1fr;
    background: var(--ink);
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    background: var(--ink-2);
    border-right: 1px solid var(--line);
    color: var(--cream);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.sidebar-brand .brand-mark { width: 36px; height: 36px; }
.sidebar-brand .brand-word { font-size: 1.6rem; }
.sidebar-brand .mono { margin-left: auto; color: var(--cream-dim); }

.profile-strip { display: flex; align-items: center; gap: 12px; }
.profile-strip strong { font-family: var(--disp); font-weight: 700; font-size: 0.95rem; }
.profile-strip span {
    display: block;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.09em;
    text-transform: lowercase;
    color: var(--cream-dim);
    margin-top: 2px;
}

/* --conv-color: cor de destaque da conversa (grupos); padrao neon */
.avatar {
    position: relative;
    /* overflow: visible pra .presence-dot poder "escapar" do canto; a img
       ganha border-radius: inherit pra manter o clip arredondado. */
    overflow: visible;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--conv-color, var(--neon)) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--conv-color, var(--neon)) 34%, transparent);
    color: var(--conv-color, var(--neon));
    font-family: var(--disp);
    font-weight: 800;
}
/* img absoluta cobre todo o container; border-radius: inherit substitui o
   antigo overflow: hidden do parent (que agora precisa ser visible pra
   .presence-dot aparecer no canto). */
.avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}
.presence-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--panel);
    box-shadow: 0 0 0 1px color-mix(in srgb, #000 20%, transparent);
    pointer-events: none;
}
.avatar-sm .presence-dot { width: 10px; height: 10px; bottom: -1px; right: -1px; border-width: 2px; }
.avatar-lg .presence-dot { width: 16px; height: 16px; bottom: 0; right: 0; border-width: 3px; }
.avatar-lg { width: 72px; height: 72px; border-radius: 16px; font-size: 1.6rem; }
.muted-avatar {
    background: var(--ink-3);
    border-color: var(--line-strong);
    color: var(--cream-dim);
}

.profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}
.profile-avatar-actions {
    display: grid;
    gap: 6px;
    justify-items: start;
}
.profile-avatar-actions .mono { color: var(--cream-dim); }

.search-control {
    background-color: var(--ink);
    border-color: var(--line-strong);
    color: var(--cream);
}

/* ============ AÇÕES DA SIDEBAR (botão + flutuante) ============ */

.sidebar-fab {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 55;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 14px;
    background: var(--neon);
    color: var(--ink);
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s;
}
.sidebar-fab:hover { background: var(--neon-2); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 rgba(0,0,0,.5); }
.sidebar-fab[aria-expanded="true"] { background: var(--neon-2); transform: translate(1px, 1px); box-shadow: 2px 2px 0 rgba(0,0,0,.5); }

.action-menu {
    position: absolute;
    right: 16px;
    bottom: 82px;
    z-index: 60;
    min-width: 200px;
    padding: 6px;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
}
.action-menu[hidden] { display: none; }
.action-menu button {
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 2px;
    padding: 10px;
    text-align: left;
    color: var(--cream);
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    text-transform: lowercase;
    display: block;
    cursor: pointer;
}
.action-menu button::before { content: "// "; color: var(--neon); }
.action-menu button:hover { background: var(--neon-dim); color: var(--neon); }
.action-menu .action-menu-danger { border-top: 1px solid var(--line); margin-top: 4px; }
.action-menu .action-menu-danger::before { color: var(--danger); }
.action-menu .action-menu-danger:hover { background: var(--danger-dim); color: var(--danger); }

/* ============ SELETOR DE COR DO GRUPO ============ */

.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.color-swatch { margin: 0; cursor: pointer; }
.color-swatch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.color-swatch .swatch {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--sw) 22%, transparent);
    border: 1px solid color-mix(in srgb, var(--sw) 55%, transparent);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.color-swatch .swatch::after {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 4px;
    background: var(--sw);
}
.color-swatch .swatch-none { background: transparent; border: 1px dashed var(--line-strong); }
.color-swatch .swatch-none::after {
    background: transparent;
    width: 16px;
    height: 1px;
    border-radius: 0;
    border-top: 2px solid var(--cream-faint);
    transform: rotate(-45deg);
}
.color-swatch:hover .swatch { transform: translateY(-1px); }
.color-swatch input:checked + .swatch {
    box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--sw, var(--cream-dim));
}
.color-swatch input:focus-visible + .swatch {
    box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--neon);
}
.color-swatch input:disabled + .swatch { opacity: 0.4; cursor: not-allowed; }

/* ============ OPÇÃO DE TEMA (configurações) ============ */

.theme-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.theme-option { margin: 0; cursor: pointer; }
.theme-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.theme-option > span {
    display: grid;
    gap: 3px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    padding: 12px;
    transition: border-color 0.2s, background 0.2s;
}
.theme-option b {
    font-family: var(--disp);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.theme-option small {
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: lowercase;
}
.theme-chip {
    display: block;
    height: 22px;
    border-radius: 3px;
    margin-bottom: 6px;
    border: 1px solid var(--line-strong);
}
.theme-chip-dark {
    background: linear-gradient(90deg, #0a0f0c 0 62%, #3dff9e 62% 76%, #10170f 76%);
}
.theme-chip-clean {
    background: linear-gradient(90deg, #f7f9f7 0 62%, #0dbd6e 62% 76%, #ffffff 76%);
}
.theme-option:hover > span { border-color: var(--cream-faint); }
.theme-option input:checked + span {
    border-color: var(--neon);
    background: var(--neon-dim);
}
.theme-option input:focus-visible + span { box-shadow: 0 0 0 3px var(--neon-dim); }

.conversation-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.conversation-filters button {
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: lowercase;
    padding: 5px 12px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.conversation-filters button:hover { color: var(--cream); border-color: var(--cream-faint); }
.conversation-filters button.active {
    background: var(--neon-dim);
    border-color: rgba(61, 255, 158, 0.45);
    color: var(--neon);
}

.empty-conversations { color: var(--cream-dim); border-top: 1px solid var(--line); padding-top: 18px; }
.empty-conversations p { font-size: 14px; margin-top: 6px; }

.conversation-list { display: grid; gap: 4px; overflow: auto; min-height: 220px; align-content: start; padding-bottom: 80px; }
.conversation-item {
    width: 100%;
    min-height: 66px;
    border: 1px solid transparent;
    border-left: 3px solid var(--conv-color, transparent);
    border-radius: 4px;
    background: transparent;
    color: var(--cream);
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.conversation-item:hover { background: var(--ink-3); }
.conversation-item.active {
    background: var(--neon-faint);
    border-color: rgba(61, 255, 158, 0.28);
    border-left-color: var(--conv-color, rgba(61, 255, 158, 0.28));
}
.conversation-copy { min-width: 0; }
.conversation-copy strong,
.conversation-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy strong { font-size: 0.92rem; }
.conversation-copy small, .conversation-meta small { color: var(--cream-dim); font-size: 0.78rem; }
.conversation-operation-tag {
    display: inline-block;
    max-width: 120px;
    margin-left: 6px;
    padding: 1px 6px;
    border: 1px solid rgba(61,232,255,.28);
    border-radius: 999px;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: .56rem;
    font-weight: 400;
    vertical-align: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.conversation-meta { display: grid; gap: 5px; justify-items: end; }
.conversation-meta small { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.04em; }
.conversation-meta b {
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 6px;
    background: var(--conv-color, var(--neon));
    color: var(--ink);
    display: grid;
    place-items: center;
    font-family: var(--disp);
    font-size: 11px;
    font-weight: 800;
}

/* ============ WORKSPACE / CHAT ============ */

.workspace { padding: 24px; overflow: auto; }
.workspace-chat-only { display: grid; grid-template-rows: minmax(0, 1fr); }
.workspace-chat-only .chat-panel {
    height: calc(100vh - 48px);
    min-height: 0;
    margin-bottom: 0;
}

.chat-panel {
    height: min(72vh, 720px);
    min-height: 520px;
    display: flex;
    flex-direction: column;
    background: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 22px;
}
.chat-panel > .chat-header,
.chat-panel > .message-search-results,
.chat-panel > .composer { flex: 0 0 auto; }
.chat-panel > .message-history { flex: 1 1 auto; min-height: 0; }

.chat-header {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px;
    background: var(--ink-2);
    border-bottom: 1px solid var(--line);
}
.chat-peer { display: flex; align-items: center; gap: 12px; min-width: 0; width: 100%; }
.chat-peer-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
    background: none;
    border: 0;
    padding: 4px 6px;
    margin: -4px -6px;
    border-radius: 8px;
    text-align: left;
    color: inherit;
    cursor: default;
    transition: background-color .15s ease;
}
.chat-peer-info.is-actionable { cursor: pointer; }
.chat-peer-info.is-actionable:hover,
.chat-peer-info.is-actionable:focus-visible {
    background: color-mix(in srgb, var(--neon) 8%, transparent);
}
.chat-peer-copy { min-width: 0; flex: 1 1 auto; }
.chat-peer h1 {
    margin: 0;
    font-family: var(--disp);
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.chat-peer p {
    margin: 2px 0 0;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.07em;
    text-transform: lowercase;
    color: var(--cream-dim);
}
.chat-peer p.is-typing { color: var(--neon); }
.chat-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
    position: relative;
}
.chat-actions .form-control {
    flex: 1 1 260px;
    min-width: 220px;
    max-width: 380px;
}
.chat-actions .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.message-history {
    padding: 18px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, var(--neon-faint), transparent 70%),
        repeating-linear-gradient(0deg, var(--grid-line) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(90deg, var(--grid-line) 0 1px, transparent 1px 28px),
        var(--ink);
}

.message-search-results {
    max-height: 180px;
    overflow: auto;
    background: var(--ink-2);
    border-bottom: 1px solid var(--line);
    padding: 8px 12px;
    display: grid;
    gap: 6px;
}
.message-search-results[hidden] { display: none; }
.message-search-item {
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--ink-3);
    color: var(--cream);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    text-align: left;
    cursor: pointer;
}
.message-search-item:hover { border-color: rgba(61,255,158,.35); }
.message-search-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-search-item small { color: var(--cream-dim); font-family: var(--mono); font-size: 0.62rem; }

.empty-state { color: var(--cream-dim); text-align: center; padding: 18px; }

.operation-context-card {
    align-self: stretch;
    display: grid;
    gap: 8px;
    border: 1px solid rgba(61,232,255,.24);
    border-left: 3px solid var(--cyan);
    border-radius: 6px;
    background: color-mix(in srgb, var(--cyan) 7%, var(--ink-2));
    padding: 12px 14px;
    margin-bottom: 8px;
}
.operation-context-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.operation-context-head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.operation-context-card small {
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .66rem;
}
.operation-context-card p {
    margin: 0;
    color: var(--cream);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.operation-context-card .btn { justify-self: start; }

.operation-view { display: grid; gap: 18px; }
.operation-view-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.operation-view-head h4 {
    margin: 0;
    font-family: var(--disp);
    font-weight: 800;
    font-size: 1.1rem;
}
.operation-view-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.operation-view-meta span {
    display: grid;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 10px;
    color: var(--cream);
}
.operation-view-meta b,
.operation-view section h6 {
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .62rem;
    font-weight: 400;
    letter-spacing: .07em;
    text-transform: lowercase;
}
.operation-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}
.operation-tabs button {
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .08em;
    padding: 8px 12px;
    text-transform: uppercase;
    white-space: nowrap;
}
.operation-tabs button.active {
    border-color: rgba(18,196,117,.55);
    background: rgba(18,196,117,.18);
    color: var(--neon);
}
.operation-tab-panels { min-width: 0; }
.operation-tab-panel {
    display: none;
    gap: 14px;
}
.operation-tab-panel.active {
    display: grid;
}
.operation-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.operation-section-title span {
    color: var(--cream);
    font-family: var(--disp);
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: .02em;
}
.operation-section-title::after {
    content: "";
    height: 1px;
    flex: 1 1 auto;
    background: var(--line);
}
.operation-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .55fr);
    gap: 16px;
}
.operation-field {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.operation-field span,
.operation-subtitle span {
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .62rem;
    letter-spacing: .06em;
}
.operation-subtitle {
    display: grid;
    gap: 3px;
    margin-bottom: 8px;
}
.operation-subtitle strong {
    color: var(--cream);
    font-size: .9rem;
}
.operation-view section p {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.operation-view-members {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow: auto;
}
.operation-view-members li {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 8px;
}
.operation-view-members li > span:last-child { display: grid; min-width: 0; }
.operation-view-members small { color: var(--cream-dim); font-family: var(--mono); font-size: .66rem; }
.operation-team-panel {
    display: grid;
    gap: 10px;
}
.operation-team-toolbar,
.operation-invite-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.operation-team-toolbar .operation-field,
.operation-invite-toolbar .operation-field {
    flex: 1 1 280px;
}
.operation-team-count,
.operation-invite-count {
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .68rem;
    white-space: nowrap;
    padding-bottom: 8px;
}
.operation-team-list,
.operation-invite-list {
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px;
    background: rgba(255,255,255,.02);
}
.operation-team-member,
.operation-invite-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(255,255,255,.025);
    padding: 8px;
}
.operation-invite-option {
    grid-template-columns: auto auto minmax(0, 1fr);
    cursor: pointer;
}
.operation-invite-option:hover,
.operation-team-member:hover {
    border-color: rgba(61,255,158,.28);
}
.operation-invite-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--neon);
}
.operation-team-copy,
.operation-invite-option span:last-child {
    display: grid;
    min-width: 0;
}
.operation-team-copy strong,
.operation-team-copy small,
.operation-invite-option strong,
.operation-invite-option small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.operation-team-copy small,
.operation-invite-option small {
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .66rem;
}
.operation-member-role {
    width: 150px;
}
.operations-panel-list {
    display: grid;
    gap: 10px;
    max-height: 60vh;
    overflow: auto;
}
.operations-panel-item {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--ink-2);
    padding: 12px;
}
.operations-panel-item small {
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .66rem;
}
.operations-panel-item p {
    margin: 0;
    color: var(--cream);
    max-height: 4.6em;
    overflow: hidden;
    white-space: pre-wrap;
}
.operations-panel-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .66rem;
}
.operation-notification-list {
    display: grid;
    gap: 8px;
    max-height: 520px;
    overflow: auto;
}
.operation-notification-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(255,255,255,.03);
}
.operation-notification-item.is-unread {
    border-color: rgba(61,232,255,.32);
    background: rgba(61,232,255,.06);
}
.operation-notification-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.operation-notification-head strong,
.operation-notification-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-notification-item small { color: var(--cream-dim); font-family: var(--mono); font-size: .66rem; margin-top: 5px; }
.operation-notification-item p {
    margin: 6px 0 0;
    color: var(--cream-dim);
    white-space: pre-wrap;
}
.operation-notification-item button {
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--cream-dim);
    background: transparent;
    padding: 4px 9px;
    font-size: .72rem;
}
.operation-notification-item button:hover { color: var(--cream); border-color: var(--cream-faint); }
.status-pill.notification-task,
.status-pill.notification-form { background: rgba(61,232,255,.10); color: var(--cyan); border: 1px solid rgba(61,232,255,.28); }
.status-pill.notification-invitation,
.status-pill.notification-shift { background: var(--neon-dim); color: var(--neon); border: 1px solid rgba(61,255,158,.3); }
.status-pill.notification-incident { background: rgba(255,122,104,.14); color: var(--danger); border: 1px solid rgba(255,122,104,.34); }
.status-pill.notification-document,
.status-pill.notification-system { background: rgba(233,244,236,.07); color: var(--cream-dim); border: 1px solid var(--line); }
.operation-task-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    align-items: start;
    margin-bottom: 12px;
}
.operation-task-form > *,
.operation-checkin-form > *,
.operation-evidence-form > *,
.operation-form-create > *,
.operation-invitation-form > *,
.operation-invitation-response > *,
.operation-document-form > *,
.operation-file-picker > *,
.operation-shift-form > *,
.operation-incident-form > * {
    min-width: 0;
}
.operation-task-form .text-danger { grid-column: 1 / -1; }
.operation-task-list { display: grid; gap: 8px; }
.operation-task-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 10px;
    background: var(--ink-2);
}
.operation-task-item.task-done,
.operation-task-item.task-cancelled { opacity: .72; }
.operation-task-item strong,
.operation-task-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-task-item small { color: var(--cream-dim); font-family: var(--mono); font-size: .66rem; }
.operation-task-item p {
    margin: 5px 0 0;
    color: var(--cream-dim);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.operation-task-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}
.operation-task-actions button {
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .62rem;
    padding: 4px 8px;
}
.operation-task-actions button:hover { color: var(--cream); border-color: var(--cream-faint); }
.operation-task-actions .task-delete { color: var(--danger); border-color: rgba(255,122,104,.28); }
.status-pill.task-pending { background: rgba(61,232,255,.10); color: var(--cyan); border: 1px solid rgba(61,232,255,.28); }
.status-pill.task-done { background: var(--neon-dim); color: var(--neon); border: 1px solid rgba(61,255,158,.3); }
.status-pill.task-cancelled { background: rgba(233,244,236,.07); color: var(--cream-dim); border: 1px solid var(--line); }
.operation-muted { margin: 0 0 8px; color: var(--cream-dim); }
.operation-checkin-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    align-items: start;
    margin-bottom: 12px;
}
.operation-checkin-form .text-danger,
.operation-checkin-form .mono { grid-column: 1 / -1; }
.operation-checkin-form .mono { color: var(--cream-dim); font-size: .64rem; }
.operation-checkin-list { display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.operation-checkin-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 10px;
    background: var(--ink-2);
}
.operation-checkin-item strong,
.operation-checkin-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-checkin-item small { color: var(--cream-dim); font-family: var(--mono); font-size: .66rem; }
.operation-checkin-item p {
    margin: 5px 0 0;
    color: var(--cream-dim);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.operation-checkin-item a { color: var(--cyan); }
.status-pill.checkin-present { background: var(--neon-dim); color: var(--neon); border: 1px solid rgba(61,255,158,.3); }
.status-pill.checkin-late { background: rgba(255,196,0,.12); color: var(--amber); border: 1px solid rgba(255,196,0,.32); }
.status-pill.checkin-absent { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(255,122,104,.3); }
.operation-evidence-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    align-items: start;
    margin-bottom: 10px;
}
.operation-evidence-form textarea,
.operation-evidence-form .operation-file-picker,
.operation-evidence-form .text-danger { grid-column: 1 / -1; }
.operation-file-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}
.operation-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.operation-file-name {
    min-width: 120px;
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .66rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.operation-evidence-list { display: grid; gap: 8px; max-height: 320px; overflow: auto; }
.operation-evidence-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(255,255,255,.03);
}
.operation-evidence-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.operation-evidence-head strong,
.operation-evidence-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-evidence-item small { color: var(--cream-dim); font-family: var(--mono); font-size: .66rem; margin-top: 5px; }
.operation-evidence-item p {
    margin: 6px 0 0;
    color: var(--cream-dim);
    white-space: pre-wrap;
}
.operation-evidence-file {
    display: inline-block;
    margin-top: 8px;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: .7rem;
}
.operation-evidence-file:hover { color: var(--cream); }
.evidence-delete {
    border: 1px solid rgba(255,122,104,.28);
    border-radius: 999px;
    color: var(--danger);
    background: transparent;
    padding: 4px 9px;
    font-size: .72rem;
}
.evidence-delete:hover { color: var(--cream); border-color: rgba(255,122,104,.48); }
.status-pill.evidence-photo { background: rgba(61,232,255,.10); color: var(--cyan); border: 1px solid rgba(61,232,255,.28); }
.status-pill.evidence-document { background: rgba(160,126,255,.12); color: #c8b8ff; border: 1px solid rgba(160,126,255,.32); }
.status-pill.evidence-occurrence { background: rgba(255,196,0,.12); color: var(--amber); border: 1px solid rgba(255,196,0,.32); }
.status-pill.evidence-expense { background: var(--neon-dim); color: var(--neon); border: 1px solid rgba(61,255,158,.3); }
.status-pill.evidence-note { background: rgba(233,244,236,.07); color: var(--cream-dim); border: 1px solid var(--line); }
.operation-form-create {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: start;
    margin-bottom: 10px;
}
.operation-form-workspace {
    display: grid;
    gap: 12px;
}
.operation-form-subtabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255,255,255,.025);
}
.operation-form-subtabs button {
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .66rem;
    letter-spacing: .04em;
    text-transform: lowercase;
    padding: 8px 11px;
}
.operation-form-subtabs button.active {
    background: rgba(61,255,158,.12);
    color: var(--neon);
}
.operation-form-subpanel {
    display: none;
}
.operation-form-subpanel.active {
    display: grid;
    gap: 12px;
}
.operation-form-tool {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
    background: rgba(255,255,255,.025);
}
.operation-form-library {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
    align-items: end;
}
.operation-form-create .operation-field,
.operation-form-library .operation-field {
    display: grid;
    gap: 5px;
}
.operation-form-create .operation-field span,
.operation-form-library .operation-field span,
.operation-response-form label > span {
    color: var(--cream);
    font-family: var(--mono);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.operation-form-create .operation-field small {
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .62rem;
    line-height: 1.35;
}
.operation-form-library .text-danger,
.operation-save-template,
.operation-form-builder,
.operation-form-create .text-danger { grid-column: 1 / -1; }
.operation-form-builder {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
    background: rgba(255,255,255,.02);
}
.operation-form-builder-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.operation-form-builder-head strong {
    font-family: var(--disp);
    font-size: .86rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.operation-form-field-list {
    display: grid;
    gap: 12px;
}
.operation-form-field-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px);
    gap: 10px;
    align-items: end;
    border-top: 1px solid var(--line);
    padding: 12px;
    border-radius: 6px;
    background: rgba(255,255,255,.025);
}
.operation-form-field-row:first-child {
    border-top-color: transparent;
}
.operation-form-question,
.form-builder-options-wrap { min-width: 0; }
.form-builder-options-wrap { grid-column: 1 / -1; }
.operation-form-required {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    margin: 0;
    color: var(--cream-dim);
    font-size: .78rem;
    white-space: nowrap;
    justify-self: start;
}
.form-builder-remove {
    min-height: 34px;
    border: 1px solid rgba(255,122,104,.28);
    border-radius: 999px;
    color: var(--danger);
    background: transparent;
    padding: 4px 9px;
    font-size: .72rem;
    white-space: nowrap;
    justify-self: start;
}
.form-builder-remove:hover { color: var(--cream); border-color: rgba(255,122,104,.48); }
.operation-form-add-field {
    justify-self: start;
}
.operation-save-template {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cream-dim);
    font-size: .82rem;
}
.operation-form-list { display: grid; gap: 14px; }
.operation-form-item {
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(255,255,255,.03);
}
.operation-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.operation-form-head > div { min-width: 0; }
.operation-form-head strong,
.operation-form-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-form-head small { color: var(--cream-dim); font-family: var(--mono); font-size: .66rem; margin-top: 3px; }
.operation-form-item > p {
    margin: 0;
    color: var(--cream-dim);
    white-space: pre-wrap;
    font-size: .9rem;
}
.operation-form-complete {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border: 1px solid rgba(61,255,158,.2);
    border-radius: 4px;
    background: rgba(61,255,158,.06);
    padding: 10px;
}
.operation-form-pending {
    border-color: rgba(61,232,255,.24);
    background: rgba(61,232,255,.055);
}
.operation-form-complete p {
    margin: 0;
    color: var(--cream-dim);
    font-size: .86rem;
}
.operation-form-edit {
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(255,255,255,.02);
}
.operation-form-edit summary {
    cursor: pointer;
    color: var(--neon);
    font-family: var(--mono);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 10px 12px;
}
.operation-form-edit[open] summary {
    border-bottom: 1px solid var(--line);
}
.operation-form-edit .operation-response-form {
    border-top: 0;
    padding: 12px;
}
.operation-response-form {
    display: grid;
    gap: 14px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}
.operation-response-form label {
    display: grid;
    gap: 7px;
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .66rem;
}
.operation-response-form textarea { font-family: var(--font); color: var(--cream); }
.operation-response-submit {
    position: relative;
}
.operation-response-submit.is-loading {
    opacity: .72;
    cursor: wait;
}
.operation-response-submit.is-loading::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -2px;
    animation: ontou-spin .7s linear infinite;
}
.operation-choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.operation-choice {
    display: inline-flex !important;
    align-items: center;
    gap: 6px !important;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--cream);
    font-family: var(--font) !important;
    font-size: .82rem !important;
}
.operation-choice input { accent-color: var(--neon); }
.operation-form-file-answer {
    display: grid;
    gap: 6px;
}
.form-delete {
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--cream-dim);
    background: transparent;
    padding: 4px 9px;
    font-size: .72rem;
    white-space: nowrap;
}
.form-delete:hover { color: var(--cream); border-color: var(--cream-faint); }
.operation-form-responses {
    display: grid;
    gap: 8px;
}
.operation-form-responses h5 {
    margin: 0;
    color: var(--cream);
    font-family: var(--disp);
    font-size: .88rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.operation-form-response {
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 10px 12px;
    background: rgba(255,255,255,.025);
}
.operation-form-response summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    cursor: pointer;
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .68rem;
}
.operation-form-response summary strong {
    color: var(--cream);
    font-family: var(--font);
    font-size: .82rem;
}
.operation-form-response ul {
    list-style: none;
    padding: 10px 0 0;
    margin: 0;
    display: grid;
    gap: 10px;
}
.operation-form-response li {
    display: grid;
    gap: 3px;
    border-top: 1px solid var(--line);
    padding-top: 8px;
}
.operation-form-response li:first-child {
    border-top: 0;
    padding-top: 0;
}
.operation-form-response b {
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .62rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.operation-form-response span {
    color: var(--cream);
    font-size: .9rem;
    line-height: 1.35;
    white-space: pre-wrap;
}

@keyframes ontou-spin {
    to { transform: rotate(360deg); }
}
.operation-invitation-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, .45fr);
    gap: 10px;
    align-items: start;
    margin-bottom: 10px;
}
.operation-invitation-form--bulk > button {
    justify-self: start;
}
.operation-invite-picker,
.operation-invite-message {
    min-width: 0;
}
.operation-invite-picker {
    display: grid;
    gap: 8px;
}
.operation-invite-message textarea {
    min-height: 126px;
}
.operation-invitation-form .text-danger { grid-column: 1 / -1; }
.operation-invitation-list { display: grid; gap: 8px; }
.operation-invitation-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(255,255,255,.03);
}
.operation-invitation-item strong,
.operation-invitation-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-invitation-item small { color: var(--cream-dim); font-family: var(--mono); font-size: .66rem; }
.operation-invitation-item p {
    margin: 6px 0 0;
    color: var(--cream-dim);
    white-space: pre-wrap;
}
.operation-invitation-response {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 6px;
    margin-top: 8px;
}
.operation-invitation-response .text-danger { grid-column: 1 / -1; }
.operation-invitation-response button,
.operation-invitation-actions button {
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--cream-dim);
    background: transparent;
    padding: 4px 9px;
    font-size: .72rem;
    white-space: nowrap;
}
.operation-invitation-response button:hover,
.operation-invitation-actions button:hover { color: var(--cream); border-color: var(--cream-faint); }
.operation-invitation-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}
.status-pill.invitation-invited { background: rgba(61,232,255,.10); color: var(--cyan); border: 1px solid rgba(61,232,255,.28); }
.status-pill.invitation-available { background: var(--neon-dim); color: var(--neon); border: 1px solid rgba(61,255,158,.3); }
.status-pill.invitation-unavailable { background: rgba(255,196,0,.12); color: var(--amber); border: 1px solid rgba(255,196,0,.32); }
.status-pill.invitation-confirmed { background: rgba(61,255,158,.16); color: var(--neon); border: 1px solid rgba(61,255,158,.42); }
.status-pill.invitation-cancelled { background: rgba(233,244,236,.07); color: var(--cream-dim); border: 1px solid var(--line); }
.operation-document-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    align-items: start;
    margin-bottom: 10px;
}
.operation-document-form textarea,
.operation-document-form .operation-file-picker,
.operation-document-form .text-danger { grid-column: 1 / -1; }
.operation-document-list { display: grid; gap: 8px; max-height: 320px; overflow: auto; }
.operation-document-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(255,255,255,.03);
}
.operation-document-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.operation-document-head strong,
.operation-document-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-document-item small { color: var(--cream-dim); font-family: var(--mono); font-size: .66rem; margin-top: 5px; }
.operation-document-item p {
    margin: 6px 0 0;
    color: var(--cream-dim);
    white-space: pre-wrap;
}
.operation-document-file {
    display: inline-block;
    margin-top: 8px;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: .7rem;
}
.operation-document-file:hover { color: var(--cream); }
.document-delete {
    border: 1px solid rgba(255,122,104,.28);
    border-radius: 999px;
    color: var(--danger);
    background: transparent;
    padding: 4px 9px;
    font-size: .72rem;
}
.document-delete:hover { color: var(--cream); border-color: rgba(255,122,104,.48); }
.status-pill.document-briefing { background: rgba(61,232,255,.10); color: var(--cyan); border: 1px solid rgba(61,232,255,.28); }
.status-pill.document-script { background: rgba(160,126,255,.12); color: #c8b8ff; border: 1px solid rgba(160,126,255,.32); }
.status-pill.document-uniform { background: rgba(255,196,0,.12); color: var(--amber); border: 1px solid rgba(255,196,0,.32); }
.status-pill.document-manual { background: var(--neon-dim); color: var(--neon); border: 1px solid rgba(61,255,158,.3); }
.status-pill.document-media { background: rgba(255,122,104,.12); color: var(--danger); border: 1px solid rgba(255,122,104,.3); }
.status-pill.document-other { background: rgba(233,244,236,.07); color: var(--cream-dim); border: 1px solid var(--line); }
.operation-shift-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    align-items: start;
    margin-bottom: 10px;
}
.operation-shift-form .text-danger { grid-column: 1 / -1; }
.operation-shift-list { display: grid; gap: 8px; max-height: 320px; overflow: auto; }
.operation-shift-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(255,255,255,.03);
}
.operation-shift-item strong,
.operation-shift-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-shift-item small { color: var(--cream-dim); font-family: var(--mono); font-size: .66rem; }
.operation-shift-item p {
    margin: 6px 0 0;
    color: var(--cream-dim);
    white-space: pre-wrap;
}
.operation-shift-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}
.operation-shift-actions button {
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--cream-dim);
    background: transparent;
    padding: 4px 9px;
    font-size: .72rem;
    white-space: nowrap;
}
.operation-shift-actions button:hover { color: var(--cream); border-color: var(--cream-faint); }
.operation-shift-actions .shift-delete { color: var(--danger); border-color: rgba(255,122,104,.28); }
.status-pill.shift-scheduled { background: rgba(61,232,255,.10); color: var(--cyan); border: 1px solid rgba(61,232,255,.28); }
.status-pill.shift-checked_in { background: rgba(255,196,0,.12); color: var(--amber); border: 1px solid rgba(255,196,0,.32); }
.status-pill.shift-completed { background: var(--neon-dim); color: var(--neon); border: 1px solid rgba(61,255,158,.3); }
.status-pill.shift-cancelled { background: rgba(233,244,236,.07); color: var(--cream-dim); border: 1px solid var(--line); }
.operation-incident-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    align-items: start;
    margin-bottom: 10px;
}
.operation-incident-form textarea,
.operation-incident-form .text-danger { grid-column: 1 / -1; }
.operation-incident-list { display: grid; gap: 8px; max-height: 320px; overflow: auto; }
.operation-incident-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(255,255,255,.03);
}
.operation-incident-item.severity-critical { border-color: rgba(255,122,104,.42); }
.operation-incident-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.operation-incident-head strong,
.operation-incident-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-incident-item small { color: var(--cream-dim); font-family: var(--mono); font-size: .66rem; margin-top: 5px; }
.operation-incident-item p {
    margin: 6px 0 0;
    color: var(--cream-dim);
    white-space: pre-wrap;
}
.operation-incident-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}
.operation-incident-actions button {
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--cream-dim);
    background: transparent;
    padding: 4px 9px;
    font-size: .72rem;
    white-space: nowrap;
}
.operation-incident-actions button:hover { color: var(--cream); border-color: var(--cream-faint); }
.operation-incident-actions .incident-delete { color: var(--danger); border-color: rgba(255,122,104,.28); }
.status-pill.severity-low { background: rgba(233,244,236,.07); color: var(--cream-dim); border: 1px solid var(--line); }
.status-pill.severity-medium { background: rgba(61,232,255,.10); color: var(--cyan); border: 1px solid rgba(61,232,255,.28); }
.status-pill.severity-high { background: rgba(255,196,0,.12); color: var(--amber); border: 1px solid rgba(255,196,0,.32); }
.status-pill.severity-critical { background: rgba(255,122,104,.14); color: var(--danger); border: 1px solid rgba(255,122,104,.34); }
.status-pill.incident-open { background: rgba(255,196,0,.12); color: var(--amber); border: 1px solid rgba(255,196,0,.32); }
.status-pill.incident-in_progress { background: rgba(61,232,255,.10); color: var(--cyan); border: 1px solid rgba(61,232,255,.28); }
.status-pill.incident-resolved { background: var(--neon-dim); color: var(--neon); border: 1px solid rgba(61,255,158,.3); }
.status-pill.incident-cancelled { background: rgba(233,244,236,.07); color: var(--cream-dim); border: 1px solid var(--line); }

.message-bubble {
    position: relative;
    width: fit-content;
    max-width: min(680px, 78%);
    padding: 9px 11px 6px;
    border-radius: 8px;
    border: 1px solid var(--line);
}
.message-bubble.mine {
    align-self: flex-end;
    background: var(--bubble-mine);
    border-color: var(--bubble-mine-border);
    border-radius: 8px 8px 2px 8px;
}
.message-bubble.theirs {
    align-self: flex-start;
    background: var(--bubble-theirs);
    border-radius: 8px 8px 8px 2px;
}
.message-bubble.is-highlighted, .system-message.is-highlighted {
    outline: 2px solid rgba(61, 255, 158, 0.55);
    outline-offset: 2px;
}
.message-bubble p {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.95rem;
}
.message-bubble p strong { font-weight: 800; }
.message-bubble p em { font-style: italic; }
.message-bubble p s { opacity: 0.75; }
.message-bubble p code {
    font-family: var(--mono);
    font-size: 0.86em;
    padding: 1px 5px;
    border-radius: 4px;
    background: color-mix(in srgb, currentColor 10%, transparent);
}
.announcement-message {
    border-color: rgba(255,196,0,.35);
    background: color-mix(in srgb, var(--amber) 10%, var(--bubble-theirs));
}
.announcement-message.mine {
    background: color-mix(in srgb, var(--amber) 12%, var(--bubble-mine));
    border-color: rgba(255,196,0,.45);
}
.announcement-title {
    color: var(--amber);
    font-family: var(--mono);
    font-size: .64rem;
    letter-spacing: .08em;
    text-transform: lowercase;
    margin-bottom: 5px;
}
.announcement-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,196,0,.22);
}
.announcement-footer > span,
.announcement-ack-done {
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .64rem;
    letter-spacing: .05em;
}
.announcement-ack-done { color: var(--neon); }
/* time como bloco no fluxo, mas com largura mínima — assim ele NÃO estica
   o balão para 100% do pai só para ter espaço para "20:56 ✓✓". A rolha de
   segurança é o margin-left:auto que joga o carimbo para a direita mesmo
   em balões estreitos (só foto, por exemplo). */
.message-bubble time {
    display: block;
    width: fit-content;
    margin-top: 4px;
    margin-left: auto;
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.05em;
}
.message-check { color: var(--cream-faint); letter-spacing: -0.08em; }
.message-check.is-read { color: var(--neon); }

.date-separator { align-self: center; padding: 4px 0; }
.date-separator span {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--ink-3);
    border: 1px solid var(--line);
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.09em;
    text-transform: lowercase;
}

.unread-divider { align-self: center; padding: 4px 0; }
.unread-divider span {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--neon-dim);
    border: 1px solid rgba(61, 255, 158, 0.35);
    color: var(--neon);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.09em;
    text-transform: lowercase;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    background: rgba(4, 7, 5, 0.96);
    cursor: zoom-out;
    overflow: hidden;
}
.lightbox[hidden] { display: none; }
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 0;
    border-radius: 3px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    /* transicao suave ao trocar de foto */
    transition: transform .22s ease, opacity .22s ease;
}
.lightbox.is-zoomed .lightbox-stage {
    overflow: auto;
    align-items: flex-start;
}
.lightbox.is-zoomed img {
    max-width: none;
    max-height: none;
    transform: scale(var(--lightbox-zoom, 1));
    transform-origin: top center;
}
.lightbox img.is-leaving-left  { transform: translateX(-24px); opacity: 0; }
.lightbox img.is-leaving-right { transform: translateX(24px);  opacity: 0; }
.lightbox img.is-entering-left  { transform: translateX(-24px); opacity: 0; transition: none; }
.lightbox img.is-entering-right { transform: translateX(24px);  opacity: 0; transition: none; }

/* mensagens consecutivas do mesmo remetente ficam agrupadas */
.message-bubble.is-continuation { margin-top: -5px; }
.message-bubble.is-continuation .sender-name { display: none; }
.message-bubble.mine.is-continuation { border-top-right-radius: 3px; }
.message-bubble.theirs.is-continuation { border-top-left-radius: 3px; }
.sender-name {
    display: block;
    color: var(--neon);
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.07em;
    text-transform: lowercase;
    margin-bottom: 3px;
}

.message-tools {
    position: absolute;
    top: 4px;
    z-index: 6;
    margin: 0;
}
.message-bubble.mine .message-tools { right: 4px; left: auto; }
.message-bubble.theirs .message-tools { right: 4px; left: auto; }
.message-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    border: 0;
    border-radius: 6px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bubble-theirs) 70%, rgba(0,0,0,.42)));
    color: var(--cream-dim);
    font-size: 1rem;
    line-height: 1;
    opacity: 0;
    cursor: pointer;
    transition: opacity .14s ease, color .14s ease, background .14s ease;
}
.message-bubble.mine .message-menu-toggle {
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bubble-mine) 70%, rgba(0,0,0,.42)));
}
.message-bubble:hover .message-menu-toggle,
.message-bubble.show-tools .message-menu-toggle,
.message-menu-toggle:focus-visible {
    opacity: 1;
}
.message-menu-toggle:hover,
.message-menu-toggle:focus-visible,
.message-bubble.show-tools .message-menu-toggle {
    color: var(--neon);
    background: color-mix(in srgb, var(--panel) 82%, transparent);
}
.message-action-menu {
    position: absolute;
    top: 28px;
    right: 0;
    min-width: 178px;
    padding: 7px;
    display: grid;
    gap: 2px;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
    z-index: 8;
}
.message-bubble.theirs .message-action-menu { right: auto; left: 0; }
.message-action-menu[hidden] { display: none; }
.message-action-menu button {
    width: 100%;
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--cream);
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    text-align: left;
    font: 600 0.88rem/1.2 var(--body);
    cursor: pointer;
}
.message-action-menu button span {
    color: var(--cream-dim);
    text-align: center;
    font-size: 1rem;
}
.message-action-menu button:hover,
.message-action-menu button:focus-visible {
    background: color-mix(in srgb, var(--neon) 12%, transparent);
    color: var(--neon);
    outline: 0;
}
.message-action-menu button.is-danger:hover,
.message-action-menu button.is-danger:focus-visible {
    background: rgba(255, 80, 80, 0.12);
    color: #ff7a7a;
}

.reply-quote {
    display: grid;
    gap: 2px;
    border-left: 3px solid var(--neon);
    background: var(--quote-bg);
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    max-width: 320px;
}
.reply-quote strong {
    font-family: var(--mono);
    font-weight: 400;
    font-size: 0.64rem;
    letter-spacing: 0.07em;
    text-transform: lowercase;
    color: var(--neon);
}
.reply-quote span {
    color: var(--cream-dim);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.system-message {
    align-self: center;
    max-width: min(520px, 90%);
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--ink-3);
    border: 1px solid var(--line);
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.06em;
    text-transform: lowercase;
    text-align: center;
}

.media-preview {
    display: block;
    max-width: min(420px, 100%);
    margin-bottom: 6px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.media-preview img, video.media-preview {
    width: 100%;
    max-height: 340px;
    object-fit: contain;
    display: block;
    background: #050807;
}
.audio-preview { width: min(360px, 100%); display: block; }
.audio-message {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.audio-duration {
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.05em;
}
.document-preview {
    width: min(360px, 100%);
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--neon);
    background: var(--quote-bg);
    color: var(--cream);
    text-decoration: none;
    margin-bottom: 6px;
}
.document-preview:hover { border-color: var(--neon); color: var(--cream); }
.document-preview span { color: var(--cream-dim); font-family: var(--mono); font-size: 0.62rem; }

/* Botão Baixar embaixo de foto/vídeo/áudio */
.attachment-block {
    display: block;
    max-width: min(420px, 100%);
    margin-bottom: 6px;
}
.attachment-block .media-preview,
.attachment-block .audio-message {
    margin-bottom: 4px;
}
.media-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--quote-bg);
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.media-download:hover,
.media-download:focus-visible {
    color: var(--neon);
    border-color: var(--neon);
    background: color-mix(in srgb, var(--neon) 12%, var(--quote-bg));
}
.media-download-icon { font-size: 0.85rem; line-height: 1; }

/* Album de fotos — rajada de imagens consecutivas do mesmo remetente,
   apresentada como grid compacto (estilo WhatsApp), com chip pra
   baixar todas em zip no topo. */
.photo-album {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-self: flex-start;
    max-width: min(420px, 92%);
}
.photo-album.is-mine { align-self: flex-end; align-items: flex-end; }
.photo-album-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    width: 100%;
}
/* 2 fotos ficam melhor lado a lado em 2 colunas grandes;
   4 vira 2x2; qualquer outra quantidade cai no default 3xN */
.photo-album[data-count="2"] .photo-album-grid,
.photo-album[data-count="4"] .photo-album-grid {
    grid-template-columns: repeat(2, 1fr);
}
/* Dentro do album cada bubble vira uma tile quadrada com a foto */
.photo-album-grid .message-bubble {
    max-width: none;
    width: 100%;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1;
}
.photo-album-grid .message-bubble.is-continuation { margin-top: 0; }
.photo-album-grid .message-bubble .sender-name,
.photo-album-grid .message-bubble time,
.photo-album-grid .message-bubble .reply-quote,
.photo-album-grid .message-bubble p,
.photo-album-grid .message-bubble .media-download {
    display: none;
}
.photo-album-grid .attachment-block {
    margin: 0;
    width: 100%;
    height: 100%;
    max-width: none;
}
.photo-album-grid .attachment-block .media-preview {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
}
.photo-album-grid .attachment-block .media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.photo-album-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--quote-bg);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    color: var(--cream-dim);
}
.photo-album-count { text-transform: lowercase; }
.photo-album-download {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--cream-dim);
    font: inherit;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.photo-album-download:hover,
.photo-album-download:focus-visible {
    color: var(--neon);
    border-color: var(--neon);
    background: color-mix(in srgb, var(--neon) 12%, var(--quote-bg));
}
.photo-album-download.is-busy,
.photo-album-download[disabled] {
    cursor: progress;
    opacity: 0.9;
    color: var(--neon);
    border-color: var(--neon);
    background: color-mix(in srgb, var(--neon) 12%, var(--quote-bg));
}
.btn-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: btn-spinner-rotate .7s linear infinite;
    vertical-align: -1px;
    margin-right: 2px;
}
@keyframes btn-spinner-rotate {
    to { transform: rotate(360deg); }
}

/* Modal "Nova versao disponivel" — aparece quando o servidor sobe deploy */
.update-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    animation: update-modal-fade .18s ease-out;
}
.update-modal-card {
    width: 100%;
    max-width: 360px;
    background: #131a15;
    color: #e8f4ec;
    border: 1px solid rgba(61, 255, 158, 0.25);
    border-radius: 14px;
    padding: 22px 22px 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    animation: update-modal-in .22s ease-out;
}
[data-theme="clean"] .update-modal-card {
    background: #ffffff;
    color: #16241d;
    border-color: rgba(11, 108, 62, 0.18);
}
.update-modal-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}
.update-modal-body {
    margin: 0 0 18px;
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.4;
}
.update-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.update-modal-later,
.update-modal-reload {
    padding: 9px 18px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter .15s ease, background-color .15s ease, border-color .15s ease;
}
.update-modal-later {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: inherit;
}
[data-theme="clean"] .update-modal-later {
    border-color: rgba(0, 0, 0, 0.15);
}
.update-modal-later:hover,
.update-modal-later:focus-visible {
    background: rgba(255, 255, 255, 0.06);
}
[data-theme="clean"] .update-modal-later:hover,
[data-theme="clean"] .update-modal-later:focus-visible {
    background: rgba(0, 0, 0, 0.04);
}
.update-modal-reload {
    background: var(--neon);
    border: 1px solid var(--neon);
    color: #0a0f0c;
}
.update-modal-reload:hover,
.update-modal-reload:focus-visible {
    filter: brightness(1.08);
}
@keyframes update-modal-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes update-modal-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Topbar do lightbox — barra opaca no topo, foto vai logo abaixo */
.lightbox-topbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 64px;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 18px 10px;
    background: #111816;
    border-bottom: 1px solid rgba(255,255,255,0.09);
    cursor: default;
}
.lightbox-meta {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.lightbox-title {
    color: #fff;
    font-family: var(--body);
    font-weight: 700;
    line-height: 1.1;
}
.lightbox-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}
/* Area da foto — flex fill entre topbar e as bordas */
.lightbox-stage {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 48px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(16px, 4vw, 48px));
    position: relative;
    overflow: hidden;
    min-height: 0;
}
.lightbox-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    min-width: 38px;
    padding: 0 10px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: #fff;
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    cursor: pointer;
}
.lightbox-btn[disabled] {
    color: rgba(255,255,255,.28);
    cursor: default;
}
.lightbox-close {
    width: 38px;
    padding: 0;
    font-size: 1.65rem;
    line-height: 1;
}
.lightbox-counter {
    color: rgba(255,255,255,.66);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}
.lightbox-download {
    background: rgba(255,255,255,.08);
    color: #fff;
    font-weight: 700;
}
.lightbox-download:hover,
.lightbox-download:focus-visible {
    background: var(--neon);
    color: #0a0f0c;
}
.lightbox-download.is-busy {
    cursor: progress;
    filter: brightness(0.92);
    pointer-events: none;
}
.lightbox-btn:not(.lightbox-download):hover,
.lightbox-btn:not(.lightbox-download):focus-visible {
    color: var(--neon);
    background: rgba(255,255,255,.08);
}
/* Setas prev/next — centralizadas verticalmente na area da foto */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-stage .lightbox-prev { left: 12px; }
.lightbox-stage .lightbox-next { right: 12px; }
.lightbox-nav:hover,
.lightbox-nav:focus-visible {
    color: var(--neon);
    border-color: var(--neon);
}
@media (max-width: 520px) {
    .lightbox-nav { display: none; }  /* mobile: usa swipe */
}

/* Toast de debug (temporario — remover apos alinhar Web Share) */
.album-debug-toast {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
    transform: translateX(-50%);
    z-index: 10001;
    max-width: 90vw;
    padding: 10px 16px;
    border-radius: 8px;
    background: rgba(0,0,0,0.85);
    color: #ffd166;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* ============ COMPOSER ============ */

.composer {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    padding: 12px;
    background: var(--ink-2);
    border-top: 1px solid var(--line);
}

/* um só botão de ação: mic quando vazio, enviar quando há conteúdo */
.composer .send-button {
    display: none;
    place-items: center;
    width: 46px;
    height: 42px;
    padding: 0;
    flex: 0 0 auto;
}
.composer .send-button svg { width: 18px; height: 18px; }
.composer.composing .send-button { display: grid; }
.composer.composing .audio-record-button { display: none; }
.composer textarea {
    flex: 1 1 auto;
    min-width: 0;
    resize: none;
    min-height: 42px;
    max-height: 110px;
    border: 1px solid var(--line-strong);
    border-radius: 2px;
    background: var(--ink);
    color: var(--cream);
    padding: 10px 12px;
    outline: none;
    font-family: var(--body);
}
.composer .attach-menu,
.composer .attach-button,
.composer .emoji-picker-button,
.composer .audio-record-button { flex: 0 0 auto; }
/* elementos full-width que precisam quebrar linha */
.composer .reply-preview,
.composer .recording-panel,
.composer .attachment-preview { flex-basis: 100%; }
.composer textarea::placeholder { color: rgba(233,244,236,.35); }
.composer textarea:focus { border-color: var(--neon); box-shadow: 0 0 0 3px var(--neon-dim); }
.composer textarea:disabled { opacity: 0.5; }

.reply-preview {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--neon);
    background: var(--ink-3);
    border-radius: 4px;
    padding: 8px 10px;
}
.reply-preview[hidden] { display: none; }
.reply-preview.is-editing { border-left-color: var(--amber); }
.reply-preview.is-editing strong { color: var(--amber); }
.edited-tag {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    text-transform: lowercase;
    opacity: 0.65;
    margin-right: 4px;
}
.reply-preview span { display: grid; gap: 2px; min-width: 0; }
.reply-preview strong {
    font-family: var(--mono);
    font-weight: 400;
    font-size: 0.64rem;
    letter-spacing: 0.07em;
    text-transform: lowercase;
    color: var(--neon);
}
.reply-preview em {
    color: var(--cream-dim);
    font-style: normal;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.reply-preview button {
    border: 0;
    background: transparent;
    color: var(--danger);
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: lowercase;
    cursor: pointer;
}

.attach-menu { position: relative; }
.attach-button {
    width: 42px;
    height: 42px;
    border-radius: 2px;
    border: 1px solid var(--line-strong);
    display: grid;
    place-items: center;
    font-size: 24px;
    line-height: 1;
    color: var(--neon);
    cursor: pointer;
    margin: 0;
    background: transparent;
    transition: border-color 0.2s, background 0.2s;
}
.attach-button:hover { background: var(--neon-dim); border-color: var(--neon); }
.attach-options {
    position: absolute;
    left: 0;
    bottom: 50px;
    z-index: 20;
    min-width: 160px;
    padding: 6px;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
}
.attach-options[hidden] { display: none; }
.attach-options button,
.attach-options label {
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 2px;
    padding: 9px 10px;
    text-align: left;
    color: var(--cream);
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    text-transform: lowercase;
    display: block;
    cursor: pointer;
    margin: 0;
}
.attach-options button:hover,
.attach-options label:hover { background: var(--neon-dim); color: var(--neon); }
.attach-options label::before { content: "// "; color: var(--neon); }

.file-input-hidden {
    position: fixed;
    left: -1000px;
    top: -1000px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.audio-record-button {
    width: 46px;
    height: 42px;
    border-radius: 2px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--neon);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.audio-record-button svg { width: 18px; height: 18px; }
.audio-record-button:hover { background: var(--neon-dim); border-color: var(--neon); }
.audio-record-button:disabled { opacity: 0.4; }
.audio-record-button.is-recording {
    background: var(--danger-dim);
    border-color: var(--danger);
    color: var(--danger);
}

.attachment-preview {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: var(--cream-dim);
    font-size: 13px;
}
.attachment-preview:empty { display: none; }
.attachment-preview button {
    border: 0;
    background: transparent;
    color: var(--danger);
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: lowercase;
    cursor: pointer;
}
.attachment-thumb {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    min-width: 0;
}
.attachment-thumb img {
    grid-row: 1 / 3;
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--line-strong);
}
.attachment-thumb strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--cream);
}
.attachment-thumb small { color: var(--cream-dim); font-family: var(--mono); font-size: 0.62rem; }
.attachment-sending { margin-left: auto; color: var(--neon); font-family: var(--mono); font-size: 0.66rem; }

.recording-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto auto minmax(140px, 1fr) auto auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(255, 122, 104, 0.4);
    border-radius: 4px;
    background: var(--danger-dim);
}
.recording-panel[hidden] { display: none; }
.recording-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--danger);
    animation: recordPulse 1.2s infinite;
}
.recording-panel strong { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.05em; }
.recording-panel span#recordingStatus {
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.07em;
    text-transform: lowercase;
    color: var(--cream-dim);
}
.recording-panel button {
    border: 1px solid var(--line-strong);
    border-radius: 2px;
    background: transparent;
    padding: 7px 10px;
    color: var(--cream);
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: lowercase;
    cursor: pointer;
}
.recording-panel button:hover { border-color: var(--neon); color: var(--neon); }
.recording-panel button:disabled { opacity: 0.5; cursor: not-allowed; }
.recording-panel audio { grid-column: 1 / -1; width: 100%; }
@keyframes recordPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 122, 104, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(255, 122, 104, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 122, 104, 0); }
}

/* ============ ADMIN ============ */

.admin-area {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--line-strong);
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.admin-tag { display: block; color: var(--neon); margin-bottom: 8px; }
.admin-header h1 {
    margin: 0;
    font-family: var(--disp);
    font-weight: 900;
    font-size: 1.6rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1;
}
.admin-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.metrics-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metrics-grid article {
    position: relative;
    background:
        radial-gradient(ellipse 90% 90% at 100% 0%, var(--neon-faint), transparent 55%),
        var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    padding: 18px;
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.2s;
}
.metrics-grid article::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 34px;
    height: 3px;
    background: var(--neon);
}
.metrics-grid article:hover { transform: translateY(-2px); border-color: rgba(61, 255, 158, 0.35); }
.metrics-grid span {
    display: block;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: var(--cream-dim);
    margin-bottom: 10px;
}
.metrics-grid strong { font-family: var(--disp); font-weight: 900; font-size: 2.2rem; line-height: 1; }

.admin-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }
.admin-panel {
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    padding: 18px;
}
.admin-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.admin-tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    padding: 14px 18px;
    color: inherit;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.admin-tab:hover { border-color: var(--neon); }
.admin-tab:active { transform: translateY(1px); }
.admin-tab .admin-tab-label {
    font-family: var(--disp);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.admin-tab .admin-tab-hint {
    font-size: .78rem;
    opacity: .6;
}
.admin-tab.active {
    background: color-mix(in srgb, var(--neon) 14%, var(--panel));
    border-color: var(--neon);
    box-shadow: inset 0 0 0 1px var(--neon);
}
.admin-tab.active .admin-tab-label { color: var(--neon); }
.admin-tab.active .admin-tab-hint { opacity: .85; }
.admin-tab-panel[hidden] { display: none; }
.tab-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px;
    background: var(--neon); color: var(--ink); border-radius: 999px;
    font-size: .72rem; font-weight: 800; line-height: 1;
    vertical-align: middle;
}
.password-requests-list { display: grid; gap: 14px; margin-top: 6px; }
.password-request-card {
    background: var(--panel); border: 1px solid var(--line-strong);
    border-radius: 8px; padding: 16px 18px;
}
.password-request-head { display: flex; gap: 12px; align-items: flex-start; }
.password-request-copy { display: flex; flex-direction: column; gap: 2px; }
.password-request-copy strong { color: var(--cream); }
.password-request-copy .pr-line { color: var(--cream-dim); font-size: .85rem; }
.password-request-controls { display: flex; gap: 8px; align-items: center; }
.password-request-controls .pr-password { font-family: 'Fragment Mono', ui-monospace, monospace; }
.password-request-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.pr-feedback { margin-top: 8px; }
@media (max-width: 600px) {
    .password-request-actions { flex-direction: column-reverse; }
    .password-request-actions .btn { width: 100%; }
}

@media (max-width: 720px) {
    .admin-tabs { grid-template-columns: 1fr; }
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-heading h2, .admin-panel h2 {
    margin: 0;
    font-family: var(--disp);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.panel-search { max-width: 300px; }

.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar-sm { width: 34px; height: 34px; border-radius: 8px; font-size: 0.85rem; }
.user-cell-copy { display: grid; min-width: 0; }
.user-cell-copy strong,
.user-cell-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-cell-copy strong { font-size: 0.9rem; }
.user-cell-copy small { color: var(--cream-dim); font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.04em; }

.role-tag {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.07em;
    text-transform: lowercase;
    color: var(--cream-dim);
}
.role-tag.admin { color: var(--amber); }
.role-tag::before { content: "// "; }

.status-pill {
    border-radius: 3px;
    padding: 3px 8px;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.07em;
    text-transform: lowercase;
}
.status-pill.active { background: var(--neon-dim); color: var(--neon); border: 1px solid rgba(61,255,158,.3); }
.status-pill.blocked { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(255,122,104,.3); }
.status-pill.inactive { background: rgba(233,244,236,.07); color: var(--cream-dim); border: 1px solid var(--line); }
.status-pill.operation-active { background: var(--neon-dim); color: var(--neon); border: 1px solid rgba(61,255,158,.3); }
.status-pill.operation-planned { background: rgba(61,232,255,.10); color: var(--cyan); border: 1px solid rgba(61,232,255,.28); }
.status-pill.operation-closed { background: rgba(233,244,236,.07); color: var(--cream-dim); border: 1px solid var(--line); }
.operation-avatar { background: color-mix(in srgb, var(--cyan) 18%, var(--panel)); color: var(--cyan); }
.operation-stack { display: grid; gap: 2px; min-width: 160px; }
.operation-stack strong,
.operation-stack small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.operation-stack small { color: var(--cream-dim); font-family: var(--mono); font-size: .66rem; }
.operation-members-list { max-height: 260px; overflow: auto; }
.operation-role-select {
    max-width: 140px;
    margin-left: auto;
}
.operations-dashboard {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}
.operations-dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.operations-dashboard-metrics article {
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: var(--ink-2);
    padding: 12px;
}
.operations-dashboard-metrics span {
    display: block;
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .62rem;
    letter-spacing: .07em;
    text-transform: lowercase;
    margin-bottom: 6px;
}
.operations-dashboard-metrics strong {
    font-family: var(--disp);
    font-size: 1.8rem;
    line-height: 1;
}
.operations-dashboard-lists {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.operations-dashboard-lists section {
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: var(--ink-2);
    padding: 12px;
    min-width: 0;
}
.operations-dashboard-lists h6 {
    margin: 0 0 8px;
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .64rem;
    font-weight: 400;
    letter-spacing: .07em;
    text-transform: lowercase;
}
.dashboard-mini-list {
    display: grid;
    gap: 8px;
    max-height: 240px;
    overflow: auto;
}
.dashboard-mini-item {
    display: grid;
    gap: 2px;
    border-top: 1px solid var(--line);
    padding-top: 8px;
}
.dashboard-mini-item:first-child {
    border-top: 0;
    padding-top: 0;
}
.dashboard-mini-item strong,
.dashboard-mini-item small,
.dashboard-mini-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dashboard-mini-item strong { font-size: .86rem; }
.dashboard-mini-item small,
.dashboard-mini-item span {
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: .62rem;
}

.log-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.log-list li { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.log-list strong { font-family: var(--mono); font-weight: 400; font-size: 0.72rem; letter-spacing: 0.05em; color: var(--neon); }
.log-list span { display: block; color: var(--cream-dim); font-size: 13px; margin-top: 2px; }
.mini-metrics { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 14px; }
.mini-metrics span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 8px 10px;
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: lowercase;
}
.mini-metrics strong { color: var(--cream); font-family: var(--disp); }

/* ============ LISTAS / MODAIS ============ */

.contact-list { display: grid; gap: 8px; }
.contact-item {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: var(--ink-2);
    color: var(--cream);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.contact-item:hover { border-color: rgba(61,255,158,.4); background: var(--neon-faint); }
.contact-item span:last-child { display: grid; }
.contact-item small { color: var(--cream-dim); }
.selectable-list { max-height: 320px; overflow: auto; }
.selectable-contact { cursor: pointer; }
.selectable-contact input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: var(--neon);
}
.selectable-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: var(--ink-2);
    color: var(--cream);
    padding: 10px;
    cursor: pointer;
}
.selectable-row:hover { border-color: rgba(61,255,158,.4); background: var(--neon-faint); }
.selectable-row input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: var(--neon);
}
.selectable-copy { display: grid; min-width: 0; }
.selectable-copy strong,
.selectable-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selectable-copy small { color: var(--cream-dim); font-family: var(--mono); font-size: .66rem; }

.group-member-list { display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.group-member {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    padding: 10px;
    background: var(--ink-2);
}
.group-member-copy { min-width: 0; display: grid; }
.group-member-copy strong,
.group-member-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-member-copy small { color: var(--cream-dim); }
.group-member-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.group-member-actions button {
    border: 1px solid rgba(61,255,158,.35);
    border-radius: 3px;
    background: transparent;
    padding: 5px 8px;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    text-transform: lowercase;
    color: var(--neon);
    cursor: pointer;
}
.group-member-actions button:hover { background: var(--neon); color: var(--ink); }

.modal .modal-body h6 {
    font-family: var(--mono);
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: var(--cream-dim);
}

/* elementos mobile ficam ocultos no desktop */
.mobile-home-header,
.conversation-filters-mobile-only,
.mobile-back-button {
    display: none;
}

/* ============ RESPONSIVO — TABLET ============ */

@media (max-width: 920px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; min-height: auto; max-height: none; align-self: auto; }
    .admin-grid, .login-panel { grid-template-columns: 1fr; }
    .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .operations-dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .operations-dashboard-lists { grid-template-columns: 1fr; }
    .brand-block { justify-items: center; text-align: center; }
    .brand-features { justify-items: start; }
    .workspace { padding: 14px; }
    .chat-panel { height: 70vh; min-height: 480px; }
    .chat-actions { justify-content: flex-start; }
    .chat-actions .form-control { max-width: none; width: auto; }
    .message-bubble { max-width: 92%; }
    .recording-panel { grid-template-columns: auto auto minmax(0, 1fr); }
    .group-member { grid-template-columns: 44px minmax(0, 1fr); }
    .group-member-actions { grid-column: 1 / -1; justify-content: stretch; }
}

@media (max-width: 1180px) {
    .operation-form-tools {
        grid-template-columns: 1fr;
    }
}

/* ============ RESPONSIVO — MOBILE ============ */

@media (max-width: 720px) {
    html, body { min-height: 100%; }
    .operation-modal-dialog {
        width: calc(100vw - 18px);
        margin-left: auto;
        margin-right: auto;
    }
    .operation-view-meta { grid-template-columns: 1fr; }
    .operation-summary-grid,
    .operation-form-tools,
    .operation-form-library,
    .operation-form-field-row { grid-template-columns: 1fr; }
    .operation-task-form,
    .operation-task-item,
    .operation-checkin-form,
    .operation-checkin-item,
    .operation-evidence-form,
    .operation-evidence-item,
    .operation-form-create,
    .operation-invitation-form,
    .operation-invitation-item,
    .operation-invitation-response,
    .operation-document-form,
    .operation-document-item,
    .operation-shift-form,
    .operation-shift-item,
    .operation-incident-form,
    .operation-incident-item,
    .operation-notification-item { grid-template-columns: 1fr; }
    .operation-team-member,
    .operation-invite-option {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .operation-team-member .operation-member-role {
        grid-column: 1 / -1;
        width: 100%;
    }
    .operation-invite-option input {
        grid-row: span 2;
    }
    .operation-task-actions { justify-content: flex-start; }
    body.app-shell {
        min-height: 100dvh;
        display: block;
        background: var(--ink);
        overflow: hidden;
    }

    .sidebar {
        min-height: 100dvh;
        height: 100dvh;
        padding: 16px 14px 84px;
        background: var(--ink);
        border-right: 0;
        gap: 12px;
        overflow: hidden;
        position: relative;
    }

    body.chat-open .sidebar { display: none; }

    .sidebar-brand { display: none; }

    .workspace {
        display: none;
        padding: 0;
        height: 100dvh;
        overflow: hidden;
        background: var(--ink);
    }
    body.chat-open .workspace { display: block; }

    .mobile-home-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 2px 0 6px;
    }
    .mobile-home-header .brand-word { font-size: 2rem; }
    .mobile-home-actions { display: flex; align-items: center; gap: 8px; }
    .mobile-icon-button {
        width: 42px;
        height: 42px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--cream);
        font-size: 28px;
        line-height: 1;
    }

    .profile-strip { display: none; }

    .sidebar-fab {
        position: fixed;
        right: 20px;
        bottom: 88px;
        width: 60px;
        height: 60px;
        font-size: 32px;
        z-index: 30;
    }
    .action-menu {
        position: fixed;
        top: auto;
        right: 20px;
        bottom: 160px;
        left: auto;
        z-index: 40;
        min-width: 210px;
    }
    .action-menu button { padding: 13px 12px; font-size: 0.78rem; }

    .search-control {
        height: 50px;
        border-radius: 4px;
        font-size: 16px;
        padding: 0 16px;
    }

    .conversation-filters { flex-wrap: nowrap; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
    .conversation-filters::-webkit-scrollbar { display: none; }
    .conversation-filters button { flex: 0 0 auto; min-height: 36px; font-size: 0.72rem; padding: 6px 14px; }

    #unreadFilterCount:not(:empty)::before { content: " "; }

    .conversation-list {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
        display: block;
        padding: 6px 0 0;
    }
    .conversation-item {
        min-height: 76px;
        border-radius: 0;
        border: 0;
        border-bottom: 1px solid var(--line);
        grid-template-columns: 54px minmax(0, 1fr) auto;
        gap: 12px;
        padding: 10px 4px;
    }
    .conversation-item.active { background: transparent; }
    .conversation-item:hover { background: var(--ink-2); }
    .conversation-item .avatar { width: 54px; height: 54px; font-size: 20px; border-radius: 12px; }
    .conversation-copy strong { font-size: 1.02rem; line-height: 1.2; }
    .conversation-copy small { margin-top: 4px; font-size: 0.85rem; }

    .empty-conversations { border: 0; padding: 40px 20px; text-align: center; }

    .chat-panel,
    .workspace-chat-only .chat-panel {
        height: 100dvh;
        min-height: 0;
        border: 0;
        border-radius: 0;
        margin: 0;
    }

    .chat-header {
        min-height: 62px;
        padding: 8px 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .chat-peer { flex: 1 1 auto; gap: 8px; }

    .mobile-back-button {
        display: grid;
        place-items: center;
        width: 34px;
        height: 42px;
        border: 0;
        background: transparent;
        color: var(--cream);
        font-size: 38px;
        line-height: 1;
        padding: 0;
    }

    .chat-peer .avatar { width: 42px; height: 42px; }
    .chat-peer h1 { font-size: 1rem; }

    /* mobile: os botões da conversa viram itens de um menu ⋮ único */
    .chat-actions { flex: 0 0 auto; width: 100%; gap: 4px; justify-content: flex-end; position: relative; }
    .chat-actions .form-control,
    #operationInfoButton,
    #announcementButton,
    #groupInviteButton,
    #muteConversation,
    #loadOlderMessages,
    #archiveConversation,
    #groupInfoButton { display: none; }

    .message-history { padding: 12px 10px; gap: 6px; }
    .message-bubble { max-width: 86%; padding: 8px 10px 5px; }

    .composer {
        grid-template-columns: 38px 38px minmax(0, 1fr) 42px;
        gap: 7px;
        padding: 8px;
    }
    .composer textarea { min-height: 42px; border-radius: 4px; padding: 10px 14px; }
    .attach-button, .audio-record-button, .emoji-picker-button { width: 38px; height: 42px; border: 0; background: transparent; }
    .composer .send-button { width: 42px; height: 42px; border-radius: 10px; box-shadow: none; }
    .composer .send-button:hover { transform: none; box-shadow: none; }

    .attachment-preview {
        background: var(--ink-2);
        border: 1px solid var(--line);
        border-radius: 4px;
        padding: 8px;
    }

    .login-footer { position: static; margin-top: 24px; }
    .login-card { box-shadow: 5px 5px 0 rgba(0,0,0,.35); }
}

/* ============================================================
   TEMA CLEAN — claro e minimalista (opção em configurações)
   mesma família visual: mono labels, cantos retos, acento verde
   ============================================================ */

html[data-theme="clean"] {
    --ink: #eef1ee;
    --ink-2: #f7f9f7;
    --ink-3: #e5ebe6;
    --panel: #ffffff;
    --line: rgba(15, 26, 19, 0.08);
    --line-strong: rgba(15, 26, 19, 0.17);
    --cream: #17231b;
    --cream-dim: rgba(23, 35, 27, 0.58);
    --cream-faint: rgba(23, 35, 27, 0.32);
    --neon: #0dbd6e;
    --neon-2: #0aa35f;
    --neon-dim: rgba(13, 189, 110, 0.12);
    --neon-faint: rgba(13, 189, 110, 0.055);
    --danger: #d84a35;
    --danger-dim: rgba(216, 74, 53, 0.1);
    --amber: #a87e00;
    --bubble-mine: #d9f3e6;
    --bubble-mine-border: rgba(13, 189, 110, 0.35);
    --bubble-theirs: #ffffff;
    --grid-line: rgba(15, 26, 19, 0.04);
    --quote-bg: rgba(15, 26, 19, 0.05);
    --scroll-thumb: rgba(15, 26, 19, 0.25);
}

/* texto claro sobre o verde do tema clean */
html[data-theme="clean"] ::selection { color: #ffffff; }
html[data-theme="clean"] .btn-primary,
html[data-theme="clean"] .btn-light {
    --bs-btn-color: #ffffff;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-active-color: #ffffff;
    --bs-btn-disabled-bg: #bcd6c8;
    --bs-btn-disabled-border-color: #bcd6c8;
    --bs-btn-disabled-color: rgba(23, 35, 27, 0.4);
}
html[data-theme="clean"] .btn-outline-primary {
    --bs-btn-border-color: rgba(13, 189, 110, 0.5);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-active-color: #ffffff;
}
html[data-theme="clean"] .sidebar-fab { color: #ffffff; }
html[data-theme="clean"] .conversation-meta b { color: #ffffff; }
html[data-theme="clean"] .message-menu-toggle { background: rgba(255, 255, 255, 0.72); }
html[data-theme="clean"] .message-action-menu {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}
html[data-theme="clean"] .message-action-menu button { color: #1f2937; }
html[data-theme="clean"] .message-action-menu button span { color: #64748b; }

/* controles nativos */
html[data-theme="clean"] .btn-close { filter: none; }
html[data-theme="clean"] .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2317231b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
}
html[data-theme="clean"] .form-control::placeholder { color: rgba(23, 35, 27, 0.4); }

/* sombras duras mais suaves no claro */
html[data-theme="clean"] .btn-primary,
html[data-theme="clean"] .btn-light { box-shadow: 3px 3px 0 rgba(15, 26, 19, 0.18); }
html[data-theme="clean"] .btn-primary:hover,
html[data-theme="clean"] .btn-light:hover { box-shadow: 4px 4px 0 rgba(15, 26, 19, 0.2); }
html[data-theme="clean"] .btn-primary:active,
html[data-theme="clean"] .btn-light:active { box-shadow: 1px 1px 0 rgba(15, 26, 19, 0.2); }
html[data-theme="clean"] .sidebar-fab { box-shadow: 4px 4px 0 rgba(15, 26, 19, 0.18); }
html[data-theme="clean"] .sidebar-fab:hover { box-shadow: 5px 5px 0 rgba(15, 26, 19, 0.2); }
html[data-theme="clean"] .login-card { box-shadow: 8px 8px 0 rgba(15, 26, 19, 0.1); }
html[data-theme="clean"] .action-menu,
html[data-theme="clean"] .attach-options { box-shadow: 6px 6px 0 rgba(15, 26, 19, 0.12); }

/* cores de grupo mais escuras para contraste no claro */
html[data-theme="clean"] .avatar {
    color: color-mix(in srgb, var(--conv-color, var(--neon)) 62%, #10231a);
    background: color-mix(in srgb, var(--conv-color, var(--neon)) 16%, transparent);
    border-color: color-mix(in srgb, var(--conv-color, var(--neon)) 45%, transparent);
}
html[data-theme="clean"] .muted-avatar {
    color: var(--cream-dim);
    background: var(--ink-3);
    border-color: var(--line-strong);
}
html[data-theme="clean"] .conversation-meta b {
    background: color-mix(in srgb, var(--conv-color, var(--neon)) 78%, #10231a);
}

/* ============================================================
   PÁGINA DE ADMINISTRAÇÃO (admin.php) + menu ⋮ da sidebar
   ============================================================ */

body.admin-page {
    min-height: 100vh;
    background: var(--ink);
    color: var(--cream);
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px;
    background: var(--ink-2);
    border-bottom: 1px solid var(--line);
}
.admin-topbar .brand-mark { width: 34px; height: 34px; flex: 0 0 auto; }
.admin-topbar .brand-word { font-size: 1.35rem; line-height: 1; }
.admin-topbar .admin-tag { margin: 2px 0 0; font-size: 0.62rem; }
.admin-topbar .admin-header-actions { margin-left: auto; }

.admin-back {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: lowercase;
    color: var(--cream-dim);
    text-decoration: none;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 6px 14px;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.admin-back:hover { color: var(--neon); border-color: rgba(61, 255, 158, 0.45); background: var(--neon-dim); }

body.admin-page .admin-area {
    margin: 0 auto;
    border-top: 0;
    padding: 24px;
    max-width: 1400px;
}

.panel-filters { margin-bottom: 14px; }

.users-table-wrap { max-height: 62vh; overflow: auto; }
.users-table-wrap .user-cell { min-width: 170px; }
.users-table-wrap td, .users-table-wrap th { white-space: nowrap; }
.users-table-wrap .user-cell-copy strong,
.users-table-wrap .user-cell-copy small { max-width: 220px; }
.users-table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--panel);
}
.user-row-actions { white-space: nowrap; }
.user-row-actions .btn + .btn { margin-left: 6px; }

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.pagination-bar .mono { color: var(--cream-dim); font-size: 0.68rem; letter-spacing: 0.06em; }
.pagination-bar .btn + .btn { margin-left: 6px; }

.log-list { max-height: 56vh; overflow: auto; }

/* botão ⋮ no topo da sidebar (desktop) */
.sidebar-more-button {
    margin-left: 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--cream-dim);
    font-size: 1.25rem;
    line-height: 1;
    padding: 4px 9px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.sidebar-more-button:hover,
.sidebar-more-button[aria-expanded="true"] { color: var(--neon); background: var(--neon-dim); }

/* menu ⋮ abre a partir do topo, não do FAB */
.action-menu-top {
    top: 58px;
    right: 14px;
    bottom: auto;
}

@media (max-width: 720px) {
    .action-menu-top {
        position: fixed;
        top: 58px;
        right: 14px;
        bottom: auto;
        z-index: 60;
    }
    .admin-topbar { padding: 10px 14px; flex-wrap: wrap; }
    .admin-topbar .admin-header-actions { width: 100%; margin-left: 0; }
    body.admin-page .admin-area { padding: 14px; }
}

/* ============ INSTALAR COMO APP (tela de login) ============ */

.install-strip {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 8px;
}
.install-strip-label {
    color: var(--cream-dim);
    font-size: 0.62rem;
    letter-spacing: 0.09em;
    text-transform: lowercase;
}

.ios-guide {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: end center;
    background: rgba(0, 0, 0, 0.55);
    padding: 16px;
}
.ios-guide[hidden] { display: none; }
.ios-guide-card {
    width: min(420px, 100%);
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
    padding: 20px;
    color: var(--cream);
    margin-bottom: 24px;
}
.ios-guide-card h3 {
    font-family: var(--disp);
    font-weight: 900;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 14px;
}
.ios-guide-card ol {
    list-style: none;
    counter-reset: ios-step;
    padding: 0;
    margin: 0 0 16px;
    display: grid;
    gap: 12px;
}
.ios-guide-card li {
    counter-increment: ios-step;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}
.ios-guide-card li::before {
    content: counter(ios-step);
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--neon-dim);
    color: var(--neon);
    font-family: var(--mono);
    font-size: 0.72rem;
}
.ios-guide-card li span { flex: 1 1 auto; }
.ios-guide-card li svg { flex: 0 0 auto; width: 22px; height: 22px; color: var(--neon); }

/* ============ BANNER DE NOTIFICAÇÕES (sidebar) ============ */

.notify-banner {
    display: grid;
    grid-template-columns: 24px 1fr;
    grid-template-areas: "icon text" ". actions";
    gap: 6px 10px;
    padding: 12px 14px;
    background:
        linear-gradient(180deg, rgba(61, 255, 158, 0.18), rgba(61, 255, 158, 0.08)),
        var(--ink-2);
    border: 2px solid var(--neon);
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.35;
    color: var(--cream);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
}
.notify-banner::before {
    content: "";
    grid-area: icon;
    width: 22px;
    height: 22px;
    background: var(--neon);
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/><path d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/><path d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/></svg>");
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain; mask-size: contain;
    align-self: center;
}
.notify-banner > span:first-of-type { grid-area: text; font-weight: 600; }
.notify-banner-actions { grid-area: actions; display: flex; gap: 6px; justify-content: flex-start; margin-top: 6px; }
.notify-banner button {
    border: 0;
    border-radius: 4px;
    padding: 8px 14px;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: lowercase;
    cursor: pointer;
}
.notify-banner button[data-act="enable"] {
    background: var(--neon);
    color: var(--ink);
    font-weight: 700;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}
.notify-banner button[data-act="enable"]:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4); }
.notify-banner button[data-act="dismiss"] { background: transparent; color: var(--cream-dim); }
.notify-banner button[data-act="dismiss"]:hover { color: var(--cream); }

/* botões de instalação com ícone */
.install-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.install-button svg { width: 17px; height: 17px; flex: 0 0 auto; }

/* login mobile: menos texto institucional, instalação visível sem rolar */
@media (max-width: 720px) {
    .brand-block h2 { font-size: 1.05rem; }
    .brand-features { display: none; }
    .login-panel { gap: 18px; }
    .brand-block .brand-mark { width: 56px; height: 56px; }
}

/* ============ CONVITES (modal do admin) ============ */

.invite-result-actions { display: flex; gap: 8px; margin-top: 10px; }
.invite-list { display: grid; gap: 8px; max-height: 240px; overflow: auto; }
.invite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
}
.invite-item-copy { display: grid; min-width: 0; }
.invite-item-copy strong { font-size: 0.88rem; }
.invite-item-copy small { color: var(--cream-dim); font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.05em; }
.invite-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============ CO-BRANDING (login/cadastro) + IDENTIDADE (admin modal) ============ */

.brand-lockup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 6px;
}
.brand-cobrand {
    font-family: var(--mono);
    font-size: 1.2rem;
    color: var(--cream-dim);
    line-height: 1;
}
.brand-company-logo {
    display: grid;
    place-items: center;
    height: 56px;
    max-width: 180px;
    padding: 4px 10px;
    border-radius: 10px;
    /* accent do cliente pinta o container só quando configurado — sem accent, o logo respira */
    background: var(--company-accent, transparent);
    border: 1px solid transparent;
}
/* borda sutil só quando accent está pintando (evita borda esquisita em fundo transparente) */
.brand-company-logo:not([style*="background"]) { border-color: transparent; }
.brand-company-logo img { max-height: 44px; max-width: 160px; width: auto; height: auto; }

/* variante compacta usada na sidebar do chat — logo do cliente ganha protagonismo */
.brand-company-logo--sm { height: 44px; max-width: 160px; padding: 4px 8px; border-radius: 8px; }
.brand-company-logo--sm img { max-height: 34px; max-width: 144px; }

/* modal welcome: variante do .ios-guide que fica centralizado (não colado no bottom) */
#welcomeInstallModal { place-items: center; }
#welcomeInstallModal .ios-guide-card { margin-bottom: 0; }
.brand-poweredby {
    display: block;
    text-align: center;
    color: var(--cream-dim);
    font-size: 0.62rem;
    letter-spacing: 0.09em;
    margin-top: 4px;
}
.brand-poweredby strong { color: var(--neon); font-weight: 400; }

@media (max-width: 920px) {
    .brand-lockup { justify-content: center; }
}
@media (min-width: 921px) {
    .brand-lockup { justify-content: flex-start; }
}

html[data-theme="clean"] .brand-poweredby { color: rgba(15, 26, 19, 0.55); }

/* ============ SISTEMA DE FORMULÁRIO EM MODAIS ============
   Hierarquia clara: seção (título mono + linha) → campo (label + input + hint).
   .form-stack: espaça as seções.
   .form-section: agrupa campos relacionados.
   .form-section-head: título forte da seção com uma dica curta abaixo.
   .form-field: label + input + hint como uma unidade indivisível.
   .form-hint: dica curta abaixo do input (menor e mais discreta que a label). */
.form-stack { display: flex; flex-direction: column; gap: 22px; }
.form-section { display: flex; flex-direction: column; gap: 14px; }
.form-section-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.form-section-title {
    margin: 0;
    font-family: var(--disp);
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cream);
}
.form-section-hint { margin: 0; font-size: 0.78rem; color: var(--cream-dim); }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field .form-label { margin-bottom: 0; }
.form-hint { margin: 2px 0 0; font-size: 0.72rem; color: var(--cream-dim); line-height: 1.4; }
.form-check.form-field { flex-direction: row; align-items: center; gap: 8px; }
.form-check.form-field .form-check-label { margin: 0; font-size: 0.9rem; }

/* modal identidade */
.company-logo-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 6px;
}
.company-logo-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.company-logo-preview {
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    background: var(--ink-3);
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    overflow: hidden;
    flex: 0 0 auto;
}
.company-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.company-logo-actions { display: grid; gap: 6px; justify-items: start; }
.company-logo-actions .mono { color: var(--cream-dim); font-size: 0.62rem; letter-spacing: 0.05em; }

/* sidebar do chat com co-brand — layout em duas linhas para dar destaque ao nome.
   Só desktop: no mobile o media query em 720px já esconde .sidebar-brand,
   então mantenho a regra aqui restrita para não sobrescrever o display: none. */
@media (min-width: 721px) {
    .sidebar-brand {
        display: flex;
        flex-direction: column;
        gap: 6px;
        align-items: stretch;
    }
}
.sidebar-brand-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.sidebar-brand-row .sidebar-brand-inner { flex: 1 1 auto; min-width: 0; }
.sidebar-brand-row .sidebar-more-button { flex: 0 0 auto; margin-left: auto; }
.sidebar-brand-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.sidebar-brand-inner .brand-mark { width: 40px; height: 40px; flex: 0 0 auto; }
.sidebar-brand-inner .brand-mark svg { width: 100%; height: 100%; display: block; }
.sidebar-brand-inner .brand-cobrand { font-size: 0.85rem; color: var(--cream-dim); flex: 0 0 auto; }

/* nome da empresa em destaque abaixo do co-brand */
.sidebar-brand-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: var(--disp);
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.2;
    color: var(--cream);
    margin: 4px 0 0;
}
.sidebar-brand-sub {
    display: block;
    color: var(--cream-dim);
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    margin-top: 2px;
}
.sidebar-brand-sub strong { color: var(--neon); font-weight: 400; }

.mobile-home-brand { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.mobile-home-header .sidebar-brand-inner .brand-mark { width: 44px; height: 44px; }
.mobile-home-header .brand-company-logo--sm { height: 48px; max-width: 180px; }
.mobile-home-header .brand-company-logo--sm img { max-height: 36px; max-width: 160px; }
.mobile-home-brand .sidebar-brand-name { font-size: 1rem; margin-top: 2px; }

/* ============ FAIXA DE ACENTO INSTITUCIONAL (cor da empresa)
   Toque leve, presente em todas as páginas: sinal visual "você está no
   ambiente da Coletiva" sem descaracterizar o design system TouOn.
   Quando --company-accent não está definido, a barra fica transparente. */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--company-accent, transparent);
    z-index: 9999;
    pointer-events: none;
}
.company-accent-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 4px;
}
.company-accent-row .form-control-color { flex: 0 0 56px; padding: 4px; height: 38px; }
.company-accent-row input[type="text"] { flex: 1 1 auto; font-family: var(--mono); text-transform: lowercase; }

/* Modal de info do grupo — visão readonly para não-admins */
.group-info-readonly { margin-bottom: 14px; }
.group-info-readonly h5 { font-family: var(--disp); font-weight: 800; font-size: 1.1rem; }

/* botão ⋮ do chat: só existe no mobile */
.chat-more-button {
    display: none;
    background: transparent;
    border: 0;
    color: var(--cream);
    font-size: 1.4rem;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.chat-more-button:disabled { color: var(--cream-faint); cursor: default; }
.chat-more-button[aria-expanded="true"] { background: var(--neon-dim); color: var(--neon); }

/* menu contextual do chat — desktop e mobile precisam sobrescrever a regra
   .action-menu genérica (que ancora no bottom da sidebar-fab) */
.chat-more-menu {
    min-width: 210px;
    /* garante posicionamento correto no desktop (relativo a .chat-actions) */
    position: absolute;
    top: 100%;
    right: 6px;
    bottom: auto;
    left: auto;
    margin-top: 4px;
    /* garante que os estilos do .action-menu não sumam (background, borda, shadow) */
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
    padding: 6px;
    z-index: 60;
}
@media (max-width: 720px) {
    .chat-more-button { display: inline-grid; place-items: center; width: 36px; height: 40px; }
    /* no mobile o header é sticky/absoluto; ancoramos o menu abaixo dele à direita */
    .chat-more-menu {
        position: absolute;
        top: 100%;
        right: 8px;
        bottom: auto;
        left: auto;
        margin-top: 6px;
    }
}

/* Badges de papel (admin geral, admin do grupo) — usados na lista de contatos e participantes */
.member-count {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: lowercase;
    color: var(--cream-dim);
    margin-left: 4px;
}
.member-tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    text-transform: lowercase;
    padding: 1px 6px;
    border-radius: 3px;
    line-height: 1.5;
    vertical-align: middle;
}
.member-tag--admin { background: var(--amber); color: var(--ink); }
.member-tag--group-admin { background: var(--neon); color: var(--ink); }

/* card de upload em andamento no histórico (foto, vídeo, arquivo) */
.message-bubble.is-uploading { padding: 12px 14px; min-width: 220px; }
.message-bubble.is-uploading .uploading-info { display: grid; gap: 2px; margin-bottom: 8px; }
.message-bubble.is-uploading .uploading-info strong { font-family: var(--disp); font-size: 0.9rem; }
.message-bubble.is-uploading .uploading-info small {
    color: var(--cream-dim);
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.04em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 260px;
}
.message-bubble.is-uploading .uploading-progress {
    height: 4px;
    background: rgba(233, 244, 236, 0.15);
    border-radius: 2px;
    overflow: hidden;
}
.message-bubble.is-uploading .uploading-bar {
    height: 100%;
    background: var(--neon);
    transition: width 0.15s ease-out;
}
.message-bubble.is-uploading .uploading-percent {
    text-align: right;
    font-family: var(--mono);
    font-size: 0.66rem;
    color: var(--neon);
    margin-top: 4px;
}

/* ===== @menções ===== */
.mention {
    color: var(--neon);
    background: rgba(61, 255, 158, 0.12);
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
}
.mention-self {
    background: rgba(61, 255, 158, 0.28);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(61, 255, 158, 0.6);
}
[data-theme="clean"] .mention {
    color: #0b6c3e;
    background: rgba(11, 108, 62, 0.08);
}
[data-theme="clean"] .mention-self {
    background: rgba(11, 108, 62, 0.2);
    color: #063a20;
    box-shadow: inset 0 0 0 1px rgba(11, 108, 62, 0.5);
}
.message-bubble.is-mentioned {
    box-shadow: 0 0 0 2px var(--neon);
    position: relative;
}
.message-bubble.is-mentioned::before {
    content: "@";
    position: absolute;
    top: -10px;
    left: -10px;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    background: var(--neon);
    color: #0a0f0c;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    font-family: var(--mono);
}

/* dropdown do autocomplete */
.mention-dropdown {
    z-index: 1080;
    background: #131a15;
    border: 1px solid rgba(61, 255, 158, 0.22);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    overflow-y: auto;
    padding: 4px;
}
[data-theme="clean"] .mention-dropdown {
    background: #ffffff;
    border-color: rgba(11, 108, 62, 0.2);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}
.mention-dropdown[hidden] { display: none; }
.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: 0;
    color: inherit;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
}
.mention-item:hover, .mention-item.is-active {
    background: rgba(61, 255, 158, 0.16);
}
[data-theme="clean"] .mention-item:hover,
[data-theme="clean"] .mention-item.is-active {
    background: rgba(11, 108, 62, 0.08);
}
.mention-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(61, 255, 158, 0.18);
    color: var(--neon);
    font-weight: 700;
}
.mention-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mention-avatar-initial { font-size: 0.85rem; }
.mention-labels { display: flex; flex-direction: column; min-width: 0; }
.mention-labels strong { font-size: 0.9rem; }
.mention-labels em { font-style: normal; opacity: 0.65; font-size: 0.75rem; font-family: var(--mono); }

/* ===== emoji picker ===== */
.emoji-picker-button {
    width: 42px;
    height: 42px;
    border-radius: 2px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--neon);
    display: grid;
    place-items: center;
    cursor: pointer;
    margin: 0;
    padding: 0;
    transition: border-color 0.2s, background 0.2s;
}
.emoji-picker-button:hover { background: var(--neon-dim); border-color: var(--neon); }
.emoji-picker-button svg { width: 22px; height: 22px; }

.emoji-picker {
    position: fixed;
    z-index: 1075;
    background: #131a15;
    border: 1px solid rgba(61, 255, 158, 0.22);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
[data-theme="clean"] .emoji-picker {
    background: #ffffff;
    border-color: rgba(11, 108, 62, 0.18);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}
.emoji-picker[hidden] { display: none; }
.emoji-picker-header {
    padding: 8px 10px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
[data-theme="clean"] .emoji-picker-header { border-bottom-color: rgba(0, 0, 0, 0.06); }
.emoji-picker-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}
.emoji-picker-tabs::-webkit-scrollbar { display: none; }
.emoji-tab {
    background: transparent;
    border: 0;
    padding: 4px 6px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: background 0.15s, opacity 0.15s;
}
.emoji-tab:hover { opacity: 1; background: rgba(255, 255, 255, 0.06); }
.emoji-tab.is-active {
    opacity: 1;
    background: rgba(61, 255, 158, 0.18);
    box-shadow: inset 0 -2px 0 var(--neon);
}
[data-theme="clean"] .emoji-tab.is-active {
    background: rgba(11, 108, 62, 0.1);
    box-shadow: inset 0 -2px 0 #0b6c3e;
}
.emoji-search { font-size: 0.85rem; }
.emoji-list {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    padding: 8px;
    gap: 2px;
    align-content: start;
}
.emoji-cell {
    background: transparent;
    border: 0;
    font-size: 22px;
    line-height: 1;
    padding: 6px 0;
    cursor: pointer;
    border-radius: 6px;
    text-align: center;
}
.emoji-cell:hover, .emoji-cell:focus {
    background: rgba(61, 255, 158, 0.16);
    outline: none;
}
[data-theme="clean"] .emoji-cell:hover,
[data-theme="clean"] .emoji-cell:focus {
    background: rgba(11, 108, 62, 0.08);
}
.emoji-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted, #9aa7a0);
    font-size: 0.85rem;
    grid-column: 1 / -1;
}

/* ===== app-dialog (alert/confirm bootstrap) ===== */
.app-dialog .modal-content {
    background: #131a15;
    color: #e8f4ec;
    border: 1px solid rgba(61, 255, 158, 0.2);
}
[data-theme="clean"] .app-dialog .modal-content {
    background: #ffffff;
    color: #16241d;
    border-color: rgba(11, 108, 62, 0.18);
}
.app-dialog .modal-header { border-bottom-color: rgba(255, 255, 255, 0.08); }
.app-dialog .modal-footer { border-top-color: rgba(255, 255, 255, 0.08); }
[data-theme="clean"] .app-dialog .modal-header,
[data-theme="clean"] .app-dialog .modal-footer {
    border-color: rgba(0, 0, 0, 0.08);
}
.app-dialog .btn-outline-light {
    color: inherit;
    border-color: rgba(255, 255, 255, 0.2);
}
[data-theme="clean"] .app-dialog .btn-outline-light {
    border-color: rgba(0, 0, 0, 0.15);
    color: #16241d;
}
[data-theme="clean"] .app-dialog .btn-close-white {
    filter: none;
}
.app-toast-dialog {
    pointer-events: none;
}
.app-toast-dialog .modal-dialog {
    max-width: 340px;
}
.app-toast-dialog .modal-content {
    border-color: rgba(61, 255, 158, 0.34);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.36);
}
.app-toast-dialog .modal-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
}
.app-toast-dialog strong {
    display: block;
    font-family: var(--disp);
    font-size: .88rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.app-toast-dialog p {
    margin-top: 2px;
    color: var(--cream-dim);
    font-size: .86rem;
}
.app-toast-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--neon);
    color: #07100b;
    font-weight: 900;
}
[data-theme="clean"] .app-toast-dialog p {
    color: rgba(22, 36, 29, 0.68);
}
