:root {
    --surface: #ffffff;
    --surface-alt: #f4f7f6;
    --ink: #17211f;
    --muted: #687370;
    --line: #dbe4e1;
    --accent: #0f766e;
    --accent-strong: #0b5f59;
    --blue: #2563eb;
    --amber: #b45309;
    --red: #be123c;
    --nav-height: 76px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    background: var(--surface-alt);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
}

.app-brand__mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: white;
    background: var(--accent);
    border-radius: 8px;
    font-size: .8rem;
}

.app-topbar__login {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--accent);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    font-size: 1.3rem;
}

.app-topbar__actions,
.top-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.top-action {
    position: relative;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--accent);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    font-size: 1.15rem;
}

.action-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    display: grid;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    place-items: center;
    color: white;
    background: var(--red);
    border: 2px solid white;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 900;
}

.action-badge.static {
    position: static;
    border: 0;
}

.action-badge[hidden] {
    display: none;
}

.current-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    max-width: 170px;
    height: 42px;
    padding: 5px 9px 5px 5px;
    color: var(--ink);
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.current-user-chip span {
    display: grid;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    place-items: center;
    color: white;
    background: var(--accent);
    border-radius: 7px;
    font-size: .72rem;
    font-weight: 900;
}

.current-user-chip strong {
    min-width: 0;
    overflow: hidden;
    font-size: .82rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logged-user-name {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 700;
}

.app-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 14px 14px calc(var(--nav-height) + 18px);
}

.hero-panel,
.section-block,
.auth-card,
.operator-card,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.operator-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 14px;
    align-items: center;
    padding: 16px;
}

.operator-card__avatar {
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    color: var(--accent);
    background: #e8f4f2;
    border: 1px solid #b6dcd6;
    border-radius: 8px;
    font-size: 2rem;
}

.operator-card p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.hero-panel {
    display: grid;
    gap: 18px;
    padding: 18px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: 1.7rem;
    line-height: 1.08;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 0;
    font-size: 1.04rem;
    letter-spacing: 0;
}

.hero-panel__text,
.section-heading span,
.module-card span,
.feature-card span,
.auth-card p,
.empty-state p {
    color: var(--muted);
}

.primary-action,
.auth-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 16px;
    color: white;
    background: var(--accent);
    border: 0;
    border-radius: 8px;
    font-weight: 800;
}

.section-block {
    margin-top: 12px;
    padding: 14px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-heading span {
    white-space: nowrap;
    font-size: .82rem;
}

.module-grid,
.feature-grid {
    display: grid;
    gap: 10px;
}

.module-card,
.feature-card {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 2px 12px;
    min-height: 88px;
    padding: 12px;
    background: #fbfcfc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.module-card i,
.feature-card i {
    grid-row: span 2;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: white;
    border-radius: 8px;
    font-size: 1.15rem;
}

.module-card strong,
.feature-card strong {
    align-self: end;
}

.module-card span,
.feature-card span {
    font-size: .9rem;
    line-height: 1.25;
}

.module-card--employee i {
    background: var(--blue);
}

.module-card--terminal i {
    background: var(--accent);
}

.module-card--work i {
    background: var(--amber);
}

.task-list {
    display: grid;
    gap: 10px;
}

.task-list div {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--muted);
}

.task-list i {
    color: var(--accent);
}

.operator-details {
    display: grid;
    gap: 10px;
    margin: 0;
}

.operator-details div {
    display: grid;
    gap: 2px;
    padding: 10px;
    background: #fbfcfc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.operator-details dt {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.operator-details dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.role-list span {
    padding: 7px 10px;
    color: var(--accent-strong);
    background: #e8f4f2;
    border: 1px solid #b6dcd6;
    border-radius: 8px;
    font-size: .86rem;
    font-weight: 800;
}

.empty-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--muted);
}

.account-manager,
.account-subforms {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.account-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: #f8faf9;
    border-bottom: 1px solid var(--line);
    border-radius: 8px 8px 0 0;
}

