:root {
    color-scheme: light;
    --ink: #14263d;
    --ink-soft: #52647a;
    --muted: #76879b;
    --line: #e4eaf1;
    --paper: #ffffff;
    --canvas: #f4f7fc;
    --blue: #2864d8;
    --blue-dark: #1d4eae;
    --blue-pale: #edf4ff;
    --green: #21805c;
    --green-pale: #eaf7f1;
    --violet: #6954c7;
    --violet-pale: #f0edff;
    --danger: #a53945;
    --danger-pale: #fff0f1;
    --shadow: 0 18px 48px rgba(24, 48, 78, 0.08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-size: 15px;
    line-height: 1.55;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
button, input { font: inherit; }
button { cursor: pointer; }

:focus-visible {
    outline: 3px solid rgba(40, 100, 216, 0.42);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    z-index: 5;
    top: 10px;
    left: 10px;
    padding: 9px 13px;
    transform: translateY(-150%);
    border-radius: 8px;
    color: #fff;
    background: var(--ink);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
    position: relative;
    z-index: 2;
    border-bottom: 1px solid rgba(220, 228, 238, 0.9);
    background: rgba(255, 255, 255, 0.94);
}
.topbar-inner {
    display: flex;
    width: min(1160px, calc(100% - 48px));
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 11px 11px 11px 4px;
    background: linear-gradient(145deg, #397dec, #2455be);
    box-shadow: 0 5px 12px rgba(40, 100, 216, 0.22);
}
.brand-mark span { width: 3px; height: 3px; border-radius: 50%; background: #fff; }
.brand-name { font-size: 18px; font-weight: 760; letter-spacing: -0.045em; }
.brand-name span { color: var(--blue); }
.main-nav { display: flex; height: 76px; align-items: stretch; gap: 7px; }
.main-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 620;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--blue); }
.main-nav a[aria-current="page"]::after {
    position: absolute;
    right: 13px;
    bottom: 0;
    left: 13px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--blue);
    content: "";
}
.topbar-account { display: flex; align-items: center; gap: 14px; }
.topbar-user { max-width: 160px; overflow: hidden; color: var(--ink-soft); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-account form { margin: 0; }

.page-shell { width: min(1080px, calc(100% - 48px)); min-height: calc(100vh - 154px); margin: 0 auto; padding: 46px 0 58px; }
.site-footer {
    display: flex;
    width: min(1080px, calc(100% - 48px));
    justify-content: space-between;
    gap: 20px;
    margin: 0 auto;
    padding: 20px 0 24px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}
.site-footer span:first-child { color: var(--ink-soft); font-weight: 700; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); letter-spacing: -0.035em; }
h1 { margin-bottom: 10px; font-size: clamp(29px, 3.7vw, 40px); line-height: 1.15; }
h2 { margin-bottom: 8px; font-size: 21px; line-height: 1.3; }
h3 { margin-bottom: 7px; font-size: 17px; }
.muted { color: var(--ink-soft); }
.eyebrow { margin-bottom: 8px; color: var(--blue); font-size: 11px; font-weight: 760; letter-spacing: 0.13em; text-transform: uppercase; }
.text-link { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }

.button {
    display: inline-flex;
    min-height: 43px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 720;
    line-height: 1.2;
    transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 7px 15px rgba(40, 100, 216, 0.18); }
.button-primary:hover { color: #fff; background: var(--blue-dark); }
.button-secondary { border-color: #d7e2f2; color: var(--blue-dark); background: #fff; }
.button-secondary:hover { border-color: #b9ccef; color: var(--blue-dark); background: #f8faff; }
.button-quiet { border-color: var(--line); color: var(--ink-soft); background: #fbfcfe; }
.button-quiet:hover { border-color: #cfdcec; color: var(--ink); background: #f3f6fa; }
.button-small { min-height: 36px; padding: 8px 12px; font-size: 12px; }
.button-wide { width: 100%; min-height: 48px; }

.panel { padding: 24px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.page-shell > .panel + .panel { margin-top: 20px; }
.panel > :last-child { margin-bottom: 0; }
.panel-heading { margin-bottom: 27px; }
.panel-heading .muted { margin-bottom: 0; font-size: 13px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading .eyebrow { margin-bottom: 4px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; }
.page-heading h1 { margin-bottom: 8px; }
.page-heading p:last-child { margin-bottom: 0; }

.notice { margin-bottom: 22px; padding: 13px 16px; border: 1px solid; border-radius: 12px; font-size: 13px; }
.notice-success { border-color: #bde7d3; color: #176340; background: var(--green-pale); }
.notice-error { border-color: #f0c6ca; color: #8f2e3a; background: var(--danger-pale); }
.notice-title { margin-bottom: 4px; font-weight: 720; }
.notice ul { margin: 4px 0 0; padding-left: 19px; }

.login-layout { display: grid; min-height: 575px; grid-template-columns: 1fr minmax(360px, 0.8fr); align-items: center; gap: clamp(38px, 8vw, 106px); padding: 34px 5%; }
.login-intro { max-width: 490px; }
.login-intro h1 { margin: 20px 0 17px; font-size: clamp(36px, 4.3vw, 53px); line-height: 1.1; }
.login-intro h1 span { color: var(--blue); }
.login-intro > p { max-width: 410px; margin-bottom: 30px; color: var(--ink-soft); font-size: 16px; }
.eyebrow-dot { display: inline-block; width: 7px; height: 7px; margin: 0 6px 1px 0; border-radius: 50%; background: #42b887; box-shadow: 0 0 0 4px #e5f7ef; }
.intro-note { display: flex; max-width: 400px; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 12px; }
.intro-note-icon { display: inline-grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-pale); font-weight: 800; }
.panel.login-panel { padding: 34px; }
.login-panel .panel-heading { margin-bottom: 26px; }
.login-panel h2 { font-size: 22px; }
.form-stack { display: grid; gap: 19px; }
.field { display: grid; gap: 7px; }
.field label { color: var(--ink); font-size: 12px; font-weight: 700; }
.field input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #d9e1eb;
    border-radius: 10px;
    color: var(--ink);
    background: #fff;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}
.field input:hover { border-color: #b7c6d8; }
.field input:focus { border-color: #719ae5; outline: none; box-shadow: 0 0 0 3px rgba(40, 100, 216, 0.12); }
.field input[readonly] { color: var(--ink-soft); background: #f7f9fc; }
.field-hint { color: var(--muted); font-size: 11px; }
.field-error { color: var(--danger); font-size: 12px; }
.login-help { display: flex; align-items: flex-start; gap: 11px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.help-icon { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; border-radius: 50%; color: var(--blue-dark); background: var(--blue-pale); font-size: 12px; font-weight: 800; }
.login-help p { margin-bottom: 0; color: var(--ink-soft); font-size: 12px; }
.login-help strong { color: var(--ink); }

.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 28px; }
.welcome-row h1 { margin-bottom: 8px; }
.welcome-row p:last-child { margin-bottom: 0; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 24px; }
.summary-card { display: flex; min-height: 96px; align-items: center; gap: 14px; padding: 19px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.summary-card > div { display: grid; gap: 2px; }
.summary-card strong { color: var(--ink); font-size: 14px; }
.summary-label { color: var(--muted); font-size: 11px; font-weight: 650; }
.summary-icon, .setting-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 13px; font-size: 21px; font-weight: 650; }
.summary-icon-blue, .setting-icon-blue { color: var(--blue); background: var(--blue-pale); }
.summary-icon-green, .setting-icon-green { color: var(--green); background: var(--green-pale); }
.summary-icon-violet { color: var(--violet); background: var(--violet-pale); }
.conversation-panel { padding: 24px 27px 8px; }
.dashboard-conversation-panel { min-height: 310px; padding-bottom: 18px; }
.dashboard-conversation-empty { min-height: 205px; }
.empty-state { display: grid; min-height: 255px; align-content: center; justify-items: center; padding: 22px; text-align: center; }
.empty-state h3, .empty-state h2 { margin: 12px 0 4px; }
.empty-state p { max-width: 400px; margin-bottom: 0; color: var(--muted); font-size: 13px; }
.empty-state-large { min-height: 390px; }
.chat-list-panel { min-height: 465px; }
.empty-art { position: relative; width: 83px; height: 65px; }
.bubble { position: absolute; display: block; border: 1px solid; border-radius: 16px; }
.bubble-back { top: 4px; right: 3px; width: 49px; height: 34px; border-color: #d1def2; background: #f6f9ff; transform: rotate(8deg); }
.bubble-front { bottom: 4px; left: 3px; display: flex; width: 55px; height: 39px; align-items: center; justify-content: center; gap: 4px; border-color: #c4d6f7; border-bottom-left-radius: 5px; background: linear-gradient(140deg, #f0f6ff, #fff); box-shadow: 0 7px 17px rgba(38, 82, 150, 0.1); }
.bubble-front i { width: 5px; height: 5px; border-radius: 50%; background: #6f99df; }
.bottom-note { display: flex; align-items: center; gap: 10px; margin: 20px 2px 0; color: var(--ink-soft); font-size: 12px; }
.bottom-note p { margin: 0; }
.bottom-note-mark { color: #e2a840; font-size: 17px; }
.chat-list-panel .empty-state p { max-width: 360px; }

.profile-layout { display: grid; grid-template-columns: minmax(240px, 0.74fr) minmax(380px, 1.3fr); align-items: start; gap: 18px; }
.profile-password-panel { grid-column: 2; }
.profile-card { display: flex; flex-direction: column; align-items: center; padding: 30px 25px; text-align: center; }
.profile-avatar { display: grid; width: 72px; height: 72px; place-items: center; margin-bottom: 15px; border: 5px solid #eaf1ff; border-radius: 50%; color: #fff; background: linear-gradient(140deg, #4a82e1, #2857b7); font-size: 28px; font-weight: 700; }
.profile-card h2 { margin-bottom: 1px; }
.profile-card > .muted { margin-bottom: 15px; font-size: 13px; }
.role-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 24px; }
.role-pill { display: inline-flex; padding: 4px 9px; border-radius: 999px; color: #425f95; background: var(--blue-pale); font-size: 10px; font-weight: 700; }
.profile-meta { display: grid; width: 100%; gap: 0; text-align: left; }
.profile-meta div { display: grid; gap: 3px; padding: 12px 0; border-top: 1px solid var(--line); }
.profile-meta span, .settings-details dt { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
.profile-meta strong { overflow-wrap: anywhere; color: var(--ink); font-size: 12px; font-weight: 650; }
.status-active { color: var(--green) !important; }
.form-panel { padding: 29px; }
.form-panel .button { justify-self: start; margin-top: 2px; }
.field-readonly { margin-top: 1px; }

.settings-grid { display: grid; gap: 15px; }
.settings-card { display: flex; align-items: flex-start; gap: 18px; padding: 25px; }
.settings-copy { flex: 1; }
.settings-copy h2 { margin-bottom: 8px; }
.settings-copy > .muted { max-width: 660px; margin-bottom: 16px; font-size: 13px; }
.settings-card .eyebrow { margin-bottom: 4px; }
.settings-details { display: grid; max-width: 600px; gap: 0; margin: 20px 0 15px; }
.settings-details div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.settings-details dt { align-self: center; }
.settings-details dd { margin: 0; color: var(--ink); font-size: 12px; font-weight: 620; text-align: right; }
.settings-footnote { display: flex; align-items: flex-start; gap: 10px; padding: 8px 4px; color: var(--muted); font-size: 12px; }
.settings-footnote span { color: var(--blue); }
.settings-footnote p { margin: 0; }

.password-layout { display: grid; max-width: 640px; gap: 17px; margin: 18px auto; }
.password-panel { padding: 32px; }
.password-panel h1 { font-size: 27px; }
.password-note { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border: 1px solid #d8e8df; border-radius: 12px; color: var(--ink-soft); background: #f3fbf7; font-size: 12px; }
.password-note p { margin: 0; }

@media (max-width: 820px) {
    .topbar-inner { width: min(100% - 32px, 700px); flex-wrap: wrap; gap: 0 12px; padding-top: 13px; }
    .brand { min-height: 43px; }
    .topbar-account { margin-left: auto; }
    .main-nav { order: 3; flex-wrap: wrap; width: 100%; height: auto; gap: 2px 4px; padding-bottom: 4px; }
    .main-nav a { height: 40px; padding: 0 9px; white-space: nowrap; }
    .main-nav a[aria-current="page"]::after { right: 10px; left: 10px; }
    .page-shell { width: min(100% - 32px, 700px); min-height: calc(100vh - 177px); padding-top: 34px; }
    .site-footer { width: min(100% - 32px, 700px); }
    .login-layout { min-height: 0; grid-template-columns: 1fr; gap: 32px; padding: 18px 0; }
    .login-intro { max-width: 620px; }
    .login-intro h1 { font-size: 40px; }
    .login-intro > p { margin-bottom: 17px; }
    .intro-note { max-width: 100%; }
    .summary-grid { grid-template-columns: 1fr; gap: 10px; }
    .summary-card { min-height: 77px; padding: 14px; }
    .profile-layout { grid-template-columns: 1fr; }
    .profile-password-panel { grid-column: auto; }
}

@media (max-width: 520px) {
    .topbar-inner { width: calc(100% - 24px); }
    .brand-name { font-size: 16px; }
    .topbar-user { display: none; }
    .button-small { min-height: 34px; }
    .page-shell { width: calc(100% - 28px); padding: 28px 0 40px; }
    .site-footer { width: calc(100% - 28px); flex-direction: column; gap: 3px; }
    .welcome-row { align-items: flex-start; flex-direction: column; }
    .welcome-row h1 { font-size: 31px; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .conversation-panel { padding: 19px 16px 4px; }
    .panel.login-panel, .form-panel, .password-panel { padding: 23px 19px; }
    .login-intro h1 { font-size: 35px; }
    .settings-card { gap: 12px; padding: 20px 16px; }
    .setting-icon { width: 36px; height: 36px; flex-basis: 36px; }
    .settings-details div { align-items: flex-start; flex-direction: column; gap: 4px; }
    .settings-details dd { text-align: left; }
    .settings-footnote { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

.chat-heading { margin-bottom: 24px; }
.new-chat-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; padding: 23px 26px; }
.new-chat-panel h2 { margin-bottom: 5px; }
.new-chat-panel .muted { margin-bottom: 0; font-size: 12px; }
.new-chat-form { display: flex; width: min(470px, 55%); gap: 10px; }
.text-input { min-width: 0; flex: 1; padding: 11px 13px; border: 1px solid #dce4ef; border-radius: 10px; color: var(--ink); background: #fff; }
.text-input:focus, .message-compose textarea:focus { border-color: #8db1ed; outline: 3px solid rgba(40, 100, 216, 0.13); }
.count-label { color: var(--muted); font-size: 12px; }
.conversation-list { display: grid; }
.conversation-row { display: flex; min-width: 0; align-items: center; gap: 15px; padding: 15px 0; border-top: 1px solid var(--line); color: var(--ink); }
.conversation-row:hover { color: var(--ink); background: #fbfcfe; }
.contact-list { display: grid; }
.contact-row { display: flex; min-width: 0; align-items: center; gap: 15px; padding: 15px 0; border-top: 1px solid var(--line); }
.contact-row:first-child { border-top: 0; }
.contact-copy { display: grid; min-width: 0; flex: 1; gap: 3px; }
.contact-username { color: var(--muted); font-size: 12px; }
.contact-open-form { flex: 0 0 auto; }
.contact-open-form .button { margin: 0; }
.chat-avatar { display: inline-flex; width: 46px; height: 46px; flex: 0 0 46px; align-items: center; justify-content: center; border-radius: 15px; color: var(--blue-dark); background: var(--blue-pale); font-size: 16px; font-weight: 780; }
.chat-avatar-image { object-fit: cover; background: var(--blue-pale); }
.message-sender-name { margin: 0 0 3px; color: var(--blue-dark); font-size: 11px; font-weight: 700; }
.conversation-copy { display: grid; min-width: 0; flex: 1; gap: 3px; }
.conversation-title { overflow: hidden; font-size: 14px; font-weight: 740; text-overflow: ellipsis; white-space: nowrap; }
.conversation-preview { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-meta { display: grid; justify-items: end; gap: 7px; color: var(--muted); font-size: 11px; }
.unread-badge { display: inline-flex; min-width: 22px; height: 22px; align-items: center; justify-content: center; padding: 0 6px; border-radius: 11px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 760; }
.pagination-wrap { padding-top: 17px; border-top: 1px solid var(--line); }
.pagination-wrap nav { display: flex; justify-content: center; }
.pagination-wrap svg { width: 17px; height: 17px; }
.pagination-wrap span, .pagination-wrap a { padding: 7px 10px; font-size: 12px; }

.conversation-page { width: min(900px, 100%); margin: 0 auto; }
.conversation-page-heading { display: grid; gap: 17px; margin-bottom: 18px; }
.conversation-person { display: flex; align-items: center; gap: 14px; }
.conversation-person .chat-avatar { width: 52px; height: 52px; flex-basis: 52px; font-size: 18px; }
.conversation-person .eyebrow { margin-bottom: 5px; }
.conversation-person h1 { margin-bottom: 1px; font-size: 27px; }
.conversation-person .muted { margin: 0; font-size: 12px; }
.message-panel { overflow: hidden; padding: 0; }
.message-panel-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line); font-size: 11px; }
.live-indicator { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 11px; font-weight: 650; }
.live-indicator span { width: 7px; height: 7px; border-radius: 50%; background: #38a978; box-shadow: 0 0 0 3px #e5f5ee; }
.message-scroll { display: grid; min-height: 300px; max-height: 62vh; gap: 12px; overflow-y: auto; padding: 23px clamp(15px, 4vw, 36px); background: #f9fbfe; }
.older-messages { display: flex; justify-content: center; margin-bottom: 7px; }
.message-row { display: flex; width: 100%; }
.message-row-own { justify-content: flex-end; }
.message-row-peer { justify-content: flex-start; }
.message-bubble { position: relative; max-width: min(76%, 620px); padding: 12px 14px 8px; border: 1px solid var(--line); border-radius: 15px 15px 15px 4px; background: #fff; box-shadow: 0 3px 10px rgba(24, 48, 78, 0.035); }
.message-bubble-own { border-color: #d4e2fb; border-radius: 15px 15px 4px 15px; background: #eef4ff; }
.message-bubble-deleted { color: var(--muted); background: #f2f4f7; }
.message-body { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-foot { display: flex; justify-content: flex-end; gap: 9px; margin-top: 7px; color: var(--muted); font-size: 10px; }
.message-status { color: var(--blue-dark); font-weight: 680; }
.message-delete-form { display: flex; justify-content: flex-end; margin-top: 2px; }
.text-button { padding: 2px 0; border: 0; color: var(--muted); background: transparent; font-size: 10px; text-decoration: underline; }
.text-button:hover { color: var(--danger); }
.message-empty { display: grid; min-height: 240px; align-content: center; justify-items: center; color: var(--muted); text-align: center; }
.message-empty h2 { margin: 12px 0 5px; font-size: 17px; }
.message-empty p { margin: 0; font-size: 12px; }
.message-empty .empty-art { transform: scale(.72); }
.chat-live-status { margin: 0; padding: 8px 20px; border-top: 1px solid var(--line); font-size: 10px; }
.message-compose { display: grid; gap: 10px; padding: 15px 20px 19px; border-top: 1px solid var(--line); background: #fff; }
.message-compose textarea { width: 100%; min-height: 64px; resize: vertical; padding: 12px 13px; border: 1px solid #dce4ef; border-radius: 11px; color: var(--ink); background: #fff; font: inherit; font-size: 13px; }
.compose-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.compose-actions .muted { margin: 0; font-size: 10px; }
.older-page-return { display: flex; justify-content: center; padding: 17px; border-top: 1px solid var(--line); }
.message-media { width: min(210px, 64vw); margin: 0 0 6px; }
.message-media img, .message-media video { display: block; width: 100%; height: auto; max-height: 260px; border-radius: 10px; background: #e9eef6; object-fit: cover; }
.message-media video { object-fit: contain; }
.message-media a { display: block; }
.message-media + .message-body { margin-top: 0; }
.camera-compose { display: grid; gap: 8px; padding: 0 20px 17px; background: #fff; }
.camera-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.camera-actions .muted { margin: 0; font-size: 10px; }
.camera-actions .button { padding: 7px 13px; font-size: 12px; }
.camera-actions .button[disabled] { opacity: 0.55; cursor: default; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.message-search-form { display: flex; width: min(560px, 100%); gap: 9px; margin: 0 0 20px; }
.conversation-search-form { margin: 0; }
.presence-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #a5afbe; vertical-align: middle; }
.presence-dot-online { background: #2ca36a; box-shadow: 0 0 0 3px #e3f5eb; }
.peer-presence { color: var(--muted); }
.typing-indicator { margin: 0; padding: 8px 20px 0; color: var(--blue-dark); font-size: 11px; }
.message-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 3px; }
.message-reply-context { margin: 0 0 8px; padding: 7px 9px; border-left: 3px solid #8aa9db; border-radius: 3px 7px 7px 3px; background: rgba(255, 255, 255, 0.72); }
.message-reply-context strong, .message-reply-context p { display: block; margin: 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.message-forwarded-label { margin: 0 0 5px; color: var(--muted); font-size: 10px; font-style: italic; }
.reply-compose-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; border-left: 3px solid var(--blue); background: #f5f8fd; color: var(--muted); font-size: 11px; }
.forward-dialog { width: min(420px, calc(100% - 30px)); padding: 24px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); box-shadow: 0 24px 70px rgba(18, 35, 59, .2); }
.forward-dialog::backdrop { background: rgba(14, 26, 43, .42); }
.forward-dialog-form { display: grid; gap: 14px; }
.forward-dialog-form h2 { margin: 0; font-size: 20px; }
.forward-dialog-form label { color: var(--muted); font-size: 12px; }
.search-results { display: grid; gap: 16px; }
.search-results > .muted { margin: 0; }
.search-result { padding: 15px 0; border-top: 1px solid var(--line); }
.search-result-heading { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.search-result > p { margin: 10px 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.search-result time { white-space: nowrap; }

@media (max-width: 640px) {
    .new-chat-panel { align-items: stretch; flex-direction: column; gap: 16px; padding: 20px; }
    .new-chat-form { width: 100%; }
    .conversation-row { gap: 11px; }
    .chat-avatar { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; }
    .conversation-meta { font-size: 10px; }
    .message-panel-top { align-items: flex-start; flex-direction: column; gap: 5px; }
    .message-scroll { min-height: 250px; max-height: 58vh; padding: 17px 12px; }
    .message-bubble { max-width: 88%; }
    .message-compose { padding: 13px; }
    .compose-actions { align-items: flex-start; flex-direction: column; }
    .compose-actions .button { align-self: flex-end; }
    .conversation-search-form { width: 100%; }
    .search-result-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* ---------- Administration ---------- */

/* Section headings inside a panel sit on the panel's own padding. */
.panel > h2 { margin-bottom: 14px; font-size: 18px; }
.panel > h2 + .muted { margin-top: -8px; }

.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin: 0 0 24px; }
@media (max-width: 1040px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-grid .panel { padding: 18px 20px; }
.stat-grid h2 { margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.stat { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--ink); }

.admin-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; }
.admin-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Action buttons read as a tidy set, not a tall stack of centred text. */
.admin-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 240px)); justify-content: start; gap: 10px; margin-bottom: 16px; }
.admin-actions form { margin: 0; }
.reader-target-list { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; margin: 8px 0 12px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.reader-target-row { display: flex; align-items: center; gap: 9px; padding: 4px 6px; font-size: 13px; }
.reader-target-row input { width: 16px; height: 16px; }

/* Minimal "focus" shell for the single-purpose photo-uploader and media-reader accounts. */
.focus-shell { display: flex; min-height: 100vh; flex-direction: column; background: #f4f7fc; }
.focus-topbar { display: flex; align-items: center; justify-content: space-between; padding: 13px clamp(16px, 5vw, 40px); border-bottom: 1px solid var(--line); background: #fff; }
.focus-brand { font-weight: 820; color: var(--blue-dark); letter-spacing: .3px; }
.focus-main { width: min(660px, 100%); flex: 1; margin: 0 auto; padding: clamp(18px, 5vw, 44px) 16px; }
.focus-flash { font-size: 15px; font-weight: 740; }
.uploader-card { display: grid; gap: 14px; padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: #fff; text-align: center; }
.uploader-form { display: grid; gap: 14px; }
.uploader-pick { display: grid; gap: 10px; justify-items: center; padding: 34px 18px; border: 2px dashed #c7d6ea; border-radius: 14px; color: var(--ink-soft); cursor: pointer; }
.uploader-pick:hover { border-color: var(--blue); background: #f6f9ff; }
.uploader-pick-icon { font-size: 34px; }
.button-block { width: 100%; justify-content: center; }
.reader-page { display: grid; gap: 14px; }
.reader-page .page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-actions .button { width: 100%; justify-content: flex-start; }
.admin-actions .button-danger { border-color: #f0c6ca; color: #8f2e3a; background: var(--danger-pale); }
.admin-actions .button-danger:hover { border-color: #e2a9b0; color: #7a2630; background: #ffe4e7; }

/* Collapsible action with a form inside it. */
.admin-action { margin: 0 0 12px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fcfdff; }
.admin-action summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink); }
.admin-action summary::marker { color: var(--muted); }
.admin-action[open] summary { margin-bottom: 12px; }

/* Forms: one column, comfortable width, full-width controls. */
.admin-form, .admin-action form { display: grid; gap: 14px; max-width: 560px; }
.admin-form label, .admin-action form label { display: grid; gap: 6px; font-size: 13px; font-weight: 650; color: var(--ink); }
.admin-form input[type="text"], .admin-form input[type="email"], .admin-form input[type="password"],
.admin-form input:not([type]), .admin-action form input:not([type="checkbox"]) {
    width: 100%; min-height: 44px; padding: 10px 13px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink);
}
.admin-form input:focus, .admin-action form input:focus, .filter-row input:focus, .filter-row select:focus {
    border-color: var(--blue); outline: 2px solid var(--blue-pale); outline-offset: 0;
}
.admin-form .muted, .admin-action form .muted { margin: -8px 0 0; font-size: 12px; line-height: 1.5; }
.admin-form fieldset, .admin-action form fieldset { display: grid; gap: 8px; margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.admin-form legend, .admin-action form legend { padding: 0 6px; font-size: 12px; font-weight: 720; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.admin-form fieldset label, .admin-action form fieldset label { display: flex; gap: 9px; align-items: center; font-weight: 600; }
.admin-form input[type="checkbox"], .admin-action form input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.admin-form > label:has(input[type="checkbox"]), .admin-action form > label:has(input[type="checkbox"]) { display: flex; gap: 9px; align-items: center; }
.admin-form .button, .admin-action form .button { justify-self: start; }
.admin-form-wide { max-width: 760px; }
.member-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; max-height: 320px; overflow-y: auto; padding: 4px 2px; }
.member-picker label { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border: 1px solid transparent; border-radius: 10px; font-weight: 600; }
.member-picker label:hover { border-color: var(--line); background: #f7f9fd; }
.member-picker input[type="checkbox"] { margin-top: 2px; flex: none; }
.member-picker label > span { display: block; min-width: 0; }
.member-picker label strong { display: block; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.member-picker .muted { display: block; margin-top: 1px; font-size: 12px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
td.row-action { width: 1%; white-space: nowrap; text-align: right; }
td.row-action form { margin: 0; }

/* Administrator conversation thread. */
.admin-message { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid #d7e2f2; border-radius: 12px; background: #fcfdff; }
.admin-message p { margin-bottom: 5px; }
.admin-message > :last-child { margin-bottom: 0; }
.admin-message-reply { margin-bottom: 8px; padding-left: 11px; border-left: 2px solid var(--line); font-size: 13px; color: var(--muted); }

/* Media folders. */
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; margin: 0 0 20px; }
.day-card { display: grid; gap: 5px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfe; color: inherit; text-decoration: none; }
.day-card:hover { border-color: #b9ccea; background: #f4f8ff; }
.day-card-date { font-weight: 600; font-size: 14px; color: var(--ink); }
.day-card-count { font-size: 13px; color: var(--ink-soft); }
.day-card .muted { margin: 0; font-size: 11px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; margin: 0 0 20px; }
.media-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fcfdff; }
.media-card img { display: block; width: 100%; height: 132px; border-radius: 10px; object-fit: cover; }
.media-card .muted { margin: 0; font-size: 12px; line-height: 1.5; }
.media-video { display: flex; height: 132px; align-items: center; justify-content: center; border-radius: 10px; background: var(--blue-pale); color: var(--blue-dark); font-size: 13px; font-weight: 700; }
.media-full { display: block; max-width: 100%; max-height: 68vh; margin-bottom: 14px; border-radius: 14px; }

/* Filters and tables. */
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 0 0 18px; }
.filter-row label { align-self: center; font-size: 13px; font-weight: 650; color: var(--ink-soft); }
.filter-row input, .filter-row select { min-height: 44px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); }

.checkbox-dropdown { position: relative; min-width: 220px; }
.checkbox-dropdown-toggle { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font-size: 13px; text-align: left; cursor: pointer; }
.checkbox-dropdown-toggle:focus { border-color: var(--blue); outline: 2px solid var(--blue-pale); outline-offset: 0; }
.checkbox-dropdown-caret { color: var(--ink-soft); font-size: 10px; }
.checkbox-dropdown-panel { position: absolute; top: calc(100% + 5px); left: 0; z-index: 30; display: flex; width: max(100%, 260px); max-height: 250px; flex-direction: column; gap: 2px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 14px 34px rgba(16, 33, 56, 0.14); }
.checkbox-dropdown-panel[hidden] { display: none; }
.checkbox-dropdown-option { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.checkbox-dropdown-option:hover { background: #f2f6fb; }
.checkbox-dropdown-option input { flex: 0 0 auto; }
.checkbox-dropdown .checkbox-dropdown-error { position: static; margin: 6px 0 0; padding: 0; }
.table-wrap { overflow-x: auto; margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { font-size: 12px; font-weight: 720; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th[scope="row"] { width: 210px; font-size: 13px; font-weight: 650; color: var(--ink-soft); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--blue-pale); color: var(--blue-dark); font-size: 12px; font-weight: 700; }

.event-card { margin: 0 0 12px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fcfdff; box-shadow: none; }
.event-card h2, .event-card h3 { margin: 0 0 4px; font-size: 15px; }
.event-card p { margin-bottom: 4px; }
.event-card > :last-child { margin-bottom: 0; }

@media (max-width: 760px) {
    .panel { padding: 20px 18px; }
    .page-heading { flex-direction: column; align-items: flex-start; gap: 14px; }
    .admin-actions { grid-template-columns: 1fr; }
    .filter-row { flex-direction: column; align-items: stretch; }
    .filter-row .button { width: 100%; }
    tbody th[scope="row"] { width: auto; }
}

/* Canva visual implementation (2026-10-04). */
.admin-app-layout { display: grid; min-height: 100vh; grid-template-columns: 252px minmax(0, 1fr); background: var(--canvas); }
.admin-sidebar { position: sticky; top: 0; display: flex; height: 100vh; min-height: 660px; flex-direction: column; padding: 24px 16px 18px; color: #fff; background: var(--ink); }
.admin-brand { display: flex; align-items: center; gap: 11px; min-height: 52px; padding: 2px 7px 20px; border-bottom: 1px solid rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.admin-brand:hover { color: #fff; }
.admin-brand .brand-mark { flex: 0 0 38px; background: linear-gradient(145deg, #4d8cff, #2864d8); box-shadow: none; }
.admin-brand > span:last-child { display: grid; gap: 2px; min-width: 0; }
.admin-brand strong { color: #fff; font-size: 15px; letter-spacing: -.035em; }
.admin-brand strong span { color: #8fb6ff; }
.admin-brand small { color: #aebdd0; font-size: 9px; font-weight: 750; letter-spacing: .14em; }
.admin-return-link { display: flex; min-width: 0; align-items: center; gap: 10px; margin: 13px 0 0; padding: 9px 10px; border: 1px solid rgba(215,228,247,.16); border-radius: 10px; color: #e0e8f4; background: rgba(255,255,255,.045); text-decoration: none; }
.admin-return-link:hover { border-color: rgba(143,182,255,.35); color: #fff; background: rgba(255,255,255,.09); }
.admin-return-mark { display: grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; border: 1px solid rgba(224,234,248,.2); border-radius: 8px; color: #c7d9f2; font-size: 14px; }
.admin-return-copy { display: grid; min-width: 0; gap: 1px; }
.admin-return-copy strong { color: inherit; font-size: 11px; font-weight: 690; }
.admin-return-copy small { color: #aebdd0; font-size: 9px; }
.admin-nav-heading { margin: 22px 9px 9px; color: #99a9bd; font-size: 10px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.admin-sidebar-nav { display: grid; gap: 4px; }
.admin-nav-link { display: flex; min-height: 43px; align-items: center; gap: 11px; padding: 7px 10px; border: 1px solid transparent; border-radius: 10px; color: #d6deea; font-size: 12px; font-weight: 620; text-decoration: none; transition: background-color 130ms ease, color 130ms ease; }
.admin-nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.admin-nav-link[aria-current="page"] { border-color: rgba(143,182,255,.18); color: #fff; background: rgba(40,100,216,.31); }
.admin-nav-mark { display: grid; width: 25px; height: 25px; flex: 0 0 25px; place-items: center; border: 1px solid rgba(224,234,248,.2); border-radius: 8px; color: #c2d4ef; font-size: 10px; font-weight: 750; }
.admin-nav-link[aria-current="page"] .admin-nav-mark { border-color: rgba(163,194,255,.28); color: #fff; background: rgba(40,100,216,.55); }
.admin-sidebar-note { display: grid; gap: 6px; margin-top: auto; padding: 14px 13px; border: 1px solid rgba(215,228,247,.13); border-radius: 13px; background: rgba(255,255,255,.055); }
.admin-sidebar-note-mark { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 9px; color: #a8e5ca; background: rgba(33,128,92,.24); font-size: 13px; font-weight: 800; }
.admin-sidebar-note strong { color: #fff; font-size: 11px; }
.admin-sidebar-note > span:last-child { color: #afbdd0; font-size: 10px; line-height: 1.5; }
.admin-workspace { display: flex; min-width: 0; min-height: 100vh; flex-direction: column; }
.admin-topbar { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 18px; padding: 12px clamp(20px, 3vw, 44px); border-bottom: 1px solid var(--line); background: #fff; }
.admin-topbar-copy { display: grid; gap: 2px; }
.admin-breadcrumb { color: var(--ink); font-size: 12px; font-weight: 720; }
.admin-breadcrumb span { margin: 0 6px; color: #9ba8b8; }
.admin-topbar-caption { color: var(--muted); font-size: 11px; }
.admin-topbar-account { display: flex; align-items: center; gap: 10px; }
.admin-account-avatar { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 50%; color: var(--blue-dark); background: var(--blue-pale); font-size: 13px; font-weight: 750; }
.admin-account-copy { display: grid; gap: 1px; max-width: 170px; }
.admin-account-copy strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admin-account-copy small { color: var(--muted); font-size: 10px; }
.admin-topbar-account form { margin: 0 0 0 4px; }
.admin-page-shell { width: min(1440px, calc(100% - 64px)); flex: 1; margin: 0 auto; padding: 34px 0 44px; }
.admin-page-shell > .notice { margin-bottom: 20px; }
.admin-footer { width: min(1440px, calc(100% - 64px)); }
.admin-dashboard-heading { align-items: center; margin-bottom: 23px; }
.admin-dashboard-heading h1 { margin-bottom: 5px; font-size: clamp(27px, 3vw, 34px); }
.admin-dashboard-heading .muted { margin: 0; font-size: 13px; }
.admin-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.admin-stat-grid .admin-stat-card { display: flex; min-height: 110px; align-items: center; gap: 15px; padding: 20px; }
.admin-stat-icon { display: grid; width: 41px; height: 41px; flex: 0 0 41px; place-items: center; border-radius: 13px; color: var(--blue); background: var(--blue-pale); font-size: 14px; font-weight: 750; }
.admin-stat-icon-green { color: var(--green); background: var(--green-pale); }
.admin-stat-icon-violet { color: var(--violet); background: var(--violet-pale); }
.admin-stat-icon-red { color: var(--danger); background: var(--danger-pale); }
.admin-stat-icon-blue { color: var(--blue-dark); background: #e5efff; }
.admin-stat-icon-amber { color: #966a15; background: #fff6dc; }
.admin-stat-grid h2 { margin: 0 0 5px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.admin-stat-grid .stat { font-size: 27px; }
.admin-empty-metrics { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.admin-empty-metrics h2 { margin-bottom: 3px; font-size: 15px; }
.admin-empty-metrics p { margin: 0; font-size: 12px; }
.admin-overview-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 15px; }
.admin-overview-card { min-height: 160px; padding: 22px 24px; }
.admin-overview-card h2 { font-size: 16px; }
.admin-overview-card p { max-width: 590px; margin-bottom: 0; font-size: 12px; }
.admin-policy-card { display: flex; align-items: flex-start; gap: 13px; background: linear-gradient(135deg, #fff, #f8fbff); }
.admin-policy-mark { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 10px; color: var(--green); background: var(--green-pale); font-size: 14px; font-weight: 800; }
.admin-policy-card h2 { margin-bottom: 7px; }

.login-page { position: relative; display: grid; min-height: min(740px, calc(100vh - 205px)); place-items: center; overflow: hidden; padding: 25px 16px; }
.login-page::before, .login-page::after { position: absolute; z-index: 0; width: min(40vw, 420px); height: min(45vw, 420px); border-radius: 40px; background: linear-gradient(140deg, rgba(210,228,255,.72), rgba(237,244,255,.15)); content: ""; transform: rotate(35deg); }
.login-page::before { top: -245px; left: -165px; }
.login-page::after { right: -195px; bottom: -260px; background: linear-gradient(140deg, rgba(237,244,255,.2), rgba(197,220,255,.68)); }
.login-card-wrap { position: relative; z-index: 1; width: min(100%, 454px); }
.login-brand-lockup { display: flex; align-items: center; justify-content: center; gap: 13px; margin: 0 auto 24px; text-align: left; }
.login-brand-mark { position: relative; display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 16px 16px 16px 5px; background: linear-gradient(145deg, #397dec, #2455be); box-shadow: 0 8px 22px rgba(40,100,216,.22); }
.login-brand-mark span { position: relative; z-index: 1; width: 4px; height: 4px; margin: 0 1px; border-radius: 50%; background: #fff; }
.login-brand-mark i { position: absolute; right: 4px; bottom: 3px; width: 17px; height: 14px; border: 2px solid #fff; border-radius: 7px 7px 7px 3px; background: #2864d8; }
.login-brand-name { margin: 0; color: var(--ink); font-size: 22px; font-weight: 780; letter-spacing: -.055em; }
.login-brand-tagline { margin: 2px 0 0; color: var(--ink-soft); font-size: 12px; }
.panel.login-panel { padding: 30px; border-color: rgba(224,232,242,.9); box-shadow: 0 18px 55px rgba(28,57,97,.1); }
.login-panel .panel-heading { margin-bottom: 22px; }
.login-panel .panel-heading h1 { margin-bottom: 7px; font-size: 26px; }
.login-panel .panel-heading .muted { margin-bottom: 0; font-size: 12px; }
.login-panel .form-stack { gap: 17px; }
.input-with-icon, .password-input-wrap { position: relative; display: flex; min-height: 46px; align-items: center; border: 1px solid #d9e1eb; border-radius: 10px; background: #fff; }
.input-with-icon:focus-within, .password-input-wrap:focus-within { border-color: #719ae5; outline: 3px solid rgba(40,100,216,.11); }
.input-with-icon > span, .input-leading-icon { display: grid; width: 42px; flex: 0 0 42px; place-items: center; color: #8394a9; font-size: 15px; font-weight: 700; }
.input-leading-icon { font-size: 10px; }
.input-with-icon input, .password-input-wrap input { width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px 9px 0; border: 0; outline: 0; color: var(--ink); background: transparent; font: inherit; font-size: 13px; }
.input-with-icon input:focus, .password-input-wrap input:focus { outline: 0; }
.password-toggle { align-self: stretch; padding: 0 12px; border: 0; color: var(--blue-dark); background: transparent; font-size: 11px; font-weight: 700; }
.password-toggle:hover { color: var(--blue); }
.login-submit { margin-top: 2px; border-radius: 10px; }
.login-help { align-items: center; margin-top: 21px; padding-top: 17px; }
.login-help p { color: var(--ink-soft); }
.login-access-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 16px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.login-access-note span { color: var(--green); font-weight: 800; }

.admin-managed-notice { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 17px; padding: 15px 17px; border: 1px solid #cfe6d9; border-radius: 13px; background: #f6fcf8; }
.admin-managed-notice strong { color: #1a5f41; font-size: 12px; }
.admin-managed-notice p { margin: 3px 0 0; color: var(--ink-soft); font-size: 11px; }
.admin-user-filters { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto minmax(140px, 180px) auto; align-items: center; gap: 10px; }
.admin-user-filters label { color: var(--ink-soft); font-size: 11px; }
.admin-user-filters input, .admin-user-filters select { min-width: 0; font-size: 12px; }
.admin-user-filters .button { min-height: 42px; }
.admin-table-panel { padding: 22px 24px; }
.admin-users-table-wrap { margin-top: 2px; }
.admin-users-table { min-width: 640px; }
.admin-users-table th, .admin-users-table td { padding: 12px 10px; }
.admin-users-table thead th { color: #7d8ca0; font-size: 10px; }
.admin-users-table tbody td { color: var(--ink-soft); font-size: 12px; }
.admin-user-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; color: #2857b7; background: #e6efff; font-size: 11px; font-weight: 750; }
.admin-users-table tbody tr:nth-child(3n + 2) .user-avatar { color: #21805c; background: #eaf7f1; }
.admin-users-table tbody tr:nth-child(3n) .user-avatar { color: #a36719; background: #fff3de; }
.admin-username { color: #687b91; }
.badge-status-active { color: #176340; background: var(--green-pale); }
.badge-status-disabled, .badge-status-blocked { color: #8f2e3a; background: var(--danger-pale); }
.admin-pagination { padding-top: 4px; }
.admin-table-note { margin: 10px 0 0; font-size: 11px; }
.admin-list-empty { display: grid; min-height: 175px; align-content: center; justify-items: center; padding: 24px; text-align: center; }
.admin-empty-mark { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 10px; border-radius: 13px; color: var(--blue); background: var(--blue-pale); font-weight: 750; }
.admin-list-empty h2 { margin-bottom: 4px; font-size: 15px; }
.admin-list-empty p { margin: 0; font-size: 12px; }

.conversation-review-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(235px, .65fr); align-items: start; gap: 16px; }
.conversation-transcript { min-width: 0; padding: 19px; }
.conversation-review-banner { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; padding: 12px 13px; border: 1px solid #dbe7f5; border-radius: 11px; background: #f6f9ff; }
.conversation-review-icon { display: grid; width: 23px; height: 23px; flex: 0 0 23px; place-items: center; border-radius: 50%; color: var(--blue-dark); background: #e5efff; font-size: 12px; font-weight: 800; }
.conversation-review-banner div { display: grid; gap: 2px; }
.conversation-review-banner strong { color: var(--ink); font-size: 11px; }
.conversation-review-banner div span { color: var(--muted); font-size: 10px; }
.conversation-older-link { margin: 0 0 14px; text-align: center; }
.conversation-older-link .text-link { font-size: 11px; }
.conversation-transcript-list { min-width: 0; }
.admin-message { padding: 13px 15px; }
.admin-message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; font-size: 10px; }
.admin-message-meta strong { color: var(--ink); font-size: 11px; }
.admin-message-body { overflow-wrap: anywhere; white-space: pre-wrap; color: var(--ink); font-size: 13px; }
.forwarded-badge { padding: 2px 7px; border-radius: 999px; color: var(--blue-dark); background: var(--blue-pale); font-size: 9px; font-weight: 700; }
.admin-media-metadata { display: inline-block; padding: 5px 8px; border-radius: 7px; background: #f2f5f9; font-size: 10px; }
.conversation-review-sidebar { position: sticky; top: 18px; padding: 20px; }
.conversation-review-sidebar h2 { overflow-wrap: anywhere; font-size: 16px; }
.conversation-detail-list { margin: 16px 0; }
.conversation-detail-list div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.conversation-detail-list dt { color: var(--muted); font-size: 10px; }
.conversation-detail-list dd { margin: 0; color: var(--ink); font-size: 11px; font-weight: 700; text-align: right; }
.conversation-review-policy { display: flex; align-items: flex-start; gap: 9px; padding-top: 13px; border-top: 1px solid var(--line); }
.conversation-review-policy .admin-policy-mark { width: 25px; height: 25px; flex-basis: 25px; border-radius: 8px; font-size: 11px; }
.conversation-review-policy p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

@media (max-width: 1040px) {
    .admin-app-layout { grid-template-columns: 220px minmax(0, 1fr); }
    .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-user-filters { grid-template-columns: auto minmax(140px, 1fr) auto minmax(125px, 160px); }
    .admin-user-filters .button { grid-column: 4; }
}
@media (max-width: 780px) {
    .admin-app-layout { display: block; }
    .admin-sidebar { position: static; height: auto; min-height: 0; padding: 14px 16px 13px; }
    .admin-brand { min-height: 42px; padding: 0 3px 12px; }
    .admin-brand .brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
    .admin-return-link { width: fit-content; margin-top: 10px; padding: 7px 9px; }
    .admin-nav-heading { margin: 13px 3px 7px; }
    .admin-sidebar-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
    .admin-nav-link { min-height: 38px; gap: 8px; padding: 5px 7px; font-size: 11px; }
    .admin-nav-mark { width: 23px; height: 23px; flex-basis: 23px; }
    .admin-sidebar-note { display: none; }
    .admin-topbar { min-height: 60px; padding: 10px 16px; }
    .admin-topbar-caption { display: none; }
    .admin-account-copy { display: none; }
    .admin-page-shell { width: calc(100% - 32px); padding: 25px 0 35px; }
    .admin-footer { width: calc(100% - 32px); }
    .admin-overview-grid { grid-template-columns: 1fr; }
    .conversation-review-grid { grid-template-columns: 1fr; }
    .conversation-review-sidebar { position: static; }
}
@media (max-width: 560px) {
    .admin-topbar-account { gap: 7px; }
    .admin-topbar-account .button { min-height: 34px; padding: 7px 9px; }
    .admin-page-shell { width: calc(100% - 24px); }
    .admin-footer { width: calc(100% - 24px); flex-direction: column; gap: 4px; }
    .admin-stat-grid { grid-template-columns: 1fr; }
    .admin-stat-grid .admin-stat-card { min-height: 88px; }
    .admin-user-filters { grid-template-columns: 1fr; align-items: stretch; }
    .admin-user-filters label { margin: 4px 0 -6px; }
    .admin-user-filters .button { grid-column: 1; }
    .admin-table-panel { padding: 16px 14px; }
    .login-page { min-height: 590px; padding: 18px 0; }
    .login-page::before { top: -220px; left: -245px; }
    .login-page::after { right: -260px; bottom: -230px; }
    .login-brand-lockup { margin-bottom: 18px; }
    .panel.login-panel { padding: 23px 19px; }
}

/* Member workspace shell. This gives the signed-in web client its own compact navigation while preserving each page's existing forms and actions. */
.member-app-layout { display: grid; min-height: 100vh; grid-template-columns: 248px minmax(0, 1fr); background: var(--canvas); }
.member-sidebar { position: sticky; top: 0; display: flex; height: 100vh; min-height: 620px; flex-direction: column; padding: 23px 16px 17px; border-right: 1px solid var(--line); background: #fff; }
.member-brand { display: flex; min-height: 55px; align-items: center; gap: 10px; padding: 0 6px 17px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.member-brand:hover { color: var(--ink); }
.member-brand .brand-mark { flex: 0 0 36px; }
.member-brand-name { display: grid; gap: 1px; color: var(--ink); font-size: 16px; font-weight: 780; letter-spacing: -.045em; line-height: 1.2; }
.member-brand-name > span { display: inline; color: var(--blue); }
.member-brand-name small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .13em; }
.member-nav-heading { margin: 22px 9px 9px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.member-sidebar-nav { display: grid; gap: 5px; }
.member-nav-link { display: flex; min-height: 44px; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid transparent; border-radius: 10px; color: var(--ink-soft); font-size: 12px; font-weight: 640; text-decoration: none; transition: background-color 130ms ease, color 130ms ease; }
.member-nav-link:hover { color: var(--blue-dark); background: #f6f9ff; }
.member-nav-link[aria-current="page"] { border-color: #dce8fb; color: var(--blue-dark); background: var(--blue-pale); }
.member-nav-mark { display: grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; border: 1px solid #e4eaf1; border-radius: 8px; color: #71839a; background: #fff; font-size: 10px; font-weight: 760; }
.member-nav-link[aria-current="page"] .member-nav-mark { border-color: #d3e1fa; color: var(--blue); background: #fff; }
.member-sidebar-account { display: flex; min-width: 0; align-items: center; gap: 10px; margin-top: auto; padding: 12px 9px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
a.member-sidebar-account:hover { color: var(--blue-dark); }
.member-sidebar-avatar { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border: 2px solid #e5efff; border-radius: 50%; color: var(--blue-dark); background: #edf4ff; font-size: 13px; font-weight: 750; }
.member-sidebar-account-copy { display: grid; min-width: 0; flex: 1; gap: 1px; }
.member-sidebar-account-copy strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.member-sidebar-account-copy small { color: var(--muted); font-size: 10px; }
.member-sidebar-account-arrow { color: var(--muted); font-size: 13px; }
.member-workspace { display: flex; min-width: 0; min-height: 100vh; flex-direction: column; }
.member-topbar { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 18px; padding: 11px clamp(20px, 3vw, 42px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); }
.member-topbar-copy { display: grid; gap: 2px; }
.member-topbar-kicker { color: var(--ink); font-size: 11px; font-weight: 730; letter-spacing: .06em; }
.member-topbar-caption { color: var(--muted); font-size: 11px; }
.member-topbar form { margin: 0; }
.member-page-shell { width: min(1180px, calc(100% - 64px)); flex: 1; margin: 0 auto; padding: 34px 0 43px; }
.member-page-shell > .notice { margin-bottom: 20px; }
.member-footer { width: min(1180px, calc(100% - 64px)); }

@media (max-width: 780px) {
    .member-app-layout { display: block; }
    .member-sidebar { position: static; height: auto; min-height: 0; padding: 13px 16px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
    .member-brand { min-height: 43px; padding: 0 2px 11px; }
    .member-brand .brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
    .member-brand-name { font-size: 15px; }
    .member-brand-name small { font-size: 8px; }
    .member-nav-heading { margin: 12px 2px 6px; }
    .member-sidebar-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
    .member-nav-link { min-height: 38px; gap: 7px; padding: 5px 7px; font-size: 11px; }
    .member-nav-mark { width: 23px; height: 23px; flex-basis: 23px; }
    .member-sidebar-account { display: none; }
    .member-topbar { min-height: 58px; padding: 9px 16px; }
    .member-topbar-caption { display: none; }
    .member-page-shell { width: calc(100% - 36px); padding: 26px 0 34px; }
    .member-footer { width: calc(100% - 36px); }
}

@media (max-width: 560px) {
    .member-topbar { padding: 8px 12px; }
    .member-topbar-kicker { font-size: 10px; }
    .member-topbar .button { min-height: 34px; padding: 7px 9px; }
    .member-page-shell { width: calc(100% - 24px); }
    .member-footer { width: calc(100% - 24px); flex-direction: column; gap: 4px; }
    .member-sidebar { padding-right: 12px; padding-left: 12px; }
}

/* The browser chat follows the Android conversation screen: dark peer header,
   compact message timeline, and a composer anchored to the bottom of the panel. */
.conversation-page-chat { width: min(1100px, 100%); }
.conversation-page-chat .conversation-page-heading { gap: 12px; margin-bottom: 16px; }
.conversation-chat-header {
    display: flex;
    min-height: 102px;
    align-items: center;
    gap: 20px;
    padding: 15px 21px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 17px;
    color: #fff;
    background: var(--ink);
    box-shadow: 0 10px 24px rgba(20, 38, 61, .12);
}
.conversation-back-link {
    display: inline-flex;
    min-height: 42px;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    padding-right: 17px;
    border-right: 1px solid rgba(255, 255, 255, .15);
    color: #d9e6ff;
    font-size: 13px;
    font-weight: 700;
}
.conversation-back-link:hover { color: #fff; }
.conversation-back-link span:first-child { font-size: 27px; line-height: 1; }
.conversation-page-chat .conversation-person { min-width: 0; gap: 13px; }
.conversation-page-chat .conversation-person .chat-avatar {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    border: 2px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    color: #fff;
    background: var(--blue);
}
.conversation-person-copy { min-width: 0; }
.conversation-page-chat .conversation-person .eyebrow { margin-bottom: 2px; color: #a9c5ff; font-size: 9px; }
.conversation-page-chat .conversation-person h1 { margin: 0; overflow: hidden; color: #fff; font-size: 21px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-username, .conversation-page-chat .conversation-person .peer-presence { margin: 2px 0 0; color: #c4d0df; font-size: 11px; }
.conversation-search-form { width: min(560px, 100%); }
.conversation-search-form .text-input { min-height: 43px; border-radius: 12px; }
.conversation-search-form .button { min-height: 43px; }
.conversation-page-chat .message-panel {
    display: flex;
    height: min(690px, max(430px, calc(100vh - 370px)));
    height: min(690px, max(430px, calc(100dvh - 370px)));
    min-height: 430px;
    flex-direction: column;
    border-radius: 17px;
}
.conversation-page-chat .message-panel-top { min-height: 48px; padding: 10px 17px; background: #fff; }
.conversation-page-chat .chat-error-banner { flex: 0 0 auto; margin: 0; padding: 9px 17px; border-top: 1px solid var(--line); color: var(--danger); background: var(--danger-pale); font-size: 12px; }
.conversation-page-chat .typing-indicator { flex: 0 0 auto; padding: 7px 17px 0; }
.conversation-page-chat .message-scroll {
    display: flex;
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 17px clamp(14px, 3vw, 27px);
    background: var(--canvas);
    scroll-behavior: smooth;
}
.conversation-page-chat .message-row { flex: 0 0 auto; }
.conversation-page-chat .message-bubble { max-width: min(78%, 620px); border-radius: 17px 17px 17px 5px; box-shadow: 0 2px 7px rgba(20, 38, 61, .045); }
.conversation-page-chat .message-bubble-own { border-color: var(--blue); border-radius: 17px 17px 5px 17px; color: #fff; background: var(--blue); }
.conversation-page-chat .message-bubble-own .message-foot,
.conversation-page-chat .message-bubble-own .message-status { color: rgba(255, 255, 255, .78); }
.conversation-page-chat .message-bubble-own .message-forwarded-label { color: rgba(255, 255, 255, .78); }
.conversation-page-chat .message-bubble-own .message-actions .text-button,
.conversation-page-chat .message-bubble-own .message-delete-form .text-button { color: rgba(255, 255, 255, .82); }
.conversation-page-chat .message-bubble-own .message-actions .text-button:hover,
.conversation-page-chat .message-bubble-own .message-delete-form .text-button:hover { color: #fff; }
.conversation-page-chat .message-bubble-deleted { border-color: var(--line); color: var(--muted); background: #edf1f6; }
.conversation-page-chat .message-empty { min-height: 0; flex: 1 0 230px; }
.conversation-page-chat .chat-live-status { min-height: 33px; padding: 7px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.conversation-composer { display: flex; flex: 0 0 auto; align-items: flex-end; gap: 10px; padding: 11px 14px; background: #fff; }
.conversation-composer .camera-compose { order: 0; flex: 0 0 auto; padding: 0; background: transparent; }
.conversation-composer .camera-actions { gap: 6px; }
.conversation-composer .camera-actions .button { min-height: 42px; padding: 7px 10px; border-radius: 12px; }
.conversation-composer .camera-actions .muted { display: none; }
.conversation-composer .message-compose {
    display: grid;
    min-width: 0;
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 7px;
    order: 1;
    padding: 0;
    border: 0;
    background: transparent;
}
.conversation-composer .reply-compose-preview { grid-column: 1 / -1; grid-row: 1; }
.conversation-composer .message-compose textarea { grid-column: 1; grid-row: 2; min-height: 44px; height: 44px; resize: none; padding: 10px 12px; border-radius: 13px; font-size: 14px; }
.conversation-composer .message-compose .compose-actions { display: contents; }
.conversation-composer .message-compose .compose-actions .muted { display: none; }
.conversation-composer .message-compose .compose-actions .button { grid-column: 2; grid-row: 2; min-height: 44px; border-radius: 13px; }
.conversation-composer-media-only { justify-content: flex-start; }
.conversation-composer-media-only .camera-compose { width: 100%; }
.conversation-composer-media-only .camera-actions { align-items: center; }

@media (max-width: 640px) {
    .conversation-chat-header { min-height: 88px; gap: 12px; padding: 12px; border-radius: 14px; }
    .conversation-back-link { gap: 3px; padding-right: 10px; font-size: 12px; }
    .conversation-back-link span:first-child { font-size: 24px; }
    .conversation-page-chat .conversation-person { gap: 9px; }
    .conversation-page-chat .conversation-person .chat-avatar { width: 42px; height: 42px; flex-basis: 42px; }
    .conversation-page-chat .conversation-person h1 { font-size: 17px; }
    .conversation-page-chat .conversation-person .eyebrow { font-size: 8px; }
    .conversation-page-chat .message-panel { height: min(680px, max(390px, calc(100dvh - 365px))); min-height: 390px; }
    .conversation-page-chat .message-panel-top { align-items: center; flex-direction: row; padding: 9px 12px; }
    .conversation-page-chat .message-panel-top > .muted { font-size: 10px; }
    .conversation-page-chat .message-scroll { padding: 13px 11px; }
    .conversation-page-chat .message-bubble { max-width: 88%; padding: 10px 12px 8px; }
    .conversation-composer { align-items: stretch; flex-direction: column; gap: 8px; padding: 9px 10px 11px; }
    .conversation-composer .camera-compose { width: 100%; }
    .conversation-composer .camera-actions { flex-wrap: nowrap; }
    .conversation-composer .camera-actions .button { min-height: 38px; padding: 6px 9px; font-size: 11px; }
    .conversation-composer .camera-actions .muted { display: inline; margin-left: auto; font-size: 9px; text-align: right; }
    .conversation-composer .message-compose textarea { min-height: 42px; height: 42px; font-size: 13px; }
    .conversation-composer .message-compose .compose-actions .button { min-height: 42px; padding: 9px 12px; }
}

@media (max-width: 380px) {
    .conversation-chat-header { gap: 8px; padding: 10px; }
    .conversation-back-link { padding-right: 7px; font-size: 11px; }
    .conversation-page-chat .conversation-person h1 { font-size: 15px; }
    .conversation-composer .camera-actions .muted { display: none; }
}

/* Web Push "Enable notifications" control in the app topbars. */
.webpush-slot { display: inline-flex; align-items: center; }
.webpush-slot:empty { display: none; }