.account-toolbar h1 {
    margin-bottom: 0;
    font-size: 1.05rem;
    letter-spacing: 0;
}

.record-state {
    padding: 6px 9px;
    color: var(--accent-strong);
    background: #e8f4f2;
    border: 1px solid #b6dcd6;
    border-radius: 8px;
    white-space: nowrap;
    font-size: .78rem;
    font-weight: 800;
}

.account-form-grid {
    display: grid;
    gap: 12px;
    padding: 12px;
}

.account-form-panel,
.account-badge-panel {
    display: grid;
    gap: 12px;
}

.account-form-panel h2,
.account-badge-panel h2 {
    margin: 8px 0 0;
    padding-bottom: 6px;
    color: var(--accent);
    border-bottom: 1px solid var(--line);
    font-size: .9rem;
    font-weight: 900;
}

.field-grid {
    display: grid;
    gap: 8px;
}

.form-field {
    display: grid;
    gap: 4px;
    min-height: 58px;
    padding: 9px 10px;
    background: #fbfcfc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.form-field span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.form-field strong {
    align-self: end;
    overflow-wrap: anywhere;
    font-size: .96rem;
}

.account-badge-panel {
    align-content: start;
    padding: 12px;
    background: #fbfcfc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.operator-badge {
    display: grid;
    justify-items: center;
    gap: 5px;
    padding: 14px;
    text-align: center;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.operator-badge__photo {
    display: grid;
    width: 88px;
    height: 88px;
    place-items: center;
    color: white;
    background: var(--accent);
    border-radius: 8px;
    font-size: 1.9rem;
    font-weight: 900;
}

.operator-badge span,
.operator-badge small {
    color: var(--muted);
}

.badge-meta {
    display: grid;
    gap: 8px;
    margin: 0;
}

.badge-meta div {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.badge-meta dt {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-meta dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.account-subforms {
    margin-top: 12px;
    padding: 14px;
}

.subform-grid {
    display: grid;
    gap: 10px;
}

.subform-button {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 2px 12px;
    min-height: 74px;
    padding: 12px;
    color: white;
    background: var(--accent);
    border-radius: 8px;
}

.subform-button i {
    grid-row: span 2;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    background: rgba(255, 255, 255, .16);
    border-radius: 8px;
    font-size: 1.2rem;
}

.subform-button strong {
    align-self: end;
    font-size: .92rem;
}

.subform-button span {
    color: rgba(255, 255, 255, .82);
    font-size: .83rem;
    line-height: 1.25;
}

.embedded-subforms {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.embedded-subform {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: #fbfcfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    scroll-margin-top: 74px;
}

.embedded-subform h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    letter-spacing: 0;
}

.embedded-subform p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.legacy-path {
    display: grid;
    gap: 4px;
    padding: 10px;
    background: white;
    border: 1px dashed #b6dcd6;
    border-radius: 8px;
}

.legacy-path span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.legacy-path a {
    color: var(--accent-strong);
    overflow-wrap: anywhere;
    font-size: .78rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.list-header h1 {
    margin-bottom: 4px;
    font-size: 1.25rem;
}

.list-header p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.filter-pill {
    display: grid;
    min-height: 42px;
    place-items: center;
    color: var(--accent-strong);
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 900;
}

.filter-pill.active {
    color: white;
    background: var(--accent);
    border-color: var(--accent);
}

.status-message {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
    padding: 12px;
    color: #166534;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(22, 101, 52, .12);
    font-weight: 800;
}

.status-message i {
    font-size: 1.25rem;
}

.request-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.request-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .04);
}

.request-card__main {
    display: grid;
    gap: 3px;
}

.request-card__main span,
.request-card__main small {
    color: var(--muted);
}

.request-status {
    display: grid;
    gap: 2px;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 900;
}

.request-status small {
    font-weight: 700;
}

.request-status--approved {
    color: #166534;
    background: #dcfce7;
}

.request-status--denied {
    color: #9f1239;
    background: #ffe4e6;
}

.request-status--pending {
    color: #854d0e;
    background: #fef3c7;
}

.leave-form {
    display: grid;
    gap: 12px;
    padding: 12px;
}

.form-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid;
    border-radius: 8px;
    font-weight: 800;
    line-height: 1.35;
}

.form-banner i {
    flex: 0 0 auto;
    font-size: 1.1rem;
}

.form-banner--success {
    color: #14532d;
    background: #dcfce7;
    border-color: #86efac;
}

.form-banner--error {
    color: #9f1239;
    background: #ffe4e6;
    border-color: #fda4af;
}

.client-validation-summary {
    scroll-margin-top: 72px;
}

.client-validation-summary ul {
    padding-left: 18px;
    margin: 6px 0 0;
}

.field-required > span:first-child::after,
.field-required .field-label::after {
    content: " *";
    color: var(--red);
    font-weight: 900;
}

.field-required {
    border-color: #9accc5;
}

.field-invalid {
    border-color: #f43f5e !important;
    background: #fff1f2 !important;
}

.field-invalid input,
.field-invalid select,
.field-invalid textarea {
    color: #881337;
}

.field-error-text {
    display: block;
    margin-top: 5px;
    color: #9f1239;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.25;
}

.leave-form input,
.leave-form select,
.leave-form textarea {
    width: 100%;
    min-height: 34px;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: 0;
    font: inherit;
    font-weight: 700;
}

.leave-form textarea {
    min-height: 92px;
    resize: vertical;
}

.leave-form input[readonly],
.leave-form textarea[readonly],
.leave-form select:disabled {
    color: var(--muted);
}

.switch-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #fbfcfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 800;
}

.switch-line input {
    width: 22px;
    min-height: 22px;
}

.inline-switches {
    display: grid;
    gap: 8px;
}

.partial-day-panel,
.full-day-panel {
    display: grid;
    gap: 10px;
}

.form-help {
    color: var(--muted);
}

.attachments-control {
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.attachments-control__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.attachments-control__header h2 {
    margin: 0;
}

.attachments-control__header span {
    display: inline-grid;
    min-width: 28px;
    height: 28px;
    place-items: center;
    color: var(--accent-strong);
    background: #e8f4f2;
    border: 1px solid #b6dcd6;
    border-radius: 999px;
    font-weight: 900;
}

.file-drop {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 12px;
    color: var(--accent-strong);
    background: #fbfcfc;
    border: 1px dashed #9accc5;
    border-radius: 8px;
    font-weight: 900;
}

.file-drop input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.attachments-empty {
    padding: 10px 12px;
    color: var(--muted);
    background: #fbfcfc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.attachment-list {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.attachment-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 10px;
    color: var(--ink);
    background: #fbfcfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.notification-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.notification-summary div,
.notification-card,
.chat-card,
.message-bubble {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .04);
}

.notification-summary div {
    display: grid;
    gap: 2px;
    padding: 12px;
    text-align: center;
}

.notification-summary strong {
    color: var(--accent-strong);
    font-size: 1.35rem;
}

.notification-summary span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
}

.notification-list,
.chat-list,
.message-list {
    display: grid;
    gap: 10px;
}

.notification-card,
.chat-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
}

.chat-card {
    align-items: center;
    min-height: 74px;
}

.chat-card__main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.notification-card span,
.chat-card span,
.chat-card small {
    display: block;
    color: var(--muted);
}

.chat-card__title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.chat-card__title i {
    color: var(--accent);
    font-size: .95rem;
}

.chat-card__title span {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-card.is-unread {
    border-color: #9accc5;
    background: #f0fdfa;
}

.notification-card--denied {
    border-left: 5px solid var(--red);
}

.notification-card--approved {
    border-left: 5px solid #16a34a;
}

.full-action {
    width: 100%;
    border: 0;
}

.chat-card__meta {
    display: flex;
    flex: 0 0 72px;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 7px;
    min-width: 72px;
}

.chat-card__time {
    color: var(--muted);
    font-size: .76rem;
    line-height: 1;
    white-space: nowrap;
}

.chat-card__unread {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    place-items: center;
    color: white;
    background: var(--red);
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 900;
    line-height: 1;
}

.chat-card__unread[hidden] {
    display: none;
}

.global-chat-toast {
    position: fixed;
    right: 14px;
    bottom: calc(var(--nav-height) + 12px);
    left: 14px;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 520px;
    margin: 0 auto;
    padding: 10px 12px;
    color: white;
    background: #0b5f59;
    border-radius: 8px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .22);
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.global-chat-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.global-chat-toast a,
.global-chat-toast button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    color: white;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
    font-size: .8rem;
    font-weight: 900;
}

.global-chat-toast a {
    padding: 0 12px;
}

.global-chat-toast button {
    width: 34px;
}

.global-chat-toast span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-thread-header {
    display: grid;
    gap: 10px;
}

.chat-thread-main {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.chat-thread-title {
    min-width: 0;
}

.chat-thread-title h1 {
    margin: 0;
    overflow-wrap: anywhere;
}

.chat-thread-actions {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.chat-call-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.chat-group-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.chat-group-actions form {
    display: flex;
}

.chat-group-actions .secondary-action {
    min-height: 40px;
    padding: 0 10px;
    font-size: .86rem;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .chat-thread-actions .chat-group-actions .secondary-action {
        width: 40px;
        padding: 0;
        font-size: 0;
    }

    .chat-thread-actions .chat-group-actions .secondary-action i {
        font-size: 1rem;
    }
}

.secondary-action--danger {
    color: var(--red);
    background: #fff1f2;
    border-color: #fecdd3;
}

.group-subject-form {
    display: grid;
    gap: 8px;
}

.group-edit-modal[hidden] {
    display: none;
}

.group-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    align-items: end;
    padding: 14px;
}

.group-edit-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(3px);
}

.group-edit-dialog {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    width: min(100%, 560px);
    max-height: min(82vh, 760px);
    margin: 0 auto calc(var(--nav-height) + 8px);
    padding: 14px;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 56px rgba(15, 23, 42, .22);
}

.group-edit-dialog__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.group-edit-dialog__header h2 {
    margin: 0;
    font-size: 1.18rem;
}

.icon-soft-action {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: var(--accent-strong);
    background: #e8f4f2;
    border: 1px solid #b6dcd6;
    border-radius: 8px;
}

body.modal-open {
    overflow: hidden;
}

.group-member-list {
    display: grid;
    gap: 8px;
}

.group-member-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #fbfcfc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.group-member-row span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.group-member-row strong,
.group-member-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-member-row small {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.icon-danger-action {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: var(--red);
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    font-size: 1.05rem;
}

.message-list {
    margin-top: 12px;
    padding-bottom: 92px;
}

.message-bubble {
    position: relative;
    display: grid;
    gap: 4px;
    max-width: 88%;
    padding: 10px 12px;
}

.message-bubble.mine {
    justify-self: end;
    color: white;
    background: var(--accent);
    border-color: var(--accent);
}

.message-bubble.theirs {
    justify-self: start;
}

.message-bubble p {
    margin: 0;
    white-space: pre-wrap;
}

.message-bubble__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.message-edit-toggle {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: inherit;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 8px;
}

.message-action-menu {
    position: absolute;
    top: 30px;
    right: 8px;
    z-index: 5;
    min-width: 166px;
    overflow: hidden;
    color: #fff;
    background: #0f1f2d;
    border: 1px solid #294052;
    border-radius: 4px;
    box-shadow: 0 16px 28px rgba(2, 6, 23, .32);
}

.message-bubble.theirs .message-action-menu {
    right: auto;
    left: 8px;
}

.message-action-menu[hidden] {
    display: none;
}

.message-action-menu button {
    display: block;
    width: 100%;
    min-height: 33px;
    padding: 0 12px;
    color: inherit;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #294052;
    font-size: .88rem;
}

.message-action-menu form:last-child button,
.message-action-menu > button:last-child {
    border-bottom: 0;
}

.message-action-menu .danger-text {
    color: #ff6b6b;
}

.message-edit-form {
    display: grid;
    gap: 8px;
    margin-top: 6px;
}

.message-edit-form[hidden] {
    display: none;
}

.message-edit-form label {
    display: grid;
    gap: 5px;
}

.message-edit-form label span {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.message-edit-form textarea {
    width: 100%;
    min-height: 76px;
    padding: 8px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.message-edit-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.message-edit-actions .primary-action,
.message-edit-actions .secondary-action {
    min-height: 40px;
    padding: 0 10px;
}

.message-bubble small,
.message-bubble a {
    font-size: .76rem;
    opacity: .82;
}

.message-checks {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    color: rgba(255, 255, 255, .72);
    font-size: .92rem;
    vertical-align: -1px;
}

.message-checks.read {
    color: #60a5fa;
}

.chat-compose {
    position: fixed;
    right: 0;
    bottom: var(--nav-height);
    left: 0;
    z-index: 25;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    align-items: end;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(244, 247, 246, .96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.chat-compose .validation-summary {
    grid-column: 1 / -1;
}

.new-message-banner {
    position: absolute;
    right: 76px;
    bottom: calc(100% + 8px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-self: end;
    min-height: 34px;
    padding: 0 12px;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(15, 118, 110, .22);
    font-size: .82rem;
    font-weight: 800;
}

.new-message-banner[hidden] {
    display: none;
}

.reply-preview {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    color: var(--accent-strong);
    background: #e8f4f2;
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 700;
}

.reply-preview[hidden] {
    display: none;
}

.reply-preview span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reply-preview button {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: var(--accent-strong);
    background: transparent;
    border: 0;
}

.chat-compose__field {
    display: block;
    min-width: 0;
    margin: 0;
}

.chat-compose__field textarea {
    display: block;
    width: 100%;
    max-height: 112px;
    min-height: 44px;
    padding: 11px 14px;
    resize: none;
    overflow-y: auto;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    outline: 0;
    line-height: 1.35;
}

.chat-compose__field textarea:focus {
    border-color: #8ccbc2;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}

.chat-compose__send {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(15, 118, 110, .22);
    font-size: 1.14rem;
}

.chat-compose__send:focus,
.chat-compose__send:hover {
    background: var(--accent-strong);
}

.chat-call-overlay[hidden] {
    display: none;
}

.chat-call-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    align-items: end;
    padding: 14px;
    background: rgba(15, 23, 42, .58);
}

.chat-call-card {
    display: grid;
    gap: 14px;
    width: min(100%, 560px);
    margin: 0 auto calc(var(--nav-height) + 8px);
    padding: 14px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 56px rgba(15, 23, 42, .22);
}

.chat-call-card h2 {
    margin: 0;
    font-size: 1.15rem;
}

.chat-call-card p {
    margin: 4px 0 0;
    color: var(--muted);
}

.chat-call-video {
    position: relative;
    min-height: 220px;
    overflow: hidden;
    background: #0f172a;
    border-radius: 8px;
}

.chat-call-video video {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
}

.chat-call-video video[data-local-video] {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 96px;
    min-height: 128px;
    height: 128px;
    border: 2px solid rgba(255, 255, 255, .72);
    border-radius: 8px;
}

.chat-call-controls {
    display: flex;
    gap: 8px;
}

.chat-call-controls > * {
    flex: 1 1 0;
}

.recipient-picker {
    gap: 10px;
}

.recipient-group-preview {
    display: grid;
    gap: 8px;
    min-height: 46px;
    padding: 10px;
    background: #fbfcfc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.recipient-group-preview > span {
    color: var(--muted);
    font-weight: 800;
}

.recipient-group-preview > strong {
    color: var(--accent-strong);
    font-size: .86rem;
    text-transform: uppercase;
}

.recipient-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.recipient-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 8px;
    color: var(--accent-strong);
    background: #e8f4f2;
    border: 1px solid #b6dcd6;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 900;
}

.recipient-toggle {
    width: 100%;
    border: 1px solid #b6dcd6;
}

.recipient-list {
    display: grid;
    gap: 8px;
    max-height: 330px;
    overflow-y: auto;
    padding-right: 2px;
}

.recipient-search {
    position: sticky;
    top: 0;
    z-index: 1;
    background: white;
}

.member-add-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.recipient-option {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px;
    background: #fbfcfc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.recipient-option input {
    width: 22px;
    min-height: 22px;
    margin-top: 2px;
}

.recipient-option span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.recipient-option strong,
.recipient-option small {
    overflow-wrap: anywhere;
}

.recipient-option small {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.approval-panel {
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-bottom: calc(var(--nav-height) + 10px);
}

.form-actions.single {
    grid-template-columns: 1fr;
}

.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    color: var(--accent-strong);
    background: #e8f4f2;
    border: 1px solid #b6dcd6;
    border-radius: 8px;
    font-weight: 800;
}

.leave-empty {
    padding: 14px;
}

.feature-card--disabled {
    opacity: .62;
}

.feature-card i {
    background: var(--accent);
}

.auth-card {
    padding: 18px;
}

.auth-form {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.auth-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 700;
}

.auth-form .check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-form .check-row input {
    width: 20px;
    min-height: 20px;
}

.auth-form input {
    width: 100%;
    min-height: 46px;
    padding: 8px 12px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    font: inherit;
}

.validation-summary {
    color: #9f1239;
    font-weight: 700;
}

.validation-summary ul {
    margin: 0;
    padding-left: 18px;
}

.auth-note {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding: 12px;
    color: #7a4b00;
    background: #fff7df;
    border: 1px solid #f3d28a;
    border-radius: 8px;
    font-size: .88rem;
}

.connection-summary {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
    padding: 12px;
    color: #164e63;
    background: #ecfeff;
    border: 1px solid #a5f3fc;
    border-radius: 8px;
    font-size: .86rem;
}

.connection-summary i {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: white;
    background: #0891b2;
    border-radius: 8px;
}

.connection-summary div {
    display: grid;
    gap: 2px;
}

.connection-summary span {
    color: #475569;
    overflow-wrap: anywhere;
}

.connection-summary--error {
    color: #7f1d1d;
    background: #fff1f2;
    border-color: #fecdd3;
}

.connection-summary--error i {
    background: var(--red);
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 28px 18px;
    text-align: center;
}

.empty-state i {
    color: var(--red);
    font-size: 2rem;
}

.empty-state a {
    color: var(--accent);
    font-weight: 800;
}

.bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: var(--nav-height);
    padding: 7px max(8px, env(safe-area-inset-left)) max(7px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.bottom-nav a {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    min-width: 0;
    color: var(--muted);
    border-radius: 8px;
    font-size: .72rem;
    font-weight: 700;
}

.bottom-nav span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bottom-nav i {
    font-size: 1.16rem;
}

.bottom-nav a:hover,
.bottom-nav a:focus {
    color: var(--accent);
    background: #e8f4f2;
}

@media (min-width: 680px) {
    .hero-panel {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .module-grid,
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .module-card,
    .feature-card {
        grid-template-columns: 1fr;
    }

    .module-card i,
    .feature-card i {
        grid-row: auto;
    }

    .account-form-grid {
        grid-template-columns: 1fr 240px;
    }

    .field-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .form-field--wide {
        grid-column: span 3;
    }

    .subform-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .subform-button {
        grid-template-columns: 1fr;
    }

    .subform-button i {
        grid-row: auto;
    }

    .request-card {
        grid-template-columns: 1fr 210px;
        align-items: center;
    }

    .filter-bar {
        grid-template-columns: repeat(5, 1fr);
    }

    .inline-switches {
        grid-template-columns: repeat(2, 1fr);
    }
}
