:root {
    --bg: #e7f1f8;
    --ink: #102435;
    --accent: #1f6f9f;
    --accent-deep: #153f5a;
    --accent-soft: #d9ebf6;
    --panel: rgba(255, 255, 255, 0.94);
    --line: #d3e1eb;
    --warn: #9d0208;
    --sidebar-width: 200px;
    --app-body-scrollbar-width: 0px;
    --header-height: 84px;
    --content-max-width: 980px;
    --admin-narrow-max-width: 680px;
    --admin-editor-max-width: 1180px;
    --min-app-width: 0px;
    --shell-padding-x: 24px;
    --shell-padding-bottom: 24px;
    --panel-padding: 24px;
    --topbar-gap: 16px;
    --topbar-padding-x: 16px;
    --topbar-card-width: 240px;
    --topbar-user-card-width: 300px;
    --topbar-card-gap: 12px;
    --topbar-logo-width: 168px;
    --topbar-logo-gap: 12px;
    --brand-gap: 14px;
    --brand-mark-size: 44px;
    --brand-mark-radius: 14px;
    --brand-name-size: 1.16rem;
    --brand-section-size: 0.84rem;
    --body-font-size: 16px;
    --sidebar-padding-y: 20px;
    --sidebar-padding-x: 16px;
    --sidebar-link-min-height: 48px;
    --sidebar-link-font-size: 0.94rem;
    --sidebar-sublink-min-height: 42px;
    --sidebar-sublink-font-size: 0.9rem;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    min-width: var(--min-app-width);
    overflow-x: auto;
    overflow-y: hidden;
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-size: var(--body-font-size);
    background:
        radial-gradient(circle at top left, rgba(31, 111, 159, 0.18), transparent 22%),
        linear-gradient(180deg, #f7fbfe 0%, var(--bg) 100%);
    color: var(--ink);
}

a {
    color: inherit;
    text-decoration: none;
}

.layout {
    height: 100vh;
    height: 100dvh;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 0 var(--topbar-padding-x);
    border-bottom: 1px solid var(--line);
    background: rgba(250, 252, 249, 0.94);
    backdrop-filter: blur(14px);
}

.topbar.topbar-auth {
    gap: 2px;
    justify-content: flex-start;
    padding-top: 4px;
    padding-bottom: 4px;
    padding-left: 0;
    padding-right: 0;
}

.topbar-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: var(--topbar-gap);
    min-height: var(--header-height);
}

.topbar-auth .topbar-main {
    min-height: 34px;
}

.topbar-auth-body {
    margin-left: calc(var(--topbar-logo-width) + var(--topbar-logo-gap));
    min-width: 0;
    padding: 0 var(--topbar-padding-x);
}

.topbar-main-auth {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--topbar-gap);
}

.topbar-main-auth .topbar-center {
    justify-content: flex-start;
}

.topbar-main-auth .topbar-start {
    display: none;
}

.topbar-admin .topbar-main {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.topbar-admin .topbar-center {
    justify-content: flex-start;
}

.topbar-admin-user-card {
    width: min(100%, 620px);
    max-width: 620px;
    gap: 18px;
    justify-content: flex-start;
}

.topbar-admin-logout {
    width: auto;
    min-width: 140px;
    max-width: none;
    justify-content: center;
    font-weight: 700;
}

.offline-snapshot-topbar {
    position: relative;
    flex: 0 0 auto;
}

.offline-snapshot-button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid #d6a83d;
    border-radius: 50%;
    background: #fff7df;
    color: #6b4a07;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.offline-snapshot-button:hover,
.offline-snapshot-button:focus-visible {
    background: #fff0c2;
    border-color: #c48f1d;
    outline: none;
}

.offline-snapshot-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 80;
    width: min(320px, calc(100vw - 24px));
    display: none;
    padding: 12px 14px;
    border: 1px solid #d4b15a;
    border-radius: 8px;
    background: #fffdf6;
    box-shadow: 0 18px 44px rgba(15, 79, 119, 0.18);
    color: #4d3a0b;
    font-size: 0.84rem;
    line-height: 1.4;
}

.offline-snapshot-popover span {
    display: block;
}

.offline-snapshot-topbar:hover .offline-snapshot-popover,
.offline-snapshot-topbar:focus-within .offline-snapshot-popover {
    display: block;
}

.topbar-start {
    min-width: 0;
}

.topbar-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--topbar-card-gap);
    min-width: 0;
}

.brand-block {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--brand-gap);
    overflow: hidden;
    flex: 1 1 auto;
}

.brand-mark {
    width: var(--brand-mark-size);
    height: var(--brand-mark-size);
    flex: 0 0 var(--brand-mark-size);
    display: grid;
    place-items: center;
    border-radius: var(--brand-mark-radius);
    background: linear-gradient(135deg, var(--accent) 0%, #4b93bb 100%);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.brand-copy {
    min-width: 0;
    overflow: hidden;
}

.brand-name,
.brand-section {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-name {
    font-size: var(--brand-name-size);
    font-weight: 700;
}

.brand-section {
    color: #5a7183;
    font-size: var(--brand-section-size);
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--topbar-card-gap);
    min-width: 0;
}

.topbar-card {
    width: min(100%, var(--topbar-card-width));
    min-width: 0;
    max-width: var(--topbar-card-width);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid #d0deea;
    background: #f4faff;
}

.topbar-inline-card {
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    text-align: left;
    color: var(--accent-deep);
}

.topbar-inline-card:hover {
    background: #edf6fb;
    border-color: #bfd4e3;
}

.topbar-inline-card[aria-expanded="true"] {
    background: #e7f3fb;
    border-color: #a9c9dc;
}

.topbar-card-caret {
    color: #4f6c80;
    font-size: 0.82rem;
    line-height: 1;
}

.topbar-inline-card .topbar-card-value {
    color: var(--accent-deep);
}

.topbar-card-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.topbar-card-label {
    display: block;
    margin-bottom: 4px;
    color: #5a7183;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.topbar-card-value {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.topbar-user {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    text-align: center;
}

.topbar-user .topbar-card-label {
    margin-bottom: 0;
}

.topbar-user .topbar-card-value {
    width: 100%;
    min-width: 0;
}

.topbar-user-card {
    width: min(100%, var(--topbar-user-card-width));
    max-width: var(--topbar-user-card-width);
    gap: 10px;
}

.topbar-logo-slot {
    position: absolute;
    left: var(--topbar-padding-x);
    top: 4px;
    bottom: 4px;
    width: var(--topbar-logo-width);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.topbar-logo-slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.topbar-logo-fallback {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(31, 111, 159, 0.15) 0%, rgba(75, 147, 187, 0.24) 100%);
    color: var(--accent-deep);
    font-weight: 800;
    letter-spacing: 0.06em;
}

.topbar-inline-card.account-switcher-card {
    position: relative;
    justify-content: space-between;
    padding-right: 12px;
}

.topbar-inline-card.account-switcher-card .topbar-card-copy {
    width: auto;
    flex: 1 1 auto;
    text-align: left;
}

.switcher-current {
    text-align: left;
}

.user-menu {
    position: relative;
}

.user-menu-panel {
    right: 0;
    left: auto;
    min-width: 180px;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}

.topnav a {
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 700;
}

.topnav a:hover {
    background: #edf6fb;
}

.topbar-quick {
    min-width: 0;
    overflow: visible;
}

.topbar.topbar-auth .topbar-quick {
    transform: translateY(3px);
}

.topbar-quick-inner {
    width: calc(100% - var(--sidebar-width) - var(--app-body-scrollbar-width));
    margin-left: var(--sidebar-width);
    padding: 0 var(--shell-padding-x);
}

.topbar-quick-track {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    width: min(100%, var(--content-max-width));
    min-width: 0;
    margin: 0 auto;
}

.topbar-quick-hint {
    min-width: 0;
}

.topbar-quick-hint .topbar-quick-button {
    width: 100%;
}

.topbar-quick-button {
    min-height: 31px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid #5f98b9;
    background: linear-gradient(135deg, var(--accent) 0%, #3f86af 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-quick-button--with-icon {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    text-align: left;
}

.topbar-quick-button--with-icon span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-quick-button--has-unseen {
    position: relative;
    animation: topbarQuickPulse 1.4s ease-in-out infinite;
}

.topbar-quick-button--has-unseen::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d61f1f;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.86);
}

.topbar-quick-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

.topbar-quick-button:disabled {
    opacity: 0.92;
    cursor: default;
}

.topbar-quick-hint .topbar-quick-button:disabled {
    pointer-events: none;
}

.qa-label-md {
    display: none;
}

.topbar-quick-mobile {
    display: none;
}

.topbar-quick-mobile-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.topbar-quick-mobile-toggle {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #5f98b9;
    background: linear-gradient(135deg, var(--accent) 0%, #3f86af 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
}

.topbar-quick-mobile-toggle--has-unseen {
    animation: topbarQuickPulse 1.4s ease-in-out infinite;
}

.topbar-quick-mobile-toggle--has-unseen::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d61f1f;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.86);
}

.topbar-quick-mobile-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.topbar-quick-mobile-copy strong {
    font-size: 0.9rem;
    line-height: 1.1;
    color: #ffffff;
}

.topbar-quick-mobile-copy span {
    font-size: 0.74rem;
    line-height: 1.15;
    color: rgba(255, 255, 255, 0.92);
}

.topbar-quick-mobile-caret {
    font-size: 0.95rem;
    line-height: 1;
    transition: transform 0.18s ease;
}

.topbar-quick-mobile-toggle[aria-expanded="true"] .topbar-quick-mobile-caret {
    transform: rotate(180deg);
}

.topbar-quick-mobile-notify {
    position: relative;
    min-width: 132px;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid #5f98b9;
    background: linear-gradient(135deg, var(--accent) 0%, #3f86af 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-weight: 700;
    font-size: 0.78rem;
    white-space: nowrap;
}

.topbar-quick-mobile-notify:hover {
    background: linear-gradient(135deg, #2a7fad 0%, #4a8fb7 100%);
    border-color: #74a3c0;
}

.topbar-quick-mobile-notify .topbar-quick-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.topbar-quick-mobile-notify--has-unseen {
    animation: topbarQuickPulse 1.4s ease-in-out infinite;
}

.topbar-quick-mobile-notify--has-unseen::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d61f1f;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.86);
}

.topbar-quick-mobile-badges {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qa-mobile-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid #bcd5e4;
    background: #eef6fc;
    color: #245c82;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.qa-mobile-badge--danger {
    border-color: #e49ca2;
    background: #fbe7ea;
    color: #a71c2a;
}

.qa-mobile-badge--warn {
    border-color: #e6bb7f;
    background: #fff4e3;
    color: #8f5a0d;
}

.qa-mobile-badge--attention {
    border-color: #b8cde0;
    background: #e8f1f8;
    color: #1f5f95;
}

.qa-mobile-badge--info {
    border-color: #bcd5e4;
    background: #eef6fc;
    color: #245c82;
}

.topbar-quick-sheet[hidden] {
    display: none;
}

.topbar-quick-sheet {
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.topbar-quick-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 28, 41, 0.45);
    touch-action: none;
}

.topbar-quick-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(72vh, 560px);
    border-radius: 18px 18px 0 0;
    border: 1px solid #c7dae8;
    border-bottom: 0;
    background: #ffffff;
    box-shadow: 0 -16px 36px rgba(16, 36, 53, 0.2);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.topbar-quick-sheet-head {
    padding: 12px 14px 10px;
    border-bottom: 1px solid #d6e3ed;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.topbar-quick-sheet-head strong {
    color: #163f5d;
    font-size: 0.95rem;
}

.topbar-quick-sheet-head p {
    margin: 4px 0 0;
    color: #557189;
    font-size: 0.78rem;
}

.topbar-quick-sheet-close {
    min-height: 34px;
    min-width: 34px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid #c7dae8;
    background: #f2f8fd;
    color: #245c82;
    font-size: 0.96rem;
}

.topbar-quick-sheet-list {
    overflow: auto;
    overscroll-behavior: contain;
    padding: 10px 12px 14px;
    display: grid;
    gap: 8px;
}

.topbar-quick-sheet-item {
    width: 100%;
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #5f98b9;
    background: linear-gradient(135deg, var(--accent) 0%, #3f86af 100%);
    color: #ffffff;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    text-align: left;
}

.topbar-quick-sheet-item .topbar-quick-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}

.topbar-quick-sheet-item:hover {
    background: linear-gradient(135deg, #2a7fad 0%, #4a8fb7 100%);
    border-color: #74a3c0;
}

.topbar-quick-sheet-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.topbar-quick-sheet-copy strong {
    color: #ffffff;
    font-size: 0.86rem;
}

.topbar-quick-sheet-copy span {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.76rem;
    line-height: 1.25;
}

.topbar-quick-sheet-badge {
    min-width: 22px;
    min-height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.48);
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topbar-quick-sheet-badge.is-danger {
    border-color: #e49ca2;
    background: #fbe7ea;
    color: #a71c2a;
}

.topbar-quick-sheet-item--unseen {
    animation: topbarQuickPulse 1.4s ease-in-out infinite;
}

.topbar-quick-sheet-item--disabled {
    opacity: 0.92;
    cursor: default;
}

.topbar-quick-sheet-item--disabled:hover {
    background: linear-gradient(135deg, var(--accent) 0%, #3f86af 100%);
    border-color: #5f98b9;
}

.quick-sheet-open .app-body {
    overflow: hidden;
}

@media (max-width: 1120px) {
    .topbar.topbar-auth .topbar-quick {
        transform: none;
    }
}

.app-body {
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
    margin-top: var(--header-height);
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 20px;
    padding: var(--sidebar-padding-y) var(--sidebar-padding-x);
    border-right: 1px solid var(--line);
    background: rgba(242, 248, 252, 0.92);
    overflow: auto;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.sidebar-auth-entry {
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.sidebar-nav-public {
    flex: 0 0 auto;
    align-content: start;
}

.sidebar-subnav {
    display: grid;
    gap: 8px;
    margin-top: -2px;
    padding-left: 16px;
}

.sidebar-separator {
    height: 0;
    margin: 8px 0 2px;
    border-top: 2px solid #c7d9e5;
}

.sidebar-copyright {
    margin: 0;
    color: #6f8392;
    font-size: 0.72rem;
    line-height: 1.35;
    letter-spacing: 0.01em;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
}

.sidebar-version {
    display: grid;
    gap: 3px;
    padding: 9px 12px;
    border: 1px solid #cbdce7;
    border-radius: 8px;
    background: #f7fbfd;
    color: #5d7484;
    line-height: 1.25;
}

.sidebar-version span {
    font-size: 0.7rem;
}

.sidebar-version strong {
    color: #263f50;
    font-size: 0.78rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--sidebar-link-min-height);
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    font-weight: 600;
    font-size: var(--sidebar-link-font-size);
}

.sidebar-link:hover {
    background: #edf6fb;
    border-color: #d4e3ee;
}

.sidebar-link.is-active {
    background: linear-gradient(135deg, var(--accent) 0%, #3f86af 100%);
    border-color: var(--accent);
    color: #fff;
}

.sidebar-link-mode {
    cursor: default;
    background: rgba(31, 111, 159, 0.12);
    border-color: rgba(31, 111, 159, 0.18);
    color: var(--accent-deep);
}

.sidebar-link-mode:hover {
    background: rgba(31, 111, 159, 0.12);
    border-color: rgba(31, 111, 159, 0.18);
}

.sidebar-link-mode.is-active {
    background: linear-gradient(135deg, rgba(31, 111, 159, 0.18) 0%, rgba(75, 147, 187, 0.26) 100%);
    border-color: rgba(31, 111, 159, 0.2);
    color: var(--accent-deep);
}

.sidebar-sublink {
    min-height: var(--sidebar-sublink-min-height);
    padding-left: 18px;
    font-size: var(--sidebar-sublink-font-size);
    color: #36556c;
}

.sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    color: currentColor;
}

.sidebar-icon svg,
.sidebar-icon-svg {
    display: block;
    width: 21px;
    height: 21px;
}

.sidebar-tooltip {
    display: none;
}

.sidebar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-sublink .sidebar-label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.15;
}

.content-shell {
    min-height: 100%;
    overflow: visible;
    padding: 0 var(--shell-padding-x) var(--shell-padding-bottom);
    display: flex;
    flex-direction: column;
}

.content-shell > * {
    width: min(100%, var(--content-max-width));
    min-width: 0;
    margin: 0 auto;
}

body.admin-layout-narrow .content-shell > * {
    width: min(100%, var(--admin-narrow-max-width));
}

body.admin-layout-editor .content-shell > * {
    width: min(100%, var(--admin-editor-max-width));
}

body.admin-layout-workspace .content-shell > * {
    width: 100%;
    max-width: none;
    margin: 0;
}

.content-scroll {
    overflow: visible;
    min-height: 0;
    flex: 1 1 auto;
}

.content-x-scroll {
    width: 100%;
    overflow: visible;
}

.offline-mode-banner {
    width: min(100%, var(--content-max-width));
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #b98924;
    border-radius: 8px;
    background: #fff7df;
    color: #5e420a;
    font-size: 14px;
    line-height: 1.35;
}

.offline-mode-banner strong {
    flex: 0 0 auto;
    font-weight: 700;
}

.offline-mode-banner span {
    min-width: 0;
}

.account-switcher {
    position: relative;
    width: min(100%, var(--topbar-card-width));
    min-width: 0;
}

.account-switcher--contextual {
    width: min(100%, calc(var(--topbar-card-width) * 2 + var(--topbar-card-gap) + 15px));
    max-width: calc(var(--topbar-card-width) * 2 + var(--topbar-card-gap) + 15px);
}

.account-switcher--contextual .account-switcher-card {
    width: min(100%, calc(var(--topbar-card-width) + 15px));
    max-width: calc(var(--topbar-card-width) + 15px);
}

.topbar-context-card {
    cursor: default;
}

.account-switcher-card {
    position: relative;
    justify-content: center;
    padding-right: 58px;
}

.account-switcher-card .topbar-card-copy {
    width: 100%;
    flex: 1 1 100%;
    text-align: center;
}

.switcher-current {
    text-align: center;
}

.switcher-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: max-content;
    min-width: 240px;
    max-width: min(320px, calc(100vw - 32px));
    padding: 8px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 18px 40px rgba(19, 42, 27, 0.08);
    z-index: 140;
}

.account-switcher .switcher-menu {
    left: 0;
    right: auto;
}

.account-switcher.is-open .switcher-menu {
    display: block;
}

.switcher-menu.switcher-menu--accounts {
    min-width: min(380px, calc(100vw - 32px));
    width: min(520px, calc(100vw - 32px));
    max-width: min(520px, calc(100vw - 32px));
}

.switcher-account-table {
    display: grid;
    gap: 6px;
}

.switcher-account-table-head,
.switcher-account-table-row {
    display: grid;
    grid-template-columns: minmax(134px, 1.4fr) repeat(var(--ctx-cols, 1), minmax(0, 1fr));
    gap: 6px;
    align-items: stretch;
}

.switcher-account-table--compact .switcher-account-table-head,
.switcher-account-table--compact .switcher-account-table-row {
    grid-template-columns: minmax(134px, 1.4fr) minmax(120px, 1fr);
}

.switcher-account-head-cell {
    min-height: 22px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #688298;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.switcher-account-head-cell--account {
    justify-content: flex-start;
    padding-left: 12px;
}

.switcher-menu a {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
}

.switcher-menu a:hover {
    background: #f3f9fd;
}

.switcher-menu span {
    color: #5a7183;
    font-size: 0.88rem;
}

.switcher-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid #d0deea;
    background: #fff;
    color: var(--accent-deep);
}

.switcher-toggle:hover {
    background: #edf6fb;
}

.switcher-toggle-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.switcher-menu-action {
    margin-top: 8px;
    justify-content: center !important;
    border: 1px solid #d0deea;
    background: #f4faff;
    font-weight: 700;
}

.switcher-account-row {
    padding: 8px;
    border-radius: 12px;
}

.switcher-account-row.is-active {
    background: #f3f9fd;
}

.switcher-account-row + .switcher-account-row {
    margin-top: 2px;
}

.switcher-menu--accounts .switcher-account-main {
    margin: 0;
}

.switcher-account-main--table {
    min-height: 32px;
    height: 100%;
    padding-left: 16px !important;
}

.switcher-account-main--table strong {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.switcher-account-flag {
    display: inline-flex;
    width: 2em;
    justify-content: flex-start;
    color: #102435;
}

.switcher-account-table-row--compact {
    align-items: center;
}

.switcher-account-table-row.is-active .switcher-account-main--table {
    border: 1px solid #bfd4e3;
    background: #f3f9fd;
}

.switcher-account-contexts {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}

.switcher-menu--accounts .switcher-context-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    height: 100%;
    padding: 0 8px;
    border-radius: 9px;
    border: 1px solid #d0deea;
    background: #f4faff;
    color: #36556c;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

.switcher-menu--accounts .switcher-context-pill:hover {
    background: #e9f4fb;
    border-color: #bdd2e1;
}

.switcher-menu--accounts .switcher-context-pill.is-selected {
    border-color: #5f98b9;
    background: #dceef9;
    color: #143f5b;
}

.switcher-menu--accounts .switcher-context-pill--empty {
    background: transparent;
    border-style: dashed;
    border-color: #dbe7f1;
}

.switcher-row-context-picker {
    position: relative;
    min-width: 0;
}

.switcher-row-context-toggle {
    width: 100%;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 9px;
    border: 1px solid #d0deea;
    background: #f4faff;
    color: #36556c;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.switcher-row-context-toggle:hover {
    background: #e9f4fb;
    border-color: #bdd2e1;
}

.switcher-row-context-picker.is-open .switcher-row-context-toggle {
    border-color: #5f98b9;
    background: #dceef9;
    color: #143f5b;
}

.switcher-row-context-caret {
    font-size: 0.78rem;
    line-height: 1;
}

.switcher-row-context-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 120px;
    max-width: 220px;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid #d0deea;
    background: #fff;
    box-shadow: 0 12px 24px rgba(19, 42, 27, 0.12);
    z-index: 20;
}

.switcher-row-context-menu a {
    display: block;
    padding: 7px 8px;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #36556c;
}

.switcher-row-context-menu a:hover {
    background: #f3f9fd;
}

.switcher-row-context-menu a.is-selected {
    background: #dceef9;
    color: #143f5b;
}

.switcher-account-no-services {
    margin-top: 6px;
    padding: 4px 2px;
    color: #688298;
    font-size: 0.8rem;
}

.switcher-account-no-services--cell {
    margin: 0;
    padding: 0 8px;
    min-height: 32px;
    border-radius: 9px;
    border: 1px dashed #dbe7f1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.muted {
    color: #5a7183;
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.single-column {
    max-width: 720px;
}

.single-column.wide {
    max-width: 980px;
}

.single-table {
    max-width: 100%;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: var(--panel-padding);
    box-shadow: 0 18px 40px rgba(19, 42, 27, 0.06);
    overflow-x: auto;
    overflow-y: visible;
}

.panel--table {
    overflow: visible;
}

/* Форма запрошення нового працівника: email + роль + кнопка в один рядок. */
.admin-staff-invite-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.admin-staff-invite-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-staff-invite-field input,
.admin-staff-invite-field select {
    min-width: 220px;
}

/* Height-chain: вкладки і активна панель тягнуться на всю висоту layout,
   щоб скролилась таблиця у своєму блоці, а не вся сторінка. */
.admin-staff-layout > .section-backlink,
.admin-staff-layout > .success,
.admin-staff-layout > .error,
.admin-staff-layout > .panel {
    flex: 0 0 auto;
}

.admin-staff-layout > .admin-staff-tabs {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.admin-staff-tabs > .admin-tabs-nav {
    flex: 0 0 auto;
}

.admin-staff-tabs > .admin-staff-pane.is-active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 12px;
}

.admin-staff-pane > .admin-staff-invite-panel {
    flex: 0 0 auto;
}

.admin-staff-pane > .admin-staff-list-panel {
    flex: 1 1 auto;
    min-height: 0;
}

/* staff-таблиці використовують спільний .data-table; staff-table лишає
   тільки специфіку комірки дій з формами (інші data-таблиці форм не мають). */
.staff-table td form {
    display: block;
    margin: 0 0 10px;
}

.staff-table td form:last-child {
    margin-bottom: 0;
}

.staff-table td form select,
.staff-table td form input {
    width: 100%;
    margin-bottom: 6px;
}

/* Таблиця працівників: вужчі колонки працівник/роль/статус/link, «дії» отримують решту. */
.staff-table--members th:nth-child(1),
.staff-table--members td:nth-child(1) { width: 18%; }
.staff-table--members th:nth-child(2),
.staff-table--members td:nth-child(2) { width: 12%; }
.staff-table--members th:nth-child(3),
.staff-table--members td:nth-child(3) { width: 9%; }
.staff-table--members th:nth-child(4),
.staff-table--members td:nth-child(4) { width: 18%; }

.staff-employee-link {
    display: grid;
    gap: 3px;
    min-width: 170px;
}

.staff-employee-link-form {
    margin-top: 8px;
}

.staff-table td .staff-employee-link-form label {
    display: block;
    margin-bottom: 4px;
}

.staff-table td .staff-employee-link-form select {
    min-width: 220px;
    max-width: 300px;
}

.staff-link-warning {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fff4d8;
    color: #78590e;
    font-size: 0.78rem;
    line-height: 1.25;
}

.staff-activation-code {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 6px 0;
}

/* Комірка «Дії»: три форми поряд горизонтально, кожна — control зверху, кнопка під ним. */
.staff-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}
.staff-table td .staff-actions form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    width: auto;
    padding: 0 16px;
}
.staff-table td .staff-actions form:first-child {
    padding-left: 0;
}
.staff-table td .staff-actions form + form {
    border-left: 1px solid var(--line);
}
.staff-action-control {
    display: flex;
    align-items: center;
    gap: 6px;
}
.staff-table td .staff-action-control select,
.staff-table td .staff-action-control input {
    width: auto;
    min-width: 150px;
    margin: 0;
}
.staff-table td .staff-action-control--wide select {
    min-width: 260px;
    max-width: 320px;
}
.staff-action-save {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.staff-action-save svg {
    width: 16px;
    height: 16px;
}
.staff-action-danger {
    min-height: 32px;
    padding: 0 10px;
    margin-top: 2px;
    border-color: #e5b1a9;
    color: #8b2a1e;
    background: #fff7f5;
}
.staff-action-secondary {
    min-height: 32px;
    padding: 0 10px;
    margin-top: 2px;
    border-color: var(--line);
    color: var(--text);
    background: #f7fbfd;
}

/* Чат абонента з оператором (subscriber_chat). */
.chat-thread-status {
    font-size: 0.85rem;
    color: #5a7183;
    margin-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.chat-topic-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef5fb;
    color: #24455f;
    font-weight: 600;
}
.single-column.chat-layout {
    max-width: none;  /* чат — на ширину контенту (як дашборд), не 720px */
}
.chat-layout {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-height) - 32px);
    min-height: calc(100svh - var(--header-height) - 32px);
}
body.page-chat .layout {
    height: 100vh;
    height: 100svh;
    min-height: 0;
}
body.page-chat .app-body {
    height: calc(100vh - var(--header-height));
    height: calc(100svh - var(--header-height));
    min-height: 0;
    overflow: hidden;
}
body.page-chat .content-shell,
body.page-chat .content-scroll,
body.page-chat .content-x-scroll {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
body.page-chat .content-shell {
    padding-bottom: 0;
}
body.page-chat .chat-layout {
    height: 100%;
    min-height: 0;
}
.chat-layout > .section-backlink {
    flex: 0 0 auto;
}
.chat-layout .section-backlink-title,
.chat-panel > .eyebrow {
    line-height: 1.35;
    min-height: 1.35em;
}
.chat-layout > .chat-panel {
    flex: 1 1 auto;
    min-height: 420px;
    display: flex;
    flex-direction: column;
}
body.page-chat .chat-layout > .chat-panel {
    min-height: 0;
    overflow: hidden;
}
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 14px 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}
.chat-message {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 12px;
}
.chat-action-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: min(280px, 100%);
}
.chat-action-card-title {
    font-weight: 700;
    color: #19364d;
}
.chat-action-card-body {
    color: #39576d;
    line-height: 1.35;
}
.chat-action-card-button {
    align-self: flex-start;
    margin-top: 2px;
    font-weight: 700;
}
.chat-action-card-meta {
    align-self: flex-start;
    margin-top: 2px;
    padding: 4px 8px;
    border: 1px solid #c9d7e2;
    border-radius: 6px;
    background: #f7fafc;
    color: #47667c;
    font-size: 0.82rem;
    font-weight: 600;
}
.chat-message-recalled {
    color: #667987;
    font-style: italic;
}
.chat-message-recall-form {
    margin-top: 4px;
}
.chat-message-recall-form .action-link {
    padding: 0;
    font-size: 0.78rem;
    font-weight: 600;
}
.chat-message--subscriber {
    align-self: flex-end;
    background: #d8ecff;
}
.chat-message--operator {
    align-self: flex-start;
    background: #f1f3f5;
}
.chat-message-time {
    font-size: 0.72rem;
    color: #6b7f8f;
    margin-top: 4px;
}
.chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 8px;
    align-items: flex-end;
}
.chat-topic-select {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.86rem;
    color: #5a7183;
}
.chat-topic-select select,
.chat-topic-filter select {
    min-height: 36px;
}
.chat-form textarea {
    width: 100%;
    min-width: 0;
}
.chat-form-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    align-self: stretch;
}
.chat-attach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3rem;
    min-width: 40px;
    min-height: 40px;
    padding: 0 8px;
}
.chat-form-actions button {
    min-width: 96px;
}
.chat-attach input[type="file"] {
    display: none;
}
.chat-message-image {
    max-width: 220px;
    max-height: 220px;
    border-radius: 8px;
    display: block;
    margin-top: 4px;
}
.admin-chat-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 32px);
    height: calc(100dvh - var(--header-height) - 32px);
}
.admin-chat-layout > .section-backlink {
    flex: 0 0 auto;
}
.admin-chat-layout > .admin-chat-grid {
    flex: 1 1 auto;
    min-height: 0;
}
.single-column.wide.admin-chat-layout {
    max-width: none;  /* чат — на всю доступну ширину, без обмеження 980px */
}
.admin-chat-grid {
    display: grid;
    grid-template-columns: minmax(360px, 2fr) 3fr;  /* ліва ширша, пропорційно стискається */
    gap: 16px;
    align-items: stretch;
}
.admin-chat-queue,
.admin-chat-dialog {
    min-height: 0;
}
.admin-chat-queue {
    overflow-y: auto;  /* черга + історія скроляться у власному блоці */
}
/* дії в черзі/історії одним рядком (без переносу «Відкрити» тощо) */
.admin-chat-queue .data-table td:last-child {
    white-space: nowrap;
}
.chat-notice {
    flex: 0 0 auto;
    margin: 0 0 10px;
    padding: 10px 12px;
    border: 1px solid #c7dae8;
    border-radius: 8px;
    background: #eef6ff;
    color: #24445b;
    font-weight: 600;
}
.chat-live-refresh {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    padding: 9px 12px;
    border: 1px solid #c6d9e8;
    border-radius: 8px;
    background: #f2f8fc;
    color: #173a56;
}
.chat-live-refresh[hidden] {
    display: none;
}
/* «Новий чат»: кнопка на всю ширину + попап пошуку */
.chat-new-btn {
    width: 100%;
    margin-bottom: 6px;
}
.chat-topic-filter {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 0 0 8px;
}
.chat-topic-filter label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.82rem;
    color: #5a7183;
}
.admin-chat-thread-meta {
    margin: 2px 0 8px;
}
.chat-left-divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 12px 0;
}
.chat-new-dialog,
.chat-actions-dialog {
    width: min(92vw, 460px);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    background: var(--panel);
    color: var(--ink);
}
.chat-new-dialog::backdrop,
.chat-actions-dialog::backdrop {
    background: rgba(16, 36, 53, 0.45);
}
/* у попапі керування дії стоять стовпчиком із проміжком (не злипаються);
   ВАЖЛИВО: лише [open], інакше display перебиває дефолтний none і dialog
   завжди видимий + не закривається (open=false). */
.chat-actions-dialog[open] {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-transfer-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}
.chat-transfer-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
.chat-transfer-form select {
    width: 100%;
}
.chat-transfer-requests ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-transfer-requests {
    flex: 0 0 auto;
    min-height: 96px;
    overflow: visible;
}
.chat-transfer-requests li {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.chat-transfer-requests li > span {
    margin-right: auto;
}
.chat-manage-btn {
    align-self: flex-start;
}
.admin-chat-dialog > .chat-form {
    flex: 0 0 auto;
    margin-bottom: 10px;
}
.admin-chat-dialog > .chat-manage-btn {
    flex: 0 0 auto;
    margin-top: 10px;
}
.chat-operator-tools {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 12px;
    align-items: end;
    margin: 0 0 10px;
}
.chat-action-send-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 8px;
    align-items: end;
    padding-left: 12px;
    border-left: 1px solid var(--line);
}
.chat-action-send-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    font-size: 0.82rem;
    color: #5a7183;
}
.chat-action-send-form select {
    min-width: 0;
    width: 100%;
}
.chat-operator-tools > .chat-manage-btn {
    align-self: end;
    margin: 0;
}
.admin-chat-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-chat-action-row .inline-form,
.admin-chat-action-row .chat-manage-btn {
    margin: 0;
}
.admin-chat-action-row button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
/* абонентський чат: нижній рядок дій по краях + список звернень у попапі */
.chat-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    flex: 0 0 auto;
}
.chat-bottom-bar button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.chat-threads-list-ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.chat-threads-open .app-body {
    overflow: hidden;
}
.chat-threads-modal[hidden] {
    display: none;
}
.chat-threads-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
}
.chat-threads-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 36, 53, 0.45);
}
.chat-threads-dialog {
    position: fixed;
    top: 16px;
    bottom: 16px;
    left: 50%;
    width: calc(100vw - 32px);
    max-width: 460px;
    transform: translateX(-50%);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    background: var(--panel);
    color: var(--ink);
    overflow: hidden;
}
.chat-threads-list {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 58px;
    bottom: 18px;
    min-height: 0;
    overflow: auto;
    padding-right: 10px;
    margin-right: -4px;
    scrollbar-gutter: stable;
    display: flex;
    flex-direction: column;
}
.chat-threads-list-head,
.chat-threads-list-row {
    display: grid;
    grid-template-columns: minmax(128px, 1fr) minmax(96px, max-content) max-content;
    gap: 14px;
    align-items: center;
    font-size: 0.92rem;
}
.chat-threads-list-head {
    padding: 8px 6px;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 1px solid var(--line);
}
.chat-threads-list-row {
    padding: 9px 6px;
    border-bottom: 1px solid var(--line);
    border-radius: 6px;
    color: inherit;
}
.chat-threads-list-row:hover,
.chat-threads-list-row:focus-visible {
    background: #f4f9fd;
    outline: none;
}
.chat-threads-list-row.is-selected {
    background: #eef6ff;
}
.chat-threads-list-row span:last-child {
    padding-right: 6px;
    text-align: right;
    white-space: nowrap;
}
.chat-threads-list-empty {
    padding: 10px 6px;
}
.chat-new-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.chat-search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.chat-search-form input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
}
.chat-search-form button {
    flex: 0 0 auto;
}
.admin-chat-dialog {
    display: flex;
    flex-direction: column;
}
.admin-chat-dialog > .chat-messages {
    flex: 1 1 auto;
    min-height: 0;
}
@media (max-width: 760px) {
    .chat-layout {
        min-height: calc(100vh - var(--header-height) - 18px);
        min-height: calc(100svh - var(--header-height) - 18px);
    }
    .chat-layout > .chat-panel {
        min-height: calc(100vh - var(--header-height) - 118px);
        min-height: calc(100svh - var(--header-height) - 118px);
    }
    .chat-messages {
        min-height: 180px;
    }
    .chat-message {
        max-width: 88%;
    }
    .chat-form {
        grid-template-columns: 1fr;
    }
    .chat-form textarea {
        width: 100%;
    }
    .chat-form-actions {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
    }
    .chat-form-actions button {
        flex: 1 1 auto;
    }
    .chat-operator-tools,
    .chat-action-send-form {
        grid-template-columns: 1fr;
    }
    .chat-action-send-form {
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid var(--line);
        padding-top: 10px;
    }
    .chat-bottom-bar {
        border-top: 1px solid var(--line);
        padding-top: 10px;
    }
    .admin-chat-layout {
        height: auto;
    }
    .admin-chat-grid {
        grid-template-columns: 1fr;
    }
}
.queue-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: #d11;
    vertical-align: middle;
}
.admin-badge {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #d11;
    color: #fff;
    font-size: 0.72rem;
    line-height: 18px;
    text-align: center;
}

.admin-attention-badge {
    margin-left: 6px;
    vertical-align: middle;
}

.admin-tab-link .admin-attention-badge,
.admin-control-summary-title .admin-attention-badge,
.admin-control-title .admin-attention-badge {
    transform: translateY(-1px);
}

.panel-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.panel-title-row .eyebrow {
    flex: 1 1 auto;
}

.panel :where(h1, h2, h3, h4, p, li, a, span, strong, div, td, th) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.panel .nowrap {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.panel.accent {
    background: linear-gradient(135deg, var(--accent-deep) 0%, var(--accent) 100%);
    color: #fff;
}

.panel-accent {
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 44px rgba(16, 36, 53, 0.14);
}

.panel-accent::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 42%);
    pointer-events: none;
}

.panel-accent > * {
    position: relative;
    z-index: 1;
}

.panel-accent .eyebrow {
    color: rgba(248, 252, 255, 0.92);
    margin-bottom: 14px;
}

.panel-accent .dashboard-offline-snapshot-heading {
    margin-top: -4px;
    margin-bottom: 16px;
    color: rgba(248, 252, 255, 0.86);
    line-height: 1.45;
}

.panel-accent h2 {
    margin-bottom: 18px;
    font-size: clamp(1.6rem, 2.1vw, 2.45rem);
    line-height: 1.1;
}

.panel-accent-facts {
    display: grid;
    gap: 12px;
    max-width: 64ch;
}

.panel-home-intro .panel-accent-facts {
    max-width: none;
}

.panel-accent-facts p {
    margin: 0;
    color: rgba(244, 250, 255, 0.96);
    line-height: 1.55;
}

.panel-accent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.panel-accent-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 700;
}

.panel-accent-actions a:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.34);
}

.panel-account-overview h2 {
    margin-bottom: 20px;
}

.panel-accent-toolbar {
    display: grid;
    gap: 0;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.panel-accent-toolbar-head {
    display: flex;
    align-items: center;
    min-height: 22px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.panel-accent-toolbar-title {
    color: rgba(228, 241, 250, 0.86);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.panel-accent-toolbar-actions {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
}

.panel-accent-toolbar-button {
    min-height: 30px;
    width: 100%;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(248, 252, 255, 0.96);
    font-weight: 700;
    font-size: 0.82rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel-accent-toolbar-button:disabled {
    opacity: 0.92;
    cursor: default;
}

.panel-account-overview {
    --account-label-width: 168px;
}

.panel-account-overview .panel-accent-toolbar {
    margin-bottom: 18px;
}

.panel-accent-meta,
.panel-accent-details {
    display: grid;
    grid-template-columns: var(--account-label-width) minmax(0, 1fr);
    column-gap: 18px;
    row-gap: 12px;
    align-items: start;
}

.panel-accent-meta {
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
}

.panel-accent-details {
    max-width: 520px;
}

.panel-accent-section {
    display: grid;
    gap: 16px;
}

.panel-account-overview .detail-label {
    color: rgba(228, 241, 250, 0.82);
    font-weight: 700;
}

.panel-account-overview .meta-value,
.panel-account-overview .detail-value {
    color: rgba(250, 252, 255, 0.98);
    min-width: 0;
}

.panel-account-overview .meta-value {
    font-weight: 500;
}

.panel-accent-middle {
    display: grid;
    grid-template-columns: minmax(280px, 460px) minmax(320px, 1fr);
    gap: 24px;
    align-items: start;
}

.panel-accent-middle-main,
.panel-accent-middle-side {
    min-width: 0;
}

.panel-accent-middle-side {
    display: grid;
    gap: 16px;
}

.panel-accent-info-block {
    display: grid;
    gap: 10px;
}

.panel-accent-info-title {
    color: rgba(238, 247, 252, 0.92);
    font-weight: 700;
}

.panel-accent-info-list {
    margin: 0;
    padding-left: 18px;
    color: rgba(250, 252, 255, 0.96);
    display: grid;
    gap: 6px;
}

.panel-accent-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.panel-accent-data-table {
    width: 100%;
    color: rgba(250, 252, 255, 0.96);
    min-width: 100%;
    font-size: inherit;
}

.panel-accent-data-table th,
.panel-accent-data-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    border-left-color: rgba(255, 255, 255, 0.12);
}

.panel-accent-data-table th {
    color: rgba(241, 248, 255, 0.94);
    background: rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.panel-accent-data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.panel-accent-data-table.data-table--no-hover tbody tr:hover {
    background: transparent;
}

.panel-accent-data-table tbody tr:last-child td {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.panel-accent-verify-table {
    display: grid;
    gap: 8px;
    padding-left: 18px;
}

.panel-accent-verify-row {
    display: grid;
    grid-template-columns: minmax(110px, 132px) minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.panel-accent-verify-row:last-child {
    border-bottom: 0;
}

.panel-accent-verify-serial {
    color: rgba(250, 252, 255, 0.98);
    font-weight: 700;
}

.panel-accent-verify-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: rgba(239, 247, 252, 0.92);
}

.panel-accent-verify-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    flex: 0 0 22px;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.panel-accent-verify-row.is-warning .panel-accent-verify-icon {
    background: #f0ae00;
}

.panel-accent-verify-row.is-danger .panel-accent-verify-icon {
    background: #b23658;
}

.panel-accent-verify-row.is-danger .panel-accent-verify-status {
    color: #ffd9e3;
}

@media (max-width: 980px) {
    .panel-accent-toolbar-actions {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        padding: 8px;
    }

    .panel-accent-toolbar-button {
        min-height: 28px;
        padding: 0 8px;
        font-size: 0.78rem;
    }

    .panel-accent-middle {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
}

.panel-accent-meter-prompt {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    padding: 4px 0;
    border: 0;
    background: transparent;
}

.panel-accent-meter-prompt.is-success {
    background: transparent;
}

.panel-accent-meter-prompt.is-warning {
    background: transparent;
}

.panel-accent-meter-prompt-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.panel-accent-meter-prompt.is-success .panel-accent-meter-prompt-icon {
    background: #2e8b6c;
}

.panel-accent-meter-prompt.is-warning .panel-accent-meter-prompt-icon {
    background: #f0ae00;
}

.panel-accent-meter-prompt-text {
    color: rgba(250, 252, 255, 0.98);
    font-weight: 700;
    text-align: center;
}

.panel-accent-meter-prompt-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.panel-accent-meter-prompt-action:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.32);
}

.panel-accent-divider {
    height: 1px;
    margin: 18px 0;
    background: rgba(255, 255, 255, 0.16);
}

.panel-accent-status {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
}

.panel-accent-status .status-label {
    color: rgba(233, 244, 252, 0.9);
    font-weight: 700;
}

.panel-accent-status .status-value {
    color: #fff;
    font-size: 1.15rem;
    line-height: 1;
}

.panel-accent-status-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.panel-accent-status .panel-accent-status-pay {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    white-space: nowrap;
    color: #1d5b82;
    background: #eef6fc;
    border-color: #c7dcec;
}

.panel-accent-status .panel-accent-status-pay:hover {
    color: #164866;
    background: #e2eff9;
    border-color: #b9d2e6;
}

.panel-accent-status.is-debt {
    background: rgba(255, 255, 255, 0.1);
}

.panel-accent-status.is-credit {
    background: rgba(220, 244, 255, 0.14);
}

.panel-accent-status.is-neutral {
    background: rgba(255, 255, 255, 0.07);
}

.panel-accent-note {
    margin-top: 14px;
    color: rgba(228, 241, 250, 0.72);
    font-size: 0.78rem;
    line-height: 1.45;
    text-align: right;
}

@media (max-width: 640px) {
    .panel-accent-status {
        align-items: flex-start;
    }

    .panel-accent-status-actions {
        flex-direction: column;
        align-items: flex-end;
    }
}

.precalc-total-status {
    margin-top: 10px;
    border-color: #d2e2ee;
    background: #f0f6fb;
}

.precalc-total-status .status-label {
    color: #2f5d7c;
}

.precalc-total-status .status-value {
    color: #0f3856;
}

.precalc-total-main {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.precalc-total-pay {
    margin-left: auto;
}

.precalc-total-note {
    color: var(--accent-deep);
}

.ai-assistant-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-assistant-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ai-assistant-ask-open[disabled] {
    opacity: 0.5;
    pointer-events: none;
}

.ai-assistant-ask-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fbfe;
}

.ai-assistant-ask-form[hidden] {
    display: none;
}

.ai-assistant-ask-form textarea {
    width: 100%;
    min-height: 92px;
    resize: vertical;
}

.ai-assistant-ask-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ai-assistant-formalizer-open {
    white-space: normal;
    text-align: left;
    color: #2f80ad !important;
    background: #eef7fd !important;
    border-color: #bcd9eb !important;
}

.ai-assistant-formalizer-open:hover {
    background: #e3f1fa !important;
}

.ai-formalizer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.ai-formalizer[hidden] {
    display: none;
}

.ai-formalizer-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ai-formalizer-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-formalizer-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.ai-formalizer-crumb {
    border: 0;
    background: none;
    color: var(--accent);
    font-weight: 600;
    padding: 0;
    cursor: pointer;
}

.ai-formalizer-crumb:hover {
    text-decoration: underline;
}

.ai-formalizer-sep {
    color: #6d879b;
}

.ai-formalizer-reset {
    color: #2f80ad !important;
    background: #eef7fd !important;
    border-color: #bcd9eb !important;
}

.ai-formalizer-reset:hover {
    background: #e3f1fa !important;
}

.ai-formalizer-reset[disabled] {
    opacity: 0.5;
    pointer-events: none;
}

.ai-formalizer-list {
    display: grid;
    gap: 8px;
}

.ai-formalizer-option {
    width: 100%;
    text-align: left;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #f8fbfe;
    color: var(--ink);
    padding: 10px 12px;
}

.ai-formalizer-option.is-active {
    border-color: #2f80ad;
    background: #eef7fd;
}

.ai-formalizer-params {
    display: grid;
    gap: 8px;
}

.ai-formalizer-param {
    display: grid;
    gap: 6px;
}

.ai-formalizer-period-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-formalizer-period-row input,
.ai-formalizer-param select {
    min-height: 40px;
}

.ai-formalizer-preview-wrap {
    display: grid;
    gap: 6px;
}

.ai-formalizer-preview-wrap textarea {
    width: 100%;
    min-height: 72px;
    resize: vertical;
    background: #f4f8fb;
}

.ai-formalizer-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-secondary {
    border: 1px solid #bfd3e3;
    background: #f4f8fb;
    color: #32556d;
}

.btn-secondary:hover {
    background: #eaf3f9;
}

.ai-assistant-ask-actions {
    display: flex;
    justify-content: flex-start;
}

.ai-assistant-ask-actions[hidden] {
    display: none;
}

.ai-assistant-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-assistant-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}

.ai-assistant-card-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.ai-assistant-card-question {
    font-weight: 700;
    color: var(--accent-deep);
}

.ai-assistant-card-time {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.82rem;
    color: #53758d;
}

.ai-assistant-card-body {
    color: var(--ink);
}

.ai-assistant-card-body .ai-answer-markdown p:first-child {
    margin-top: 0;
}

.ai-assistant-card-body .ai-answer-markdown p:last-child {
    margin-bottom: 0;
}

.ai-assistant-more-wrap {
    padding-top: 4px;
}

.ai-assistant-more[hidden] {
    display: none;
}

.ai-assistant-more {
    color: #2f80ad !important;
    background: #eef7fd !important;
    border-color: #bcd9eb !important;
}

.ai-assistant-more:hover {
    background: #e3f1fa !important;
}

.panel h2,
.panel h3 {
    margin-top: 0;
}

.auth-mode-switch {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #f7fbfe;
}

.auth-mode-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    color: #3b5970;
    font-weight: 600;
    white-space: nowrap;
}

.auth-mode-link:hover {
    background: #edf6fb;
    border-color: #d4e3ee;
}

.auth-mode-link.is-active {
    background: linear-gradient(135deg, var(--accent) 0%, #3f86af 100%);
    border-color: var(--accent);
    color: #fff;
}

.eyebrow {
    margin-bottom: 10px;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.page-help-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(31, 111, 159, 0.28);
    background: #f4fbff;
    color: var(--accent-deep);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.panel-accent .page-help-button {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.page-help-button:hover,
.page-help-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(31, 111, 159, 0.14);
}

.page-help-layer[hidden] {
    display: none;
}

body.admin-help-side-open {
    --admin-help-side-width: 420px;
}

body.admin-layout-workspace.admin-help-side-open .content-shell,
body.admin-layout-editor.admin-help-side-open .content-shell {
    padding-right: calc(var(--shell-padding-x) + var(--admin-help-side-width) + 18px);
}

.page-help-layer {
    --page-help-area-left: 0px;
    --page-help-area-top: 0px;
    --page-help-area-width: 100vw;
    --page-help-area-height: 100vh;
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    grid-template-columns:
        minmax(0, var(--page-help-area-left))
        minmax(0, var(--page-help-area-width))
        minmax(0, 1fr);
    place-items: start center;
    padding: calc(var(--page-help-area-top) + 18px) 0 24px;
    overflow: hidden;
}

.page-help-layer[data-page-help-mode="side"] {
    display: block;
    pointer-events: none;
    padding: 0;
    overflow: visible;
}

.page-help-layer[data-page-help-mode="side"][hidden] {
    display: none;
}

body.page-help-open,
body.page-help-open .app-body {
    overflow: hidden;
}

.page-help-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 31, 47, 0.36);
}

.page-help-layer[data-page-help-mode="side"] .page-help-backdrop {
    display: none;
}

.page-help-dialog {
    position: relative;
    grid-column: 2;
    display: flex;
    flex-direction: column;
    width: min(760px, calc(var(--page-help-area-width) - 36px));
    max-height: min(760px, calc(var(--page-help-area-height) - 36px));
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid #c9dbe7;
    background: #fff;
    color: var(--text);
    box-shadow: 0 24px 72px rgba(10, 31, 47, 0.28);
    padding: 0;
}

.page-help-layer[data-page-help-mode="side"] .page-help-dialog {
    position: fixed;
    top: var(--page-help-area-top);
    right: 18px;
    width: min(var(--admin-help-side-width, 420px), calc(100vw - 36px));
    height: calc(var(--page-help-area-height) - 8px);
    max-height: calc(var(--page-help-area-height) - 8px);
    pointer-events: auto;
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(10, 31, 47, 0.22);
}

.page-help-close {
    position: sticky;
    top: 18px;
    align-self: flex-end;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 18px 20px -50px 0;
    border-radius: 50%;
    border: 1px solid #d5e3ec;
    background: #f7fbfd;
    color: var(--accent-deep);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.page-help-content {
    min-height: 0;
    overflow: auto;
    padding: 26px 28px;
    scrollbar-gutter: stable;
}

.page-help-content h1 {
    margin: 0 40px 18px 0;
    font-size: 1.45rem;
}

.page-help-content h2 {
    margin: 22px 0 8px;
    font-size: 1.02rem;
}

.page-help-content p,
.page-help-content li {
    line-height: 1.55;
}

.admin-help-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.dev-width-mode-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid #bfd4e3;
    background: #eef6fb;
    color: #2b5976;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: none;
    vertical-align: middle;
}

.news-item + .news-item {
    border-top: 1px solid var(--line);
    margin-top: 16px;
    padding-top: 16px;
}

.news-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.article-text {
    white-space: pre-line;
    line-height: 1.6;
}

.rich-text {
    line-height: 1.65;
}

.rich-text > :first-child {
    margin-top: 0;
}

.rich-text > :last-child {
    margin-bottom: 0;
}

.rich-text h1,
.rich-text h2,
.rich-text h3 {
    margin: 0 0 14px;
    line-height: 1.2;
}

.rich-text h1 {
    font-size: 1.8rem;
}

.rich-text h2 {
    font-size: 1.45rem;
}

.rich-text h3 {
    font-size: 1.2rem;
}

.rich-text p,
.rich-text ul,
.rich-text ol {
    margin: 0 0 14px;
}

.rich-text ul,
.rich-text ol {
    padding-left: 22px;
}

.rich-text hr {
    margin: 18px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.rich-text a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.14em;
}

.rich-text .rt-primary {
    color: var(--accent);
}

.rich-text .rt-align-left {
    text-align: left;
}

.rich-text .rt-align-center {
    text-align: center;
}

.rich-text .rt-align-right {
    text-align: right;
}

.rich-text .rt-important {
    color: #b42318;
    font-weight: 700;
}

.rich-text .rt-attention {
    color: #8a5a00;
    font-weight: 700;
}

.rich-text .rt-warning {
    color: #9b2c2c;
    font-weight: 700;
}

.rich-text .rt-success {
    color: #0f6a46;
    font-weight: 700;
}

.rich-editor {
    display: grid;
    gap: 12px;
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    row-gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f7fbfe;
    align-items: center;
}

.rich-editor-toolbar button,
.rich-editor-toolbar select {
    width: auto;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #d0deea;
    background: #fff;
}

.rich-editor-toolbar button {
    cursor: pointer;
    font-weight: 600;
    color: var(--accent-deep);
    background: linear-gradient(135deg, #edf6fb 0%, #d9ebf6 100%);
}

.rich-editor-toolbar button:hover {
    border-color: #8eb9d4;
    background: linear-gradient(135deg, #e5f2fa 0%, #cfe5f3 100%);
}

.rich-editor-toolbar select {
    color: var(--ink);
}

.rich-editor-canvas {
    min-height: 320px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    outline: none;
}

.rich-editor-canvas:focus {
    border-color: #8eb9d4;
    box-shadow: 0 0 0 3px rgba(31, 111, 159, 0.12);
}

.rich-editor-note {
    margin: -2px 0 0;
    font-size: 0.92rem;
}

.contact-list,
.plain-list {
    margin: 0;
    padding-left: 18px;
}

.contact-list-compact {
    --contact-compact-label-width: 280px;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.contact-list-compact li {
    display: grid;
    grid-template-columns: var(--contact-compact-label-width) minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
}

.contact-list-compact strong {
    color: var(--ink);
    font-weight: 800;
}

.contact-list-compact span {
    min-width: 0;
    color: #334b5c;
    overflow-wrap: normal;
    word-break: normal;
}

@media (max-width: 760px) {
    .contact-list-compact {
        --contact-compact-label-width: 220px;
    }

    .contact-list-compact li {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .contact-list-compact span {
        white-space: normal;
    }
}

.contact-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.contact-card {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #f6fbff;
    border: 1px solid #d9e7f0;
}

.profile-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.channel-link-code-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.channel-link-code-value {
    margin: 0;
    font-size: 1.3rem;
    letter-spacing: 0.08em;
}

.channel-link-code-qr {
    width: min(11rem, 100%);
}

.channel-link-code-qr svg {
    display: block;
    width: 100%;
    height: auto;
}

.admin-user-logins-results-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 10px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.admin-user-logins-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    align-items: baseline;
}

.admin-user-logins-summary p {
    margin: 0;
}

.admin-user-logins-table-shell {
    height: 100%;
    max-height: none;
    min-height: 260px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    border: 1px solid rgba(180, 205, 224, 0.65);
    border-radius: 12px;
}

.table-shell--sticky.admin-user-logins-table-shell {
    overflow: auto;
}

.admin-user-logins-table-shell .data-table th {
    top: 0;
}

.admin-user-logins-table {
    border-collapse: separate;
    border-spacing: 0;
}

.admin-user-logins-table.data-table--sticky thead th {
    z-index: 6;
    background: #f7fbfe;
}

body.page-admin-user-logins .app-body {
    overflow: hidden;
}

body.page-admin-user-logins .content-scroll {
    overflow: hidden;
    min-height: 0;
}

body.page-admin-user-logins .content-shell {
    height: 100%;
    min-height: 0;
}

.admin-user-logins-layout {
    height: calc(100vh - var(--header-height) - 14px);
    height: calc(100dvh - var(--header-height) - 14px);
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr);
}

.admin-user-accounts-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: calc(100vh - var(--header-height) - 14px);
    height: calc(100dvh - var(--header-height) - 14px);
    min-height: 0;
    overflow: hidden;
}

.admin-user-accounts-layout > .section-backlink,
.admin-user-accounts-search-panel {
    flex: 0 0 auto;
}

.admin-user-accounts-search-panel {
    overflow: visible;
}

.admin-user-accounts-search-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.admin-user-accounts-search-form label {
    display: grid;
    gap: 6px;
    min-width: 0;
    font-weight: 700;
    color: #355c7f;
}

.admin-user-accounts-search-form button {
    min-height: 46px;
}

.admin-user-accounts-scroll {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 4px;
}

.admin-user-accounts-scroll > .panel,
.admin-user-accounts-scroll > .flash {
    flex: 0 0 auto;
}

.admin-user-accounts-scroll > .panel {
    overflow-y: visible;
}

.admin-user-account-result-heading {
    display: flex;
    align-items: baseline;
    gap: 8px 20px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}

body.page-admin-user-accounts .app-body {
    overflow: hidden;
}

body.page-admin-user-accounts .content-scroll {
    min-height: 0;
    overflow: hidden;
}

body.page-admin-user-accounts .content-shell {
    height: 100%;
    min-height: 0;
}

@media (max-width: 760px) {
    .admin-user-logins-table-shell {
        min-height: 220px;
    }

    .admin-user-accounts-search-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-user-accounts-search-form button {
        justify-self: stretch;
    }
}

.auth-log-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
}

.auth-log-status--success {
    color: #0c5a32;
    background: rgba(102, 187, 106, 0.18);
}

.auth-log-status--error {
    color: #8d233d;
    background: rgba(231, 76, 60, 0.16);
}

.auth-log-status--pending {
    color: #6f5400;
    background: rgba(255, 208, 90, 0.22);
}

.auth-log-status--blocked {
    color: #6d2f9d;
    background: rgba(163, 111, 214, 0.22);
}

.profile-meta {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 10px;
    align-items: start;
}

.profile-meta-label {
    font-weight: 700;
    color: var(--text);
}

.profile-meta-value {
    min-width: 0;
    color: var(--text);
}

.admin-controls {
    display: grid;
    gap: 10px;
}

.admin-quick-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.admin-control-section {
    border: 1px solid #d4e2ed;
    border-radius: 12px;
    background: #f7fbff;
    overflow: hidden;
}

.admin-control-section--attention {
    border-color: rgba(209, 17, 17, 0.35);
    box-shadow: 0 0 0 1px rgba(209, 17, 17, 0.08);
}

.admin-control-section--attention summary {
    background: #fff1f1;
}

.admin-control-section summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    padding: 11px 12px;
    font-weight: 700;
    font-size: calc(1rem + 4px);
    line-height: 1.2;
    color: #2c6188;
    background: #eaf3fa;
}

.admin-control-section summary::before {
    content: "▼";
    display: inline-block;
    width: 1rem;
    font-size: 0.82em;
    line-height: 1;
    color: #2c6188;
    transform: translateY(1px);
}

.admin-control-section:not([open]) summary::before {
    content: "▶";
}

.admin-control-section summary::-webkit-details-marker {
    display: none;
}

.admin-control-summary-title {
    display: inline-block;
    min-width: 0;
}

.admin-control-summary-note {
    display: inline-block;
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.25;
    color: #5a7388;
    text-align: left;
    max-width: 100%;
}

.admin-control-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
}

.admin-control-button {
    display: grid;
    align-content: center;
    gap: 2px;
    min-height: 54px;
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(49, 121, 177, 0.16);
    background: linear-gradient(135deg, rgba(49, 121, 177, 0.08) 0%, rgba(25, 102, 155, 0.14) 100%);
    color: #154f78;
    text-align: left;
    text-decoration: none;
}

.admin-control-button:hover {
    background: linear-gradient(135deg, rgba(49, 121, 177, 0.14) 0%, rgba(25, 102, 155, 0.2) 100%);
}

.admin-control-button--attention {
    border-color: rgba(209, 17, 17, 0.28);
    background: linear-gradient(135deg, rgba(209, 17, 17, 0.08) 0%, rgba(209, 17, 17, 0.14) 100%);
}

.admin-control-button--attention:hover {
    background: linear-gradient(135deg, rgba(209, 17, 17, 0.13) 0%, rgba(209, 17, 17, 0.19) 100%);
}

.admin-control-button--quick {
    min-height: 40px;
    text-align: center;
    justify-items: center;
    font-weight: 700;
    font-size: 1rem;
}

.admin-control-title {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
}

.admin-control-note {
    color: #3f6f93;
    font-size: 12px;
    line-height: 1.2;
}

.admin-status-meta {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 10px;
    align-items: start;
}

.admin-status-label {
    font-weight: 700;
    color: var(--text);
}

.admin-status-value {
    color: var(--text);
}

.admin-dashboard-grid {
    gap: 16px;
}

.admin-dashboard-view-tabs {
    margin: 0;
    padding: 8px;
}

.admin-metrics-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.admin-metrics-period-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-metrics-range {
    color: #5a7388;
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-metrics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.admin-metrics-kpi-grid--secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-metrics-paired-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-metrics-pair-row {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr);
    gap: 10px;
    align-items: stretch;
}

.admin-metrics-pair-row--combo {
    grid-template-columns: minmax(0, 1fr);
}

.admin-metric-combo-card {
    border: 1px solid #d4e2ed;
    border-radius: 12px;
    background: #f7fbff;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.admin-metric-combo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.admin-metric-combo-head-text {
    display: grid;
    gap: 4px;
}

.admin-metric-combo-body {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
}

.admin-metric-kpi-card--mini,
.admin-metric-chart-card--mini {
    height: 100%;
    margin: 0;
}

.admin-metric-chart-card--mini {
    align-content: stretch;
    grid-template-rows: minmax(0, 1fr);
}

.admin-metric-chart-card--mini .admin-metric-bars {
    height: 100%;
    min-height: 146px;
}

.admin-metric-kpi-card--mini {
    width: 180px;
    max-width: 180px;
    justify-self: start;
}

.admin-metric-kpi-card--mini.admin-metric-kpi-card--channels {
    width: 220px;
    max-width: 220px;
}

.admin-metric-summary {
    display: grid;
    gap: 7px;
    align-content: center;
    height: 100%;
}

.admin-metric-summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    color: #5a7388;
    font-size: 0.84rem;
}

.admin-metric-summary-row strong {
    color: #123a5a;
    font-size: 1.12rem;
}

.admin-meter-channel-summary {
    display: grid;
    gap: 5px;
    padding-top: 8px;
    border-top: 1px solid #d4e2ed;
}

.admin-meter-channel-summary-title {
    color: #355c7f;
    font-size: 0.78rem;
    font-weight: 700;
}

.admin-meter-channel-summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: #5a7388;
    font-size: 0.82rem;
}

.admin-meter-channel-summary-row strong {
    color: #123a5a;
}

.admin-metric-kpi-pair--values-only .admin-metric-kpi-pair-item {
    align-content: center;
    min-height: 64px;
}

.admin-metric-kpi-pair--values-only .admin-metric-kpi-value {
    margin: 0;
}

.admin-metric-kpi-pair.admin-metric-kpi-pair--values-only {
    grid-template-columns: 1fr;
}

.admin-metric-kpi-note--inline {
    margin-left: 8px;
    font-weight: 500;
    color: #6a8192;
}

.admin-metric-kpi-card {
    border: 1px solid #d4e2ed;
    border-radius: 12px;
    background: #f7fbff;
    padding: 10px;
    display: grid;
    gap: 6px;
}

.admin-metric-kpi-card--paired,
.admin-metric-chart-card--paired {
    height: 100%;
}

.admin-metric-kpi-title {
    color: #355c7f;
    font-size: 0.84rem;
    font-weight: 700;
}

.admin-metric-kpi-value {
    color: #123a5a;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
}

.admin-metric-kpi-note {
    color: #5a7388;
    font-size: 0.84rem;
}

.admin-metric-kpi-inline {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-metric-kpi-inline .admin-metric-kpi-value,
.admin-metric-kpi-inline .admin-metric-kpi-note {
    margin: 0;
}

.admin-metric-kpi-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.admin-metric-kpi-pair-item {
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid #dbe7f1;
    border-radius: 10px;
    background: #edf5fc;
}

.admin-metric-kpi-triple {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.admin-metric-kpi-triple-item {
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid #dbe7f1;
    border-radius: 10px;
    background: #edf5fc;
}

.admin-metric-kpi-triple.admin-metric-kpi-triple--values-only {
    grid-template-columns: 1fr;
}

.admin-metric-kpi-triple--values-only .admin-metric-kpi-triple-item {
    align-content: center;
    min-height: 56px;
}

.admin-metrics-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.admin-metric-chart-card {
    border: 1px solid #d4e2ed;
    border-radius: 12px;
    background: #f7fbff;
    padding: 10px;
    display: grid;
    gap: 8px;
    align-content: start;
}

.admin-metric-chart-card--wide {
    grid-column: 1 / -1;
}

.admin-metric-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.admin-metric-chart-head h3 {
    margin: 0;
    font-size: 1rem;
    color: #123a5a;
}

.admin-metric-bars {
    display: grid;
    grid-template-columns: repeat(var(--metric-points, 30), minmax(0, 1fr));
    gap: clamp(1px, 0.25vw, 3px);
    align-items: end;
    height: 146px;
    padding: 8px 8px 6px;
    border-radius: 10px;
    border: 1px solid #dbe8f2;
    background: #eef5fb;
}

.admin-metric-bars--compact {
    height: 90px;
    grid-template-columns: repeat(auto-fit, minmax(5px, 1fr));
    gap: 2px;
}

.admin-metric-bar-col {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch;
    height: 100%;
    min-height: 100%;
}

.admin-metric-bar-track {
    height: 100%;
    display: flex;
    align-items: end;
}

.admin-metric-bar {
    width: 100%;
    min-height: 0;
    border-radius: 3px 3px 0 0;
    background: #2f80ad;
    position: relative;
    overflow: visible;
}

.admin-metric-day {
    display: block;
    margin-top: 4px;
    text-align: center;
    font-size: 0.64rem;
    line-height: 1.1;
    color: #6f8698;
    white-space: nowrap;
}

.admin-metric-day.is-month-boundary {
    font-weight: 700;
    color: #2c5878;
}

.admin-metric-day.is-hidden {
    visibility: hidden;
}

.admin-metric-day.is-hidden-auto {
    visibility: hidden;
}

.admin-metric-bar-value {
    position: absolute;
    left: 50%;
    top: -13px;
    transform: translateX(-50%);
    font-size: 0.62rem;
    line-height: 1;
    color: #4a6780;
    white-space: nowrap;
    pointer-events: none;
}

.admin-metric-bar-value.is-hidden-auto {
    display: none;
}

.admin-metric-bar--meters {
    background: #0b6aa8;
}

.admin-metric-bar--ai {
    background: #4d6ea8;
}

.admin-metric-bar--email {
    background: #4f9cbf;
}

.admin-metric-bar--telegram {
    background: #2d89c8;
}

.admin-metric-bar--viber {
    background: #7360f2;
}

.admin-metric-bar--push {
    background: #6f8ec7;
}

.admin-metric-channel-grid {
    display: grid;
    gap: 8px;
}

.admin-metric-channel-item {
    border: 1px solid #dbe8f2;
    border-radius: 10px;
    padding: 8px;
    background: #fbfdff;
}

.admin-metric-channel-title {
    font-weight: 700;
    color: #123a5a;
    margin-bottom: 2px;
}

.admin-metric-channel-kpi {
    color: #5a7388;
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.panel-actions {
    margin-top: 10px;
}

body.page-admin-user-logins .section-backlink--standalone {
    width: 100%;
    margin: 0 0 8px;
    position: static;
    top: auto;
    backdrop-filter: none;
    background: transparent;
    padding: 0;
}

@media (max-width: 1024px) {
    .admin-metrics-pair-row {
        grid-template-columns: 1fr;
    }

    .admin-metric-combo-body {
        grid-template-columns: 1fr;
    }

    .admin-metric-kpi-card--mini {
        width: auto;
        max-width: none;
        justify-self: stretch;
    }

    .admin-metric-kpi-pair.admin-metric-kpi-pair--values-only {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-metrics-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-metrics-kpi-grid--secondary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-metrics-charts-grid {
        grid-template-columns: 1fr;
    }

    .admin-quick-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-control-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 760px) {
    .admin-metrics-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-metrics-kpi-grid {
        grid-template-columns: 1fr;
    }

    .admin-metrics-kpi-grid--secondary {
        grid-template-columns: 1fr;
    }

    .admin-control-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.admin-filter-form {
    display: grid;
    gap: 12px;
}

.admin-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-filter-grid label {
    display: grid;
    gap: 6px;
    font-weight: 700;
    color: #355c7f;
}

.admin-action-link {
    color: #1f5f95 !important;
}

.admin-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.admin-pagination {
    margin-top: 10px;
}

.admin-inline-form {
    display: inline-flex;
}

.admin-inline-form button {
    min-height: 38px;
    border-radius: 10px;
    padding: 0 12px;
    background: #2f80ad;
    color: #fff;
}

.admin-icon-action,
.admin-inline-form .admin-icon-action {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 10px;
}

.admin-icon-action svg {
    width: 18px;
    height: 18px;
}

.admin-icon-action--danger,
.admin-inline-form .admin-icon-action--danger {
    border: 1px solid #e0b6bf;
    background: #fff1f3;
    color: #9b2f43;
}

.admin-icon-action--danger:hover,
.admin-icon-action--danger:focus-visible {
    background: #fbe3e7;
    color: #84263a;
}

.admin-empty-state {
    margin: 0;
}

.admin-table-checkbox {
    width: 18px;
    height: 18px;
    padding: 0;
    vertical-align: middle;
}

.admin-tariffs-layout {
    grid-template-columns: minmax(0, 1fr);
}

.admin-tariffs-header {
    grid-column: 1;
}

.admin-tariffs-table {
    min-width: 720px;
}

.admin-tariffs-table .admin-tariff-row {
    cursor: pointer;
}

.admin-tariffs-table .admin-tariff-row:focus-visible {
    outline: 2px solid #4f8fb3;
    outline-offset: -2px;
}

.tariffs-actions-dialog {
    width: min(92vw, 460px);
    margin: 16px auto 0;
}

.tariffs-action-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.tariffs-action-list button {
    width: 100%;
    text-align: left;
}

.tariffs-editor-dialog {
    width: min(94vw, 720px);
    max-height: calc(100vh - 32px);
    margin: 16px auto 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tariffs-editor-dialog textarea {
    resize: vertical;
}

.tariffs-date-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.admin-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #edf3f7;
    color: #496273;
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
}

.admin-status-badge--info {
    background: #e8f1f8;
    color: #2a678f;
}

.admin-status-badge--success {
    background: #dff5e7;
    color: #1d7a48;
}

.admin-status-badge--danger {
    background: #fbe3e7;
    color: #a52f45;
}

.admin-status-badge--warning {
    background: #fff1c9;
    color: #725500;
}

.admin-status-badge--blocked {
    background: #eee4f7;
    color: #6d2f9d;
}

.admin-detail-card {
    display: grid;
    gap: 10px;
}

.admin-detail-card h3 {
    margin: 6px 0 0;
}

.admin-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
}

.admin-code-block {
    margin: 0;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #d2dfea;
    background: #f7fbff;
    color: #173a56;
    white-space: pre-wrap;
    word-break: break-word;
}

.admin-details {
    border: 1px solid #d2dfea;
    border-radius: 10px;
    background: #fbfdff;
    padding: 8px 10px;
}

.admin-details summary {
    cursor: pointer;
    font-weight: 700;
    color: #355c7f;
}

.offline-exchange-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: calc(100vh - var(--header-height) - 14px);
    height: calc(100dvh - var(--header-height) - 14px);
    min-height: 0;
    overflow: hidden;
}

.offline-exchange-shell {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.offline-exchange-tabs {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow: hidden;
}

.offline-exchange-tabs > .admin-tabs-nav {
    flex: 0 0 auto;
}

.offline-exchange-tab-pane {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 2px 4px 4px 0;
}

.offline-exchange-tab-pane.is-active {
    display: block;
}

.offline-exchange-pane-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 2px 0 10px;
    border-bottom: 1px solid var(--line);
    background: #f8fbff;
}

.offline-exchange-pane-header h3 {
    margin: 2px 0 0;
}

.offline-exchange-pane-header .eyebrow {
    margin-bottom: 0;
}

.offline-exchange-edit-lock {
    display: grid;
    gap: 12px;
}

.offline-exchange-edit-toolbar {
    display: flex;
    justify-content: flex-end;
}

.offline-exchange-edit-toggle {
    min-width: 210px;
    background: #e7f0f6;
    color: #234a68;
    border: 1px solid #a9c3d5;
}

.offline-exchange-edit-toggle:hover {
    background: #dbeaf3;
}

.offline-exchange-edit-toggle[aria-pressed="true"] {
    background: #1f5f95;
    color: #fff;
    border-color: #174f78;
    box-shadow: inset 0 2px 4px rgba(11, 48, 77, 0.28);
}

.offline-exchange-edit-fields {
    display: grid;
    gap: 12px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.offline-exchange-settings-section {
    display: grid;
    gap: 10px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--line);
}

.offline-exchange-settings-section + .offline-exchange-settings-section {
    padding-top: 2px;
}

.offline-exchange-settings-section h4 {
    margin: 0;
    color: var(--ink);
}

.offline-exchange-settings-section p {
    margin: 0;
}

.offline-exchange-edit-fields[disabled] {
    opacity: 0.68;
}

.offline-exchange-meta {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px 14px;
    margin: 0;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
}

.offline-exchange-meta div {
    min-width: 0;
}

.offline-exchange-meta dt {
    margin: 0 0 2px;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.offline-exchange-meta dd {
    margin: 0;
    color: var(--ink);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.offline-exchange-token-value input {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.offline-exchange-details {
    border: 0;
    padding: 0;
    background: transparent;
}

.offline-exchange-details summary {
    padding: 4px 0;
}

.offline-exchange-details pre {
    margin: 12px 0 0;
}

.offline-exchange-upload-form,
.offline-exchange-token-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 10px 12px;
    align-items: end;
}

.offline-exchange-upload-form label,
.offline-exchange-token-form label {
    display: grid;
    gap: 6px;
    min-width: 0;
    font-weight: 700;
    color: #355c7f;
}

.offline-exchange-upload-form > p,
.offline-exchange-token-form > p {
    grid-column: 1 / -1;
    margin: 0;
}

body.page-admin-offline-exchange .app-body {
    overflow: hidden;
}

body.page-admin-offline-exchange .content-scroll {
    min-height: 0;
    overflow: hidden;
}

body.page-admin-offline-exchange .content-shell {
    height: 100%;
    min-height: 0;
}

.admin-meter-settings-page {
    min-height: calc(100vh - var(--header-height) - 58px);
    min-height: calc(100dvh - var(--header-height) - 58px);
}

.admin-meter-settings-panel {
    width: 100%;
    align-self: stretch;
}

.admin-meter-settings-group {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(53, 92, 127, 0.16);
    border-radius: 8px;
    background: rgba(245, 248, 252, 0.62);
}

.admin-meter-controller-source {
    display: grid;
    gap: 6px;
    align-content: start;
    font-weight: 700;
    color: #355c7f;
}

.admin-meter-rule-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-meter-rule-stack {
    display: grid;
    gap: 16px;
}

.admin-meter-rule-block {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(53, 92, 127, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
}

.admin-meter-rule-grid label {
    display: grid;
    gap: 6px;
    align-content: start;
    font-weight: 700;
    color: #355c7f;
}

.admin-meter-rule-stack > label,
.admin-meter-rule-block > label,
.admin-meter-receive-types {
    display: grid;
    gap: 6px;
    align-content: start;
    font-weight: 700;
    color: #355c7f;
}

.admin-meter-receive-types {
    max-height: 260px;
    overflow: auto;
    padding: 10px;
    border: 1px solid rgba(53, 92, 127, 0.14);
    border-radius: 8px;
    background: #fff;
}

.admin-meter-receive-types .label-title {
    margin-bottom: 4px;
}

.admin-meter-receive-types .check-row {
    color: #24384d;
    font-weight: 600;
}

@media (max-width: 900px) {
    .admin-tariffs-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-tariffs-header {
        grid-column: auto;
    }

    .tariffs-date-grid {
        grid-template-columns: 1fr;
    }

    .admin-filter-grid {
        grid-template-columns: 1fr;
    }

    .admin-meter-rule-grid {
        grid-template-columns: 1fr;
    }

    .admin-detail-meta {
        grid-template-columns: 1fr;
    }

    .offline-exchange-meta {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .offline-exchange-upload-form,
    .offline-exchange-token-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .offline-exchange-upload-form > p,
    .offline-exchange-token-form > p {
        grid-column: auto;
    }
}

@media (max-width: 760px) {
    .profile-meta {
        grid-template-columns: 170px minmax(0, 1fr);
        column-gap: 12px;
        row-gap: 8px;
    }
}

@media (max-width: 520px) {
    .profile-meta {
        grid-template-columns: 1fr;
        row-gap: 4px;
    }

    .offline-exchange-pane-header {
        display: grid;
    }

    .offline-exchange-meta {
        grid-template-columns: 1fr 1fr;
    }
}

.section-backlink {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.section-backlink--standalone {
    width: min(100%, var(--content-max-width));
    position: sticky;
    top: 8px;
    z-index: 12;
    margin: 0 auto 8px;
    padding: 4px 0;
    background: linear-gradient(180deg, rgba(231, 241, 248, 0.96) 0%, rgba(231, 241, 248, 0.78) 100%);
    backdrop-filter: blur(6px);
}

body.admin-layout-editor .section-backlink--standalone,
body.admin-layout-workspace .section-backlink--standalone {
    width: 100%;
}

.section-backlink-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--muted);
}

.table-shell {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
}

.table-shell--sticky {
    overflow: visible;
}

.table-shell > .data-table {
    min-width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    background: transparent;
}

.data-table th,
.data-table td {
    padding: 5px 6px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    line-height: 1.2;
}

.data-table th + th,
.data-table td + td {
    border-left: 1px solid rgba(211, 225, 235, 0.9);
}

.data-table th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5a7183;
    white-space: nowrap;
    background: #f8fbfe;
}

.data-table tbody tr:hover {
    background: #f6fbff;
}

.data-table--clickable tbody tr:not(.row-description-row):not(.master-detail-row):hover {
    background: #edf7fc;
}

.data-table--no-hover tbody tr:hover {
    background: transparent;
}

.data-table tbody tr.is-selected,
.data-table tbody tr.selected {
    background: #e5f2fa;
}

.data-table tbody tr.admin-row-inactive td {
    color: #6b7f8f;
}

.data-table--sticky thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f7fbfe;
    box-shadow: inset 0 -1px 0 var(--line);
}

.data-table--compact th,
.data-table--compact td {
    padding: 4px 5px;
}

.data-table td.numeric,
.data-table th.numeric,
.data-table .numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table .nowrap {
    white-space: nowrap;
}

.data-table td.centered,
.data-table th.centered,
.centered {
    text-align: center;
}

.query-cell-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.query-cell-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 6px;
    border-radius: 999px;
    border: 1px solid rgba(28, 82, 118, 0.2);
    background: rgba(28, 82, 118, 0.08);
    color: #1c5276;
    font-size: 0.72rem;
    line-height: 1;
    vertical-align: middle;
}

.query-cell-link-button:hover {
    background: rgba(28, 82, 118, 0.16);
}

.table-cell-style-warning {
    color: #8c5f00;
    font-weight: 700;
}

.table-cell-style-hard-warning {
    color: #b2384e;
    font-weight: 700;
}

.table-cell-style-success {
    color: #1f7a49;
    font-weight: 700;
}

.table-cell-style-info {
    color: #1f5f8d;
    font-weight: 600;
}

.table-cell-style-muted {
    color: #6a7f92;
}

.table-cell-style-canceled {
    background: rgba(113, 117, 122, 0.9);
    color: #f5f7fa;
    font-weight: 600;
}

.panel-accent-data-table td.table-cell-style-warning {
    color: #ffd86f;
}

.panel-accent-data-table td.table-cell-style-hard-warning {
    color: #ff9eb0;
}

.panel-accent-data-table td.table-cell-style-success {
    color: #aef3c8;
}

.panel-accent-data-table td.table-cell-style-info {
    color: #b6e8ff;
}

.panel-accent-data-table td.table-cell-style-muted {
    color: rgba(227, 241, 250, 0.74);
}

.panel-accent-data-table td.table-cell-style-canceled {
    background: rgba(228, 233, 239, 0.3);
    color: #f7fbff;
}

.panel-accent-data-table .query-cell-link-button {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.16);
    color: rgba(252, 254, 255, 0.96);
}

.panel-accent-data-table .query-cell-link-button:hover {
    background: rgba(255, 255, 255, 0.24);
}

.data-table--clickable tbody tr:not(.row-description-row):not(.master-detail-row) {
    cursor: pointer;
}

.data-table--clickable tbody tr:not(.row-description-row):not(.master-detail-row) > td:first-child {
    position: relative;
}

.data-table--clickable tbody tr:not(.row-description-row):not(.master-detail-row):hover > td:first-child::before,
.data-table--clickable tbody tr.is-selected > td:first-child::before,
.data-table--clickable tbody tr.selected > td:first-child::before {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 3px;
    border-radius: 999px;
    background: rgba(31, 111, 159, 0.72);
}

.data-table--clickable tbody tr.is-selected > td:first-child::before,
.data-table--clickable tbody tr.selected > td:first-child::before {
    width: 5px;
    background: var(--accent-deep);
}

.data-table--clickable tbody tr.is-selected,
.data-table--clickable tbody tr.selected {
    background: #dceefa;
}

.data-table--clickable tbody tr.is-selected:hover,
.data-table--clickable tbody tr.selected:hover {
    background: #d4e9f7;
}

.panel-accent-data-table.data-table--clickable tbody tr:not(.row-description-row):not(.master-detail-row):hover {
    background: rgba(255, 255, 255, 0.08);
}

.panel-accent-data-table tbody tr.is-selected,
.panel-accent-data-table tbody tr.selected {
    background: rgba(255, 255, 255, 0.12);
}

.panel-accent-data-table.data-table--clickable tbody tr.is-selected:hover,
.panel-accent-data-table.data-table--clickable tbody tr.selected:hover {
    background: rgba(255, 255, 255, 0.16);
}

.panel-accent-data-table.data-table--clickable tbody tr:not(.row-description-row):not(.master-detail-row):hover > td:first-child::before,
.panel-accent-data-table.data-table--clickable tbody tr.is-selected > td:first-child::before,
.panel-accent-data-table.data-table--clickable tbody tr.selected > td:first-child::before {
    background: rgba(255, 255, 255, 0.72);
}

.panel-accent-data-table.data-table--clickable tbody tr.is-selected > td:first-child::before,
.panel-accent-data-table.data-table--clickable tbody tr.selected > td:first-child::before {
    width: 5px;
    background: rgba(255, 255, 255, 0.94);
}

.data-table--clickable tbody tr:focus-visible {
    outline: 2px solid rgba(31, 111, 159, 0.24);
    outline-offset: -2px;
}

.data-table--clickable tbody tr a {
    position: relative;
    z-index: 1;
}

.data-table tbody tr.row-description-row:hover {
    background: transparent;
}

.data-table tbody tr.row-description-row {
    display: none;
}

.data-table--clickable tbody tr.row-description-row {
    cursor: default;
}

.data-table td.row-description-cell {
    color: var(--accent);
    padding-left: 10px;
}

.master-row-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #d0deea;
    background: #f4faff;
    color: var(--accent-deep);
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.master-row-toggle:hover {
    background: #edf6fb;
    border-color: #8eb9d4;
}

.master-row-toggle[aria-expanded="true"] {
    background: linear-gradient(135deg, #edf6fb 0%, #d9ebf6 100%);
}

.master-detail-row {
    display: none;
}

.master-detail-row.is-open {
    display: table-row;
}

.master-detail-row > td {
    padding: 0;
    background: #fbfdff;
}

.master-detail-panel {
    padding: 16px;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 18px;
}

.master-detail-panel > :last-child {
    margin-bottom: 0;
}

.charge-detail-table thead th {
    border-top: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 6;
    background: #f7fbfe;
    box-shadow: inset 0 -1px 0 var(--line);
}

.query-col {
    display: none;
}

.query-caption-short {
    display: none;
}

.table-result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
}

.table-result-badge--success {
    background: #dff5e7;
    color: #1d7a48;
}

.table-result-badge--danger {
    background: #fbe3e7;
    color: #b2384e;
}

.table-result-badge--info {
    background: #e8f1f8;
    color: #2a678f;
}

.selected {
    background: #f3f9fd;
}

.table-cell-with-hint {
    cursor: help;
    text-decoration: underline dotted rgba(31, 111, 159, 0.45);
    text-underline-offset: 2px;
}

.query-header-with-hint {
    cursor: help;
}

.query-header-with-hint .query-caption-long,
.query-header-with-hint .query-caption-short {
    text-decoration: underline dotted currentColor;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.table-cell-hint-popup {
    position: fixed;
    z-index: 1200;
    max-width: min(420px, calc(100vw - 16px));
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #bcd5e4;
    background: #f4fbff;
    color: var(--accent-deep);
    box-shadow: 0 10px 26px rgba(19, 63, 90, 0.2);
    font-size: 0.88rem;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #edf3f8;
    color: #4f6678;
    font-size: 0.82rem;
    font-weight: 700;
}

.tag-active {
    background: #dceffc;
    color: #135f89;
}

.tag-primary {
    background: #ddebf5;
    color: #2f6486;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.actions-cell--nowrap {
    flex-wrap: nowrap;
    white-space: nowrap;
}

.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    background: #f1f7fb;
    border: 1px solid #d0deea;
    font-weight: 600;
    color: var(--ink);
}

.action-link[disabled],
.action-link.action-link--disabled,
.action-link.is-disabled {
    opacity: 0.62;
    cursor: not-allowed;
    pointer-events: none;
}

.danger-link {
    color: #8d1e24;
    background: #fff4f4;
    border-color: #ebc9cb;
}

.form-panel form {
    display: grid;
    gap: 12px;
}

.captcha-image {
    display: block;
    width: 158px;
    height: 50px;
    margin: -2px 0 4px;
    border-radius: 9px;
    user-select: none;
}

.admin-content-toolbar {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-start;
    margin-bottom: 12px;
}

.admin-content-list-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: calc(100vh - var(--header-height) - 14px);
    height: calc(100dvh - var(--header-height) - 14px);
    min-height: 0;
    overflow: hidden;
}

.admin-content-list-layout > .section-backlink {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.admin-content-list-layout > .flash {
    flex: 0 0 auto;
}

.admin-content-list-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-content-list-table-shell {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

body:is(.page-admin-news, .page-admin-contacts, .page-admin-tariffs) .app-body {
    overflow: hidden;
}

body:is(.page-admin-news, .page-admin-contacts, .page-admin-tariffs) .content-scroll {
    min-height: 0;
    overflow: hidden;
}

body:is(.page-admin-news, .page-admin-contacts, .page-admin-tariffs) .content-shell {
    height: 100%;
    min-height: 0;
}

.admin-notification-queue-layout {
    gap: 12px;
}

.admin-notification-queue-filter-panel,
.admin-notification-delivery-filter-panel,
.admin-operational-filter-panel {
    flex: 0 0 auto;
    overflow: visible;
}

.controller-device-activation-code-panel {
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 132px;
    padding-top: 22px;
    padding-bottom: 22px;
    overflow: visible;
}

.controller-device-activation-code-panel .eyebrow,
.controller-device-activation-code-panel .staff-activation-code,
.controller-device-activation-code-panel .muted {
    display: block;
    line-height: 1.35;
    overflow-wrap: normal;
    word-break: normal;
}

.admin-compact-filter {
    padding-top: 10px;
    padding-bottom: 10px;
}

.admin-compact-filter-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 38px;
}

.admin-compact-filter-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.admin-compact-filter-values {
    display: flex;
    align-items: center;
    gap: 8px 20px;
    min-width: 0;
    flex-wrap: wrap;
    color: var(--muted);
}

.admin-compact-filter-values strong {
    color: var(--ink);
}

.admin-compact-filter-open {
    flex: 0 0 auto;
}

.pay-confirm-modal__dialog.admin-compact-filter-dialog {
    width: min(92vw, 720px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: 16px auto 0;
    overflow-y: auto;
}

.admin-compact-filter-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-compact-filter-fields > label {
    display: grid;
    gap: 6px;
    min-width: 0;
    font-weight: 700;
    color: #355c7f;
}

.admin-compact-filter-limit {
    max-width: 180px;
}

.admin-compact-filter-fields .admin-compact-filter-checkbox {
    display: flex;
    min-height: 46px;
    align-items: center;
    align-self: end;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
}

.admin-compact-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.admin-notification-queue-list-panel > .eyebrow,
.admin-notification-queue-list-panel > .admin-result-meta,
.admin-notification-queue-list-panel > .muted,
.admin-notification-queue-list-panel > .admin-pagination,
.admin-operational-list-panel > .eyebrow,
.admin-operational-list-panel > .flash,
.admin-operational-list-panel > .admin-result-meta,
.admin-operational-list-panel > .muted,
.admin-operational-list-panel > .admin-pagination {
    flex: 0 0 auto;
}

body:is(
    .page-admin-notifications-queue,
    .page-admin-notifications-delivery-log,
    .page-admin-offline-imports,
    .page-admin-ai-requests,
    .page-admin-ai-blocks,
    .page-admin-meter-review
) .app-body {
    overflow: hidden;
}

body:is(
    .page-admin-notifications-queue,
    .page-admin-notifications-delivery-log,
    .page-admin-offline-imports,
    .page-admin-ai-requests,
    .page-admin-ai-blocks,
    .page-admin-meter-review
) .content-scroll {
    min-height: 0;
    overflow: hidden;
}

body:is(
    .page-admin-notifications-queue,
    .page-admin-notifications-delivery-log,
    .page-admin-offline-imports,
    .page-admin-ai-requests,
    .page-admin-ai-blocks,
    .page-admin-meter-review
) .content-shell {
    height: 100%;
    min-height: 0;
}

body.page-admin-meter-review .content-x-scroll {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

body:is(.page-admin-notifications-queue, .page-admin-offline-imports) .admin-detail-card {
    position: fixed;
    inset: 16px;
    z-index: 1301;
    width: min(calc(100vw - 32px), 1280px);
    height: min(calc(100vh - 32px), 980px);
    height: min(calc(100dvh - 32px), 980px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    box-shadow: 0 0 0 100vmax rgba(13, 28, 41, 0.48), 0 18px 44px rgba(19, 42, 27, 0.24);
}

body.page-admin-ai-requests .admin-scroll-detail-card {
    position: fixed;
    inset: 16px;
    z-index: 1301;
    width: min(calc(100vw - 32px), 1280px);
    height: min(calc(100vh - 32px), 980px);
    height: min(calc(100dvh - 32px), 980px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    box-shadow: 0 0 0 100vmax rgba(13, 28, 41, 0.48), 0 18px 44px rgba(19, 42, 27, 0.24);
}

body:is(.page-admin-notifications-queue, .page-admin-offline-imports) .admin-detail-card-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

body:is(.page-admin-notifications-queue, .page-admin-offline-imports) .admin-detail-card-header .eyebrow {
    margin-bottom: 0;
}

body.page-admin-ai-requests .admin-scroll-detail-card .admin-detail-card-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

body.page-admin-ai-requests .admin-scroll-detail-card .admin-detail-card-header .eyebrow {
    margin-bottom: 0;
}

body:is(.page-admin-notifications-queue, .page-admin-offline-imports) .admin-detail-card-body {
    flex: 1 1 auto;
    min-height: 0;
    display: block;
    overflow-y: auto;
    padding-top: 12px;
    padding-right: 4px;
}

body.page-admin-ai-requests .admin-scroll-detail-card .admin-detail-card-body {
    flex: 1 1 auto;
    min-height: 0;
    display: block;
    overflow-y: auto;
    padding-top: 12px;
    padding-right: 4px;
}

body:is(.page-admin-notifications-queue, .page-admin-offline-imports) .admin-detail-card-body > * + * {
    margin-top: 12px;
}

body.page-admin-ai-requests .admin-scroll-detail-card .admin-detail-card-body > * + * {
    margin-top: 12px;
}

body:is(.page-admin-notifications-queue, .page-admin-offline-imports) .admin-detail-card-body .table-shell {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
}

@media (max-width: 900px) {
    .admin-compact-filter-summary {
        align-items: flex-start;
    }

    .admin-compact-filter-values {
        gap: 6px 14px;
    }
}

@media (max-width: 620px) {
    .admin-compact-filter-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-compact-filter-controls {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .admin-compact-filter-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-compact-filter-limit {
        max-width: none;
    }

    .admin-compact-filter-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }
}

.admin-news-table .admin-news-row {
    cursor: pointer;
}

.admin-news-table .admin-news-row:focus-visible {
    outline: 2px solid #4f8fb3;
    outline-offset: -2px;
}

.admin-contacts-table .admin-contacts-row {
    cursor: pointer;
}

.admin-contacts-table .admin-contacts-row:focus-visible {
    outline: 2px solid #4f8fb3;
    outline-offset: -2px;
}

.news-actions-dialog {
    width: min(92vw, 460px);
}

.contacts-actions-dialog {
    width: min(92vw, 460px);
}

.news-editor-dialog {
    width: min(96vw, 1280px);
    height: min(calc(100vh - 32px), 980px);
    max-height: calc(100vh - 32px);
    margin-top: 16px;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.contacts-editor-dialog {
    width: min(94vw, 720px);
    max-height: calc(100vh - 32px);
    margin-top: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.admin-modal-editor-dialog > h3 {
    flex: 0 0 auto;
}

.admin-modal-editor-form {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.admin-modal-editor-body {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    gap: 10px;
    overflow-y: auto;
    padding-right: 4px;
}

.admin-modal-editor-actions {
    flex: 0 0 auto;
    margin-top: 0;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.news-preview-dialog {
    width: min(94vw, 920px);
    max-height: 88vh;
    overflow: auto;
}

.news-preview-body {
    margin-top: 10px;
    max-height: 58vh;
    overflow: auto;
    border: 1px solid #d0deea;
    border-radius: 12px;
    padding: 12px 14px;
    background: #f9fcff;
}

.news-action-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.contacts-action-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.news-action-list button {
    width: 100%;
    text-align: left;
}

.contacts-action-list button {
    width: 100%;
    text-align: left;
}

.news-action-list button[disabled] {
    opacity: 0.56;
    cursor: not-allowed;
}

.news-action-divider {
    border-top: 1px solid #d5e4ee;
    margin: 4px 0;
}

.contacts-action-divider {
    border-top: 1px solid #d5e4ee;
    margin: 4px 0;
}

.news-editor-dialog form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    height: 100%;
}

.news-editor-dialog .rich-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    flex: 1 1 auto;
}

.news-editor-dialog .rich-editor-toolbar {
    max-height: 168px;
    overflow-y: auto;
    overflow-x: hidden;
}

.news-editor-dialog .rich-editor-canvas {
    min-height: 180px;
    height: auto;
    flex: 1 1 auto;
    max-height: none;
    overflow-y: auto;
}

.news-editor-dialog .actions-cell {
    margin-top: 4px;
}

.contacts-editor-dialog .actions-cell {
    margin-top: 4px;
}

@media (max-width: 680px), (max-height: 760px) {
    .news-editor-dialog .rich-editor-toolbar {
        max-height: 128px;
    }

    .news-editor-dialog .rich-editor-canvas {
        min-height: 140px;
    }
}

input,
button,
select,
textarea {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #c8d9e5;
    background: #fff;
}

button {
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

button.action-link {
    color: var(--ink);
    background: #f1f7fb;
    border: 1px solid #d0deea;
}

.error {
    color: var(--warn);
    font-weight: 700;
}

strong {
    font-weight: 800;
}

.success {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #eef8fd;
    border: 1px solid #c7e0ee;
}

.error-block {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff1f1;
    border: 1px solid #ebc9cb;
    color: #8d1e24;
    font-weight: 700;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-content-editor-panel {
    display: flex;
    flex-direction: column;
    height: min(calc(100vh - 150px), 980px);
    min-height: 560px;
    overflow: hidden;
}

.admin-content-shell {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: calc(100vh - var(--header-height) - 24px);
    height: calc(100dvh - var(--header-height) - 24px);
    min-height: 0;
    overflow: hidden;
}

.admin-content-header {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.admin-content-layout {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
}

.admin-content-shell .admin-content-editor-panel {
    height: 100%;
    min-height: 0;
}

body.page-admin-content .app-body {
    overflow: hidden;
}

body.page-admin-content .content-scroll {
    overflow: hidden;
    min-height: 0;
}

body.page-admin-content .content-shell {
    height: 100%;
    min-height: 0;
}

.admin-content-editor-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
}

.admin-content-rich-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.admin-content-rich-toolbar {
    max-height: 168px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 0 0 auto;
}

.admin-content-editor-canvas {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

.admin-content-editor-save {
    margin-top: auto;
    flex: 0 0 auto;
}

@media (max-width: 760px), (max-height: 780px) {
    .admin-content-shell {
        height: calc(100vh - var(--header-height) - 14px);
        height: calc(100dvh - var(--header-height) - 14px);
    }

    .admin-content-rich-toolbar {
        max-height: 130px;
    }
}

.check-row input {
    width: auto;
}

.meter-submit-form {
    gap: 20px;
}

.meter-submit-form .check-row {
    margin-top: 14px;
}

.meter-submit-form button[type="submit"] {
    margin-top: 8px;
}

.meter-submit-workspace {
    display: grid;
    gap: 18px;
}

.meter-submit-workspace-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: -6px -6px 0;
    padding: 8px 8px 14px;
    border-bottom: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    background: #f8fbfd;
}

.meter-submit-view-buttons {
    flex: 0 0 auto;
}

.meter-submit-pane[hidden] {
    display: none;
}

.meter-submit-pane {
    display: grid;
    gap: 16px;
}

.meter-submit-subpanel {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.meter-submit-period {
    margin: 0 0 2px;
}

.meter-submit-subpanel + .meter-submit-subpanel {
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.meter-submit-log-panel {
    border-top: 1px solid var(--line);
}

.meter-submit-photo-history-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.meter-submit-photo-history-head p {
    margin: 4px 0 0;
}

.meter-submit-photo-history-list {
    display: grid;
    gap: 12px;
}

.meter-submit-photo-history-item {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(180px, 0.85fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
}

.meter-submit-photo-history-main,
.meter-submit-photo-history-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.meter-submit-photo-history-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.meter-confirmation-targets {
    display: grid;
    gap: 12px;
    max-height: 56vh;
    overflow-y: auto;
    padding: 2px;
}

.meter-confirmation-target {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
}

.meter-confirmation-target-main {
    display: grid;
    gap: 4px;
}

.meter-confirmation-status {
    color: #2f6e54;
    font-size: 0.9rem;
}

.meter-confirmation-status--required {
    color: #a26000;
    font-weight: 700;
}

.meter-confirmation-preview {
    display: block;
    width: 74px;
    height: 74px;
    padding: 0;
    border: 1px solid var(--line);
    background: #fff;
    cursor: zoom-in;
    overflow: hidden;
}

.meter-confirmation-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.meter-confirmation-image-modal[hidden] {
    display: none;
}

.meter-confirmation-image-modal {
    position: fixed;
    z-index: 2147483647;
    inset: 0;
}

.meter-confirmation-image-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 36, 53, 0.62);
}

.meter-confirmation-image-dialog-content {
    position: fixed;
    top: 16px;
    bottom: 16px;
    left: 50%;
    width: calc(100vw - 32px);
    max-width: 920px;
    transform: translateX(-50%);
    box-sizing: border-box;
    padding: 48px 16px 16px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 20px 48px rgba(16, 36, 53, 0.28);
    overflow: auto;
}

.meter-confirmation-image-dialog-content img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 96px);
    margin: 0 auto;
    object-fit: contain;
}

.meter-confirmation-image-dialog-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-grid;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    place-items: center;
}

.meter-submit-result-modal[hidden] {
    display: none;
}

.meter-submit-result-modal {
    position: fixed;
    z-index: 2147483647;
    inset: 0;
}

.meter-submit-result-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 36, 53, 0.62);
}

.meter-submit-result-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100vw - 32px);
    max-width: 460px;
    max-height: calc(100vh - 32px);
    box-sizing: border-box;
    padding: 40px 20px 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(16, 36, 53, 0.28);
    overflow: auto;
}

.android-webview .meter-submit-result-content {
    top: 16px;
    bottom: 16px;
    transform: translateX(-50%);
    max-height: none;
}

.meter-submit-result-title {
    margin: 0 0 12px;
    font-size: 1.15rem;
}

.meter-submit-result-body p {
    margin: 4px 0;
}

.meter-submit-result-photo-note {
    margin-top: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface, #f4f7fa);
}

.meter-submit-result-photo-note p {
    margin: 0 0 10px;
}

.meter-submit-result-photo-button {
    width: 100%;
}

.meter-submit-result-ok {
    margin-top: 16px;
    width: 100%;
}

.meter-submit-result-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-grid;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    place-items: center;
}

.meter-confirmation-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface, #f4f7fa);
}

.meter-confirmation-banner--required {
    border-color: #d98a00;
    background: #fff7e6;
}

.meter-confirmation-banner-text {
    flex: 1 1 240px;
}

.meter-confirmation-banner-button {
    flex: 0 0 auto;
}

.meter-confirmation-modal[hidden] {
    display: none;
}

.meter-confirmation-modal {
    position: fixed;
    /* На один нижче за перегляд фото, щоб фото відкривалося поверх цього popup. */
    z-index: 2147483646;
    inset: 0;
}

.meter-confirmation-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 36, 53, 0.62);
}

.meter-confirmation-modal-content {
    position: fixed;
    top: 16px;
    bottom: 16px;
    left: 50%;
    width: calc(100vw - 32px);
    max-width: 720px;
    transform: translateX(-50%);
    box-sizing: border-box;
    padding: 48px 16px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(16, 36, 53, 0.28);
    overflow: auto;
}

.android-webview .meter-confirmation-modal-content .meter-confirmation-targets {
    max-height: none;
    overflow: visible;
}

.meter-confirmation-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-grid;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    place-items: center;
}

.meter-review-claim--free {
    color: #2f6e54;
}

.meter-review-claim--taken {
    color: #a26000;
    font-weight: 600;
}

.meter-review-info {
    display: grid;
    gap: 4px;
}

.admin-meter-review-detail .meter-review-info {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: center;
}

.admin-meter-review-detail {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
}

.admin-meter-review-workspace-panel {
    display: grid;
    min-height: 0;
    overflow: hidden;
    padding: 10px;
}

.admin-meter-review-workspace {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 0;
    max-height: none;
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    padding: 4px 8px 14px 4px;
    scrollbar-gutter: stable;
}

.meter-review-workspace-section {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfcfd;
}

.meter-review-target-tabs {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 0 8px;
    background: #fbfcfd;
}

.meter-review-target-tab {
    display: inline-grid;
    gap: 2px;
    min-width: 150px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #355c7f;
    text-align: left;
    cursor: pointer;
}

.meter-review-target-tab span {
    font-weight: 700;
}

.meter-review-target-tab small {
    color: var(--muted);
}

.meter-review-target-tab.is-active {
    border-color: var(--accent);
    background: #edf6fb;
    color: var(--accent-deep);
}

.admin-meter-review-detail .meter-confirmation-targets {
    max-height: none;
    overflow: visible;
    padding: 0;
}

.admin-meter-review-detail .meter-review-target-panels {
    display: block;
}

.admin-meter-review-detail .meter-review-target-panels .meter-confirmation-target + .meter-confirmation-target {
    margin-top: 0;
}

.admin-meter-review-detail .meter-review-target-panels .meter-confirmation-target[hidden] {
    display: none;
}

.admin-meter-review-detail .meter-confirmation-target {
    align-items: start;
    min-width: 0;
}

.admin-meter-review-detail .meter-confirmation-target-main {
    min-width: 0;
}

.admin-meter-review-detail .meter-review-accept-form {
    justify-self: end;
    align-self: center;
}

.admin-meter-review-detail .meter-review-target-actions,
.admin-meter-review-detail .meter-review-decision-form {
    grid-column: 1 / -1;
    order: 10;
}

.meter-review-claim-history,
.meter-review-decision-history {
    margin: 6px 0 0;
    padding-left: 18px;
}

.meter-review-reasons {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.meter-review-reason-card {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
}

.meter-review-reason-title,
.meter-review-reason-meta,
.meter-review-reason-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
}

.meter-review-reason-title {
    color: #24445f;
}

.meter-review-reason-meta,
.meter-review-reason-detail {
    font-size: 0.88rem;
}

.meter-review-reason-detail span {
    padding: 3px 8px;
    border-radius: 999px;
    background: #edf6fb;
    color: #24445f;
}

.meter-review-target-actions,
.meter-review-decision-form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.meter-review-target-actions {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
}

.admin-meter-review-detail .meter-review-decision-form {
    grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) auto;
    align-items: end;
}

.admin-meter-review-detail .meter-review-reupload-form {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.admin-meter-review-detail .meter-review-target-actions .meter-review-decision-form {
    grid-column: auto;
    order: initial;
    margin-top: 0;
}

.meter-review-decision-form label {
    display: grid;
    gap: 4px;
    font-size: 0.84rem;
    font-weight: 700;
    color: #355c7f;
}

.meter-review-photo-history {
    grid-column: 1 / -1;
    order: 20;
    min-width: 0;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
}

.meter-review-photo-history summary {
    cursor: pointer;
    color: #355c7f;
    font-weight: 700;
}

.meter-review-photo-history-list {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-gutter: stable;
}

.meter-review-photo-history-item {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) 96px 132px minmax(220px, 280px) 72px auto;
    min-width: 760px;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    font-size: 0.9rem;
}

.meter-review-photo-history-status {
    font-weight: 600;
}

.meter-review-photo-history-actor {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meter-review-photo-history-open {
    display: inline-grid;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--accent-deep);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    place-items: center;
}

.meter-review-photo-history-open:hover {
    border-color: var(--accent);
    background: #edf6fb;
}

@media (max-width: 760px) {
    .meter-review-target-actions {
        grid-template-columns: 1fr;
    }

    .admin-meter-review-detail .meter-review-accept-form {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .admin-meter-review-detail .meter-review-decision-form {
        grid-template-columns: 1fr;
    }

    .meter-review-photo-history-item {
        grid-template-columns: 1fr;
    }
}

.meter-confirmation-upload-form {
    display: grid;
    justify-items: stretch;
    gap: 8px;
    min-width: 180px;
}

.meter-confirmation-upload-form input[type="file"] {
    max-width: 180px;
}

@media (max-width: 680px) {
    .meter-submit-workspace-head {
        align-items: stretch;
    }

    .meter-submit-view-buttons {
        justify-content: flex-start;
    }

    .meter-submit-photo-history-item {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .meter-submit-photo-history-meta {
        grid-column: 1 / -1;
        order: 3;
    }

    .meter-confirmation-target {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .meter-confirmation-upload-form {
        grid-column: 1 / -1;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .meter-confirmation-upload-form input[type="file"] {
        max-width: 100%;
        min-width: 0;
    }
}

.meter-entry-table th,
.meter-entry-table td {
    vertical-align: middle;
}

.meter-entry-input {
    width: 84px;
    min-width: 0;
    max-width: 100%;
    padding: 8px 8px;
    border: 2px solid #1f5f95;
    background: #f2f8fc;
    box-shadow: inset 0 0 0 1px rgba(31, 95, 149, 0.08);
    text-align: right;
}

.meter-entry-input:hover {
    border-color: #174f78;
    background: #fff;
}

.meter-entry-input:focus,
.meter-entry-input:focus-visible {
    border-color: #123f68;
    background: #fff;
    outline: 2px solid rgba(31, 95, 149, 0.35);
    outline-offset: 2px;
}

.meter-check-date {
    white-space: nowrap;
}

.meter-check-date--warning {
    color: #b27b00;
    font-weight: 700;
}

.meter-check-date--expired {
    color: #b2384e;
    font-weight: 800;
}

.meter-entry-table tfoot th {
    border-top: 2px solid var(--line);
    background: #f7fbfe;
}

body.page-meters .app-body {
    overflow: hidden;
}

body.page-meters .content-shell,
body.page-meters .content-scroll,
body.page-meters .content-x-scroll {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.meters-page {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meters-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    overflow: hidden;
}

.meter-panel-selector {
    overflow: hidden;
}

.meter-selector-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.meter-selector-head .eyebrow {
    margin-bottom: 0;
}

.meter-selector-title-row {
    flex: 1 1 auto;
    min-width: 0;
}

.meter-view-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.meter-view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #eef4fb;
    color: #0e4d7f;
    padding: 6px 12px;
    font-weight: 600;
    text-decoration: none;
}

.meter-view-button:hover {
    background: #e5eef8;
}

.meter-view-button.is-active {
    background: #0b6aa8;
    border-color: #0b6aa8;
    color: #fff;
}

@media (max-width: 760px) {
    .meter-selector-head {
        align-items: center;
        gap: 8px;
    }

    .meter-selector-title-row {
        gap: 8px;
    }

    .meter-view-buttons {
        flex: 0 0 auto;
        gap: 6px;
    }

    .meter-view-button {
        width: 34px;
        height: 34px;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
    }

    .meter-view-button::before {
        content: attr(data-short-label);
        font-size: 0.9rem;
        font-weight: 800;
        line-height: 1;
    }
}

.meter-panel-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.meter-panel-main .meter-table-shell {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.meter-panel-main .meter-table-shell > .data-table {
    min-width: 100%;
}

.inline-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 16px;
}

.pay-grid {
    align-items: start;
}

.pay-panel h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.pay-panel {
    position: sticky;
    top: 58px;
    z-index: 8;
}

.pay-form {
    display: grid;
    gap: 10px;
    margin-top: 8px;
    width: 100%;
}

.pay-form label {
    font-weight: 700;
    color: #2b4d64;
}

.pay-doc-card {
    border: 1px solid #d7e5ef;
    border-radius: 12px;
    padding: 12px;
    background: #f9fcff;
    margin-top: 12px;
}

.pay-doc-card h3 {
    margin: 0 0 8px;
    font-size: 1.02rem;
}

.pay-form-inline {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.pay-field {
    display: grid;
    gap: 8px;
    min-width: 220px;
    flex: 1 1 260px;
}

.pay-inline-submit {
    white-space: nowrap;
    min-height: 42px;
}

.pay-period-hint {
    margin: 0;
}

.pay-period-warning {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.35;
}

.pay-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.pay-method-start-form {
    display: none;
}

.pay-method-card {
    min-height: 170px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #35579b;
    background: linear-gradient(180deg, #4968ad 0%, #3f5f9f 100%);
    color: #fff;
    display: grid;
    align-content: stretch;
    justify-items: center;
    gap: 10px;
    text-align: center;
}

.pay-method-card:hover {
    border-color: #6f90c7;
    background: linear-gradient(180deg, #4f6fb8 0%, #4666ab 100%);
}

.pay-method-card:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.pay-method-title {
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 0.01em;
    align-self: center;
}

.pay-method-logo {
    width: min(100%, 240px);
    max-height: 86px;
    object-fit: contain;
    align-self: center;
}

.pay-method-state {
    color: rgba(255, 255, 255, 0.94);
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    align-self: end;
}

.pay-method-note {
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.8rem;
    line-height: 1.25;
}

.pay-confirm-modal[hidden] {
    display: none;
}

.pay-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
}

.pay-confirm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 28, 41, 0.48);
}

.pay-confirm-modal__dialog {
    position: relative;
    width: min(92vw, 440px);
    margin: 14vh auto 0;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid #c8d9e5;
    background: #fff;
    box-shadow: 0 18px 44px rgba(19, 42, 27, 0.24);
}

.pay-confirm-modal__dialog h3 {
    margin: 0 0 10px;
}

.admin-chat-archive-modal {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.pay-confirm-modal__dialog.admin-chat-archive-dialog {
    width: min(calc(100vw - 32px), 1360px);
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.admin-chat-archive-dialog .admin-detail-card-header {
    flex: 0 0 auto;
}

.admin-chat-archive-dialog .admin-detail-card-header h3 {
    margin: 2px 0 0;
}

.admin-chat-archive-dialog .admin-detail-meta {
    flex: 0 0 auto;
    margin: 10px 0 0;
    min-height: 0;
}

.admin-chat-archive-separator {
    flex: 0 0 auto;
    height: 1px;
    margin: 14px 0 0;
    background: #d7e3ec;
}

.admin-chat-archive-dialog h4 {
    flex: 0 0 auto;
    margin: 12px 0 0;
}

.admin-chat-archive-dialog .chat-messages {
    flex: 1 1 auto;
    min-height: 180px;
    margin-bottom: 0;
    padding-right: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.admin-audit-log-modal {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.pay-confirm-modal__dialog.admin-audit-log-dialog {
    width: min(calc(100vw - 32px), 1280px);
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.admin-audit-log-dialog .admin-detail-card-header {
    flex: 0 0 auto;
}

.admin-audit-log-dialog .admin-detail-card-header h3 {
    margin: 2px 0 0;
}

.admin-audit-log-dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    gap: 12px;
    padding-right: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.pay-confirm-modal__line {
    margin: 6px 0;
}

.pay-confirm-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.pay-confirm-modal__actions .action-link {
    color: var(--ink);
    background: #f1f7fb;
    border: 1px solid #d0deea;
}

.pay-confirm-modal__dialog.news-actions-dialog {
    width: min(92vw, 460px);
    margin: 16px auto 0;
}

.pay-confirm-modal__dialog.contacts-actions-dialog {
    width: min(92vw, 460px);
    margin: 16px auto 0;
}

.pay-confirm-modal__dialog.news-editor-dialog {
    width: min(96vw, 1280px);
    height: min(calc(100vh - 32px), 980px);
    max-height: calc(100vh - 32px);
    margin: 16px auto 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.pay-confirm-modal__dialog.contacts-editor-dialog {
    width: min(94vw, 720px);
    max-height: calc(100vh - 32px);
    margin: 16px auto 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pay-confirm-modal__dialog.tariffs-actions-dialog {
    width: min(92vw, 460px);
    margin: 16px auto 0;
}

.pay-confirm-modal__dialog.tariffs-editor-dialog {
    width: min(94vw, 720px);
    max-height: calc(100vh - 32px);
    margin: 16px auto 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pay-confirm-modal__dialog.news-preview-dialog {
    width: min(94vw, 920px);
    max-height: calc(100vh - 32px);
    margin: 16px auto 0;
    overflow: auto;
}

.notifications-panel .eyebrow {
    margin-bottom: 10px;
}

.notifications-list {
    display: grid;
    gap: 12px;
}

.notification-card {
    border: 1px solid #d3e1eb;
    border-radius: 14px;
    padding: 12px 14px;
    background: #f9fcff;
}

.notification-card--unread {
    border-color: #9ec5dd;
    background: #eef7fd;
}

.notification-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.notification-card-head h3 {
    margin: 0;
    font-size: 1rem;
    color: #12395a;
}

.notification-card-time {
    font-size: 0.78rem;
    color: #5a7183;
    white-space: nowrap;
}

.notification-card-body {
    margin: 0;
    line-height: 1.45;
    white-space: pre-line;
}

.notification-card--collapsed .notification-card-body {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-card-accounts {
    margin-top: 10px;
    display: grid;
    gap: 6px;
}

.notification-card--collapsed .notification-card-accounts {
    display: none;
}

.notification-card-accounts-title {
    font-weight: 700;
    color: #204f72;
}

.notification-card-accounts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.notification-card-accounts-list--stack {
    display: grid;
    gap: 4px;
}

.notification-card-account-line {
    color: #1e4668;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.notification-card-account-action {
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    color: #1d5f90;
    background: #e9f4fd;
    border: 1px solid #c7deef;
}

.notification-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.notification-card-actions form {
    margin: 0;
}

.notification-card-actions .action-link {
    min-height: 34px;
    color: #1f5f95;
}

.notification-card-toggle {
    color: #17517e;
}

.notifications-more-note {
    margin-top: 12px;
}

@media (max-width: 760px) {
    .notification-card {
        padding: 11px 12px;
    }

    .notification-card-head {
        flex-direction: column;
        gap: 6px;
    }

    .notification-card-time {
        white-space: normal;
    }

    .notification-card-actions .action-link {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

@keyframes topbarQuickPulse {
    0% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.22);
    }
    100% {
        filter: brightness(1);
    }
}

@media (min-width: 1441px) {
    .show-xl {
        display: table-cell;
    }

    .show-desc-xl {
        display: table-row !important;
    }
}

@media (min-width: 1241px) and (max-width: 1440px) {
    .show-lg {
        display: table-cell;
    }

    .show-desc-lg {
        display: table-row !important;
    }
}

@media (max-width: 1440px) {
    :root {
        --content-max-width: 940px;
        --shell-padding-x: 20px;
    }
}

@media (min-width: 1121px) and (max-width: 1240px) {
    .show-md {
        display: table-cell;
    }

    .show-desc-md {
        display: table-row !important;
    }

    :root {
        --sidebar-width: 184px;
        --content-max-width: 880px;
        --shell-padding-x: 16px;
        --shell-padding-bottom: 20px;
        --panel-padding: 22px;
        --topbar-card-width: 220px;
        --topbar-user-card-width: 275px;
        --topbar-gap: 14px;
        --topbar-card-gap: 10px;
        --topbar-logo-width: 152px;
        --topbar-logo-gap: 10px;
        --brand-mark-size: 40px;
        --brand-mark-radius: 12px;
        --brand-name-size: 1.05rem;
        --brand-section-size: 0.78rem;
        --body-font-size: 15px;
        --sidebar-padding-y: 18px;
        --sidebar-padding-x: 14px;
        --sidebar-link-min-height: 46px;
        --sidebar-link-font-size: 0.91rem;
        --sidebar-sublink-min-height: 40px;
        --sidebar-sublink-font-size: 0.86rem;
    }
}

@media (max-width: 760px) {
    .meter-entry-input {
        width: 68px;
        padding: 6px 6px;
    }
}

@media (min-width: 761px) and (max-width: 1120px) {
    .show-sm {
        display: table-cell;
    }

    .show-desc-sm {
        display: table-row !important;
    }

    .query-caption-long {
        display: none;
    }

    .query-caption-short {
        display: inline;
    }

    .topbar {
        gap: 12px;
        padding: 0 12px;
    }

    .topbar-quick {
        overflow: visible;
        padding-bottom: 0;
    }

    .topbar-quick-inner {
        padding: 0 18px;
    }

    .topbar-quick-mobile {
        display: none;
    }

    .topbar-quick-track {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-width: 0;
        gap: 7px;
    }

    .topbar-quick-button {
        min-height: 31px;
        padding: 0 8px;
        font-size: 0.78rem;
    }

    .topbar-quick-button--with-icon {
        justify-content: center;
        gap: 5px;
    }

    .topbar-quick-icon {
        width: 20px;
        height: 20px;
        flex: 0 0 20px;
    }

    .qa-label-full {
        display: none;
    }

    .qa-label-md {
        display: inline;
    }

    .content-shell {
        padding: 0 18px 18px;
    }

    .app-sidebar {
        justify-content: flex-start;
    }

    .sidebar-nav {
        flex: 0 0 auto;
        align-content: start;
    }

    :root {
        --header-height: 120px;
        --sidebar-width: 168px;
        --content-max-width: 820px;
        --panel-padding: 20px;
        --topbar-card-width: 200px;
        --topbar-user-card-width: 250px;
        --topbar-logo-width: 132px;
        --topbar-logo-gap: 8px;
        --body-font-size: 14px;
        --brand-name-size: 0.98rem;
        --brand-section-size: 0.74rem;
        --sidebar-link-font-size: 0.88rem;
        --sidebar-sublink-font-size: 0.84rem;
    }
}

@media (max-width: 760px) {
    .show-xs {
        display: table-cell;
    }

    .show-desc-xs {
        display: table-row !important;
    }

    .query-caption-long {
        display: none;
    }

    .query-caption-short {
        display: inline;
    }

    :root {
        --sidebar-width: 72px;
        --header-height: 84px;
        --content-max-width: 760px;
        --shell-padding-x: 14px;
        --panel-padding: 18px;
        --topbar-card-width: 184px;
        --topbar-user-card-width: 232px;
        --topbar-logo-width: var(--sidebar-width);
        --topbar-logo-gap: 8px;
        --body-font-size: 14px;
        --brand-name-size: 0.94rem;
        --brand-section-size: 0.7rem;
    }

    .topbar,
    .topbar.topbar-auth {
        overflow: visible;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .topbar-main {
        gap: 8px;
    }

    .topbar-logo-slot {
        left: 0;
        width: var(--sidebar-width);
    }

    .topbar-auth-body {
        padding: 0 10px;
    }

    .topbar-inline-card {
        padding: 7px 10px;
    }

    .topbar-quick {
        overflow: visible;
        padding-bottom: 0;
    }

    .topbar-quick-inner {
        padding: 0 8px 0 0;
    }

    .topbar-quick-track {
        display: none;
    }

    .topbar-quick-mobile {
        display: block;
        margin-top: 2px;
    }

    .topbar-quick-sheet {
        display: block;
    }

    .topbar-quick-sheet-backdrop {
        background: rgba(13, 28, 41, 0.26);
    }

    .topbar-quick-sheet-panel {
        left: calc(var(--sidebar-width) + 6px);
        right: auto;
        top: calc(var(--header-height) - 2px);
        bottom: auto;
        width: min(var(--content-max-width), calc(100vw - var(--sidebar-width) - 12px));
        max-height: calc(100vh - var(--header-height) - 8px);
        border-radius: 14px;
        border-bottom: 1px solid #c7dae8;
        box-shadow: 0 18px 36px rgba(16, 36, 53, 0.22);
    }

    .topbar-quick-mobile-toggle {
        min-height: 36px;
    }

    .topbar-quick-mobile-notify {
        min-width: 104px;
        min-height: 36px;
        padding: 0 9px;
        font-size: 0.74rem;
    }

    .topbar-quick-mobile-copy strong {
        font-size: 0.86rem;
    }

    .topbar-quick-mobile-copy span {
        display: none;
    }

    .topbar-quick-mobile-copy {
        gap: 0;
    }

    .topbar-quick-mobile-badges {
        display: none;
    }

    .pay-panel {
        top: 52px;
    }

    .pay-form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .pay-field {
        min-width: 100%;
        flex: 0 0 auto;
    }

    .pay-inline-submit {
        width: 100%;
    }

    .app-sidebar {
        justify-content: flex-start;
        padding-left: 8px;
        padding-right: 8px;
        overflow: visible;
    }

    .sidebar-nav {
        flex: 0 0 auto;
        align-content: start;
    }

    .sidebar-link {
        justify-content: center;
        padding: 0;
        overflow: visible;
        min-height: 44px;
    }

    .sidebar-subnav {
        padding-left: 0;
    }

    .sidebar-auth-entry {
        padding-bottom: 14px;
        margin-bottom: 14px;
    }

    .sidebar-label {
        display: none;
    }

    .sidebar-icon {
        width: 22px;
        height: 22px;
        flex-basis: 22px;
    }

    .sidebar-icon svg,
    .sidebar-icon-svg {
        width: 21px;
        height: 21px;
    }

    .sidebar-tooltip {
        position: absolute;
        left: calc(100% + 10px);
        top: 50%;
        z-index: 1300;
        display: block;
        max-width: min(260px, calc(100vw - var(--sidebar-width) - 24px));
        padding: 7px 10px;
        border: 1px solid #c7dae8;
        border-radius: 10px;
        background: #ffffff;
        box-shadow: 0 12px 24px rgba(16, 36, 53, 0.18);
        color: #263f50;
        font-size: 0.78rem;
        font-weight: 700;
        line-height: 1.2;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-50%) translateX(-4px);
        transition: opacity 0.14s ease, transform 0.14s ease;
        white-space: normal;
    }

    .sidebar-link:hover .sidebar-tooltip,
    .sidebar-link:focus-visible .sidebar-tooltip {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }

    .sidebar-version,
    .sidebar-copyright {
        display: none;
    }
}

@media (max-width: 760px) {
    :root {
        --sidebar-width: 64px;
        --header-height: 84px;
        --content-max-width: 700px;
        --shell-padding-x: 8px;
        --shell-padding-bottom: 28px;
        --panel-padding: 14px;
        --topbar-card-width: 168px;
        --topbar-user-card-width: 210px;
        --topbar-logo-width: var(--sidebar-width);
        --topbar-logo-gap: 8px;
        --topbar-gap: 10px;
        --topbar-card-gap: 8px;
        --topbar-padding-x: 12px;
        --brand-gap: 10px;
        --brand-mark-size: 36px;
        --brand-mark-radius: 10px;
        --brand-name-size: 0.88rem;
        --brand-section-size: 0.66rem;
        --body-font-size: 13px;
    }

    .switcher-menu {
        min-width: 220px;
    }

    .account-switcher .switcher-backdrop,
    .switcher-backdrop.switcher-backdrop--portal-mobile {
        position: fixed;
        inset: 0;
        background: rgba(13, 28, 41, 0.26);
        z-index: 1210;
    }

    .account-switcher .switcher-backdrop[hidden],
    .switcher-backdrop.switcher-backdrop--portal-mobile[hidden] {
        display: none !important;
    }

    .account-switcher .switcher-menu.switcher-menu--accounts,
    .switcher-menu.switcher-menu--accounts.switcher-menu--portal-mobile {
        position: fixed;
        left: calc(var(--sidebar-width) + 6px);
        right: auto;
        top: calc(var(--header-height) - 2px);
        width: min(520px, calc(100vw - var(--sidebar-width) - 12px));
        max-width: min(520px, calc(100vw - var(--sidebar-width) - 12px));
        max-height: calc(100vh - var(--header-height) - 8px);
        overflow: auto;
        border-radius: 14px;
        border: 1px solid #c7dae8;
        box-shadow: 0 18px 36px rgba(16, 36, 53, 0.22);
        z-index: 1211;
    }

    .content-shell {
        padding: 0 8px 28px 0;
    }

    .topbar-card-label {
        font-size: 0.62rem;
    }

    .sidebar-link,
    .sidebar-sublink {
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    :root {
        --sidebar-width: 56px;
        --header-height: 84px;
        --shell-padding-x: 6px;
        --shell-padding-bottom: 36px;
        --panel-padding: 12px;
        --topbar-card-width: 156px;
        --topbar-user-card-width: 196px;
        --topbar-logo-width: var(--sidebar-width);
        --topbar-logo-gap: 6px;
        --body-font-size: 12px;
    }

    .topbar-auth-body {
        padding: 0 6px;
    }

    .topbar-logo-slot {
        left: 0;
        width: var(--sidebar-width);
    }

    .topbar-quick-button {
        min-height: 33px;
        font-size: 0.72rem;
    }

    .topbar-quick-mobile-notify {
        min-width: 94px;
        min-height: 34px;
        font-size: 0.7rem;
    }

    .topbar-quick-mobile-toggle {
        min-height: 34px;
    }

    .pay-panel {
        top: 48px;
    }

    .content-shell {
        padding: 0 6px 36px 0;
    }

    .topbar-quick-inner {
        padding: 0 6px 0 0;
    }

    .app-sidebar {
        padding-left: 6px;
        padding-right: 6px;
    }

    .sidebar-link {
        min-height: 40px;
        border-radius: 10px;
    }

    .sidebar-icon {
        font-size: 0.88rem;
    }
}
.ai-assistant-ask-open {
  color: #ffffff !important;
  background-color: #2f80ad !important;
  border-color: #2f80ad !important;
}

.ai-assistant-ask-open[disabled] {
  color: #6f7f8f;
  background-color: #e9eef4;
  border-color: #c8d4e2;
}
.ai-assistant-card-head {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "question toggle"
        "meta meta";
    gap: 6px 10px;
    align-items: start;
}

.ai-assistant-card-question {
    grid-area: question;
}

.ai-card-toggle {
    grid-area: toggle;
    color: #1f5f95 !important;
    background: #eaf2f8 !important;
}

.ai-assistant-card-time {
    grid-area: meta;
}

.ai-assistant-card-preview {
    margin-top: 8px;
    color: #355c7f;
    line-height: 1.35;
}

.ai-assistant-card.is-collapsed .ai-assistant-card-body {
    display: none;
}

.ai-assistant-toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-assistant-collapse-all {
    color: #1f5f95 !important;
}

.ai-assistant-more,
.ai-assistant-formalizer-open,
.ai-formalizer-reset {
    color: #1f5f95 !important;
}

.ai-formalizer-raw-shell,
.ai-formalizer-builder-shell {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: calc(100vh - var(--header-height) - 24px);
    height: calc(100dvh - var(--header-height) - 24px);
    min-height: 0;
    overflow: hidden;
}

.ai-formalizer-page-header {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.ai-formalizer-source {
    margin: 0;
    overflow-wrap: anywhere;
}

.ai-formalizer-raw-grid,
.ai-formalizer-builder-grid {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
}

.ai-formalizer-raw-panel,
.ai-formalizer-builder-panel {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.ai-formalizer-raw-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-formalizer-raw-panel h2 {
    margin: 0;
}

.form-panel form.ai-formalizer-raw-form {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ai-formalizer-raw-editor {
    flex: 1 1 auto;
    min-height: 0;
    resize: none;
}

.ai-formalizer-save-actions {
    display: flex;
    justify-content: flex-end;
    flex: 0 0 auto;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.ai-formalizer-save-actions button {
    width: min(280px, 100%);
}

.ai-formalizer-builder-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-formalizer-builder {
    display: grid;
    grid-template-columns: minmax(320px, 40%) 1fr;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
}

.admin-formalizer-builder-left,
.admin-formalizer-builder-right {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 10px;
    background: #f6f9fc;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.admin-formalizer-builder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.admin-formalizer-builder-actions .action-link,
.admin-formalizer-builder-right .action-link {
    color: #1f5f95 !important;
}

.admin-formalizer-tree {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border-top: 1px solid var(--line);
    padding-top: 8px;
}

.admin-formalizer-tree-topic,
.admin-formalizer-tree-subtopic,
.admin-formalizer-tree-item {
    margin-bottom: 6px;
}

.admin-formalizer-tree-subtopic {
    margin-left: 16px;
}

.admin-formalizer-tree-item {
    margin-left: 16px;
}

.admin-formalizer-tree-node {
    width: 100%;
    text-align: left;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: #12395a;
    padding: 7px 10px;
    cursor: pointer;
}

.admin-formalizer-tree-node.is-active {
    border-color: #2f7db3;
    background: #eaf2f8;
}

.admin-formalizer-editor {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.admin-formalizer-field {
    display: grid;
    gap: 6px;
}

.admin-formalizer-field > span {
    font-size: 13px;
    color: #355c7f;
}

.admin-formalizer-field-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #355c7f;
}

.admin-formalizer-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #7aa4c6;
    color: #1f5f95;
    background: #eef5fb;
    font-weight: 700;
    font-size: 12px;
    cursor: help;
}

.admin-formalizer-help-note {
    margin-top: 6px;
    padding: 8px 10px;
    border: 1px dashed #b9cfe2;
    border-radius: 8px;
    background: #f0f6fb;
    color: #355c7f;
    font-size: 12px;
    line-height: 1.4;
}

.admin-formalizer-field input,
.admin-formalizer-field textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--line);
    padding: 8px 10px;
    font-family: var(--font-body);
}

.admin-formalizer-field textarea.is-error {
    border-color: #ad1e1e;
}

.admin-formalizer-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    text-align: left;
}

.admin-formalizer-checkbox input[type="checkbox"] {
    width: auto;
    min-width: 16px;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
}

.admin-formalizer-checkbox span {
    display: inline-block;
}

body.page-admin-ai-formalizer .app-body,
body.page-admin-ai-formalizer-builder .app-body {
    overflow: hidden;
}

body.page-admin-ai-formalizer .content-scroll,
body.page-admin-ai-formalizer-builder .content-scroll {
    overflow: hidden;
    min-height: 0;
}

body.page-admin-ai-formalizer .content-shell,
body.page-admin-ai-formalizer-builder .content-shell {
    height: 100%;
    min-height: 0;
}

.admin-code-editor {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}

.admin-template-preview-text {
    white-space: pre-wrap;
}

.admin-template-preview-html {
    margin-top: 6px;
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
    overflow-wrap: anywhere;
}

body.page-admin-notification-templates .app-body {
    overflow: hidden;
}

body.page-admin-notification-templates .content-shell {
    height: 100%;
    min-height: 0;
}

body.page-admin-notification-templates .content-scroll {
    min-height: 0;
    overflow: hidden;
}

body.page-admin-notification-templates .content-x-scroll {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.notification-templates-page {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.notification-templates-page > .section-backlink,
.notification-templates-page > .flash {
    flex: 0 0 auto;
}

.notification-templates-page > .section-backlink {
    margin-bottom: 0;
}

.notification-templates-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
    gap: 16px;
    align-items: stretch;
    overflow: hidden;
}

.notification-templates-editor-panel,
.notification-template-preview-panel {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notification-template-panel-header {
    flex: 0 0 auto;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.notification-template-panel-header h2 {
    margin: 0;
}

.notification-template-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-top: 14px;
    padding-right: 4px;
}

.notification-template-source {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 16px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.notification-template-source > div {
    min-width: 0;
    padding: 10px 12px;
}

.notification-template-source > div + div {
    border-left: 1px solid var(--line);
}

.notification-template-source dt {
    color: #5a7183;
    font-size: 0.78rem;
    font-weight: 700;
}

.notification-template-source dd {
    margin: 4px 0 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.notification-template-selector {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.notification-template-selector .admin-form-actions {
    margin: 0;
}

.notification-template-selector select {
    width: min(100%, 520px);
}

.notification-template-form {
    min-width: 0;
}

.notification-viber-policy {
    margin: 1rem 0 1.25rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--accent-soft);
}

.notification-viber-policy h3 {
    margin: 0.25rem 0 0.75rem;
}

.notification-viber-policy-notes {
    margin: 0.75rem 0;
}

.notification-viber-policy-notes p {
    margin: 0.4rem 0;
}

.notification-template-form .admin-tab-pane {
    min-width: 0;
}

.notification-template-form textarea {
    resize: vertical;
}

.notification-template-save-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.notification-template-save-actions button {
    width: min(280px, 100%);
}

.notification-template-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.notification-template-table-wrap .data-table {
    min-width: 620px;
}

.notification-template-preview-panel {
    position: static;
}

.notification-template-preview-panel pre {
    max-width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
    overflow: auto;
}

@media (max-width: 1120px) {
    .notification-templates-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    }
}

@media (max-width: 680px) {
    .notification-template-source {
        grid-template-columns: minmax(0, 1fr);
    }

    .notification-template-source > div + div {
        border-top: 1px solid var(--line);
        border-left: 0;
    }
}

.admin-collapsible {
    margin-top: 16px;
}

.admin-collapsible > summary {
    cursor: pointer;
    font-weight: 700;
    margin: 0 0 10px;
    list-style: none;
}

.admin-collapsible > summary::-webkit-details-marker {
    display: none;
}

.admin-collapsible > summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.15s ease;
}

.admin-collapsible[open] > summary::before {
    transform: rotate(90deg);
}

.admin-tabs {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    margin: 10px 0 14px;
    background: #f8fbff;
}

.admin-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.admin-tab-link {
    border: 1px solid var(--line);
    background: #eef4fb;
    color: #0e4d7f;
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 600;
    cursor: pointer;
}

.admin-tab-link.is-active {
    background: #0b6aa8;
    border-color: #0b6aa8;
    color: #fff;
}

.admin-tab-pane {
    display: none;
}

.admin-tab-pane.is-active {
    display: block;
}

.payment-settings-grid {
    min-width: 0;
}

.payment-settings-panel {
    min-width: 0;
    overflow: visible;
}

.payment-settings-tabs {
    margin: 0;
    min-width: 0;
}

.payment-settings-pane {
    min-width: 0;
}

.payment-settings-pane h2 {
    margin-top: 0;
}

.payment-provider-form {
    min-width: 0;
}

.payment-provider-enabled {
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
}

.payment-provider-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    min-width: 0;
}

.payment-provider-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.payment-provider-field--wide {
    grid-column: 1 / -1;
}

.payment-provider-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.payment-provider-actions button {
    width: min(280px, 100%);
}

@media (max-width: 760px) {
    .payment-provider-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .payment-provider-field--wide {
        grid-column: auto;
    }

    .payment-provider-actions {
        justify-content: stretch;
    }

    .payment-provider-actions button {
        width: 100%;
    }
}

.banners-shell {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: calc(100vh - var(--header-height) - 24px);
    height: calc(100dvh - var(--header-height) - 24px);
    min-height: 0;
    overflow: hidden;
}

.banners-backlink {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.banners-grid {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

.banners-panel {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.banners-editor {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.banners-selector-block {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 3;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: #f8fbff;
}

.banners-selector-form {
    display: grid;
    gap: 8px;
}

.banners-selector-note {
    margin: 8px 0 0;
}

.banners-editor-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.banners-editor-form {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.banners-editor-fields {
    display: grid;
    gap: 10px;
}

.banners-form-actions {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.banners-secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 20px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #eef4fb;
    color: #0e4d7f;
    font-weight: 700;
}

.banners-secondary-link:hover {
    background: #e4eff9;
}

body.page-admin-banners .app-body {
    overflow: hidden;
}

body.page-admin-banners .content-scroll {
    overflow: hidden;
    min-height: 0;
}

body.page-admin-banners .content-shell {
    height: 100%;
    min-height: 0;
}

@media (max-width: 760px) {
    .banners-shell {
        height: calc(100vh - var(--header-height) - 14px);
        height: calc(100dvh - var(--header-height) - 14px);
    }

    .banners-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .banners-form-actions button,
    .banners-secondary-link {
        width: 100%;
    }
}

.notifications-compose-shell {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: calc(100vh - var(--header-height) - 24px);
    height: calc(100dvh - var(--header-height) - 24px);
    min-height: 0;
    overflow: hidden;
}

.notifications-compose-backlink {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.notifications-compose-grid {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

.notifications-compose-panel {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notifications-compose-tabs {
    margin: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.notifications-compose-tabs .admin-tabs-nav {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 3;
    margin-bottom: 10px;
    padding-bottom: 8px;
    background: #f8fbff;
}

.notifications-compose-tabs .admin-tab-pane {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.notifications-compose-tabs .admin-tab-pane.is-active {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.compose-wizard {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.compose-wizard-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.compose-step-link {
    border: 1px solid var(--line);
    background: #eef4fb;
    color: #0e4d7f;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 700;
    cursor: pointer;
}

.compose-step-link.is-active {
    background: #0b6aa8;
    border-color: #0b6aa8;
    color: #fff;
}

.compose-wizard-form {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.compose-step-pane {
    display: none;
    border: 1px solid #d7e4ee;
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    overflow: auto;
    min-height: 0;
}

.compose-step-pane.is-active {
    display: grid;
    gap: 10px;
    flex: 1 1 auto;
}

.compose-step-pane h3 {
    margin: 0;
}

.compose-summary {
    border: 1px solid #d7e4ee;
    border-radius: 12px;
    background: #f8fbff;
    padding: 12px;
    display: grid;
    gap: 8px;
}

.compose-summary h4 {
    margin: 0;
    font-size: 1rem;
}

.compose-summary p {
    margin: 0;
}

.compose-wizard-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 10px 0 2px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0) 0%, rgba(248, 251, 255, 1) 34%);
}

.compose-wizard-footer .button-secondary {
    background: #eef4fb;
    color: #0e4d7f;
    border: 1px solid var(--line);
}

.compose-wizard-footer button {
    width: min(280px, 100%);
    min-width: 280px;
}

.notifications-operation-section {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.notifications-operation-section + .notifications-operation-section {
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.notifications-operation-section h2 {
    margin: 0;
}

.notifications-operation-section--danger {
    color: #6f2025;
}

.notifications-operation-form {
    width: min(100%, 720px);
}

.notifications-operation-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
}

.notifications-operation-actions button {
    width: min(280px, 100%);
}

.notifications-danger-button {
    background: #9d2b33;
    border-color: #9d2b33;
}

.notifications-danger-button:hover {
    background: #852229;
    border-color: #852229;
}

@media (max-width: 760px) {
    .notifications-compose-shell {
        height: calc(100vh - var(--header-height) - 14px);
        height: calc(100dvh - var(--header-height) - 14px);
    }

    .notifications-compose-tabs {
        padding: 10px;
    }

    .compose-wizard-footer {
        justify-content: stretch;
    }

    .compose-wizard-footer button {
        min-width: 0;
        width: 100%;
    }

    .notifications-operation-actions {
        justify-content: stretch;
    }

    .notifications-operation-actions button {
        width: 100%;
    }
}

body.page-notifications-compose .app-body {
    overflow: hidden;
}

body.page-notifications-compose .content-scroll {
    overflow: hidden;
    min-height: 0;
}

body.page-notifications-compose .content-shell {
    height: 100%;
    min-height: 0;
}

@media (max-width: 1100px) {
    .ai-formalizer-builder-shell {
        height: auto;
        overflow: visible;
    }

    .admin-formalizer-builder {
        grid-template-columns: 1fr;
    }

    .admin-formalizer-builder-left,
    .admin-formalizer-builder-right {
        overflow: visible;
    }

    .admin-formalizer-tree,
    .admin-formalizer-editor {
        max-height: 60vh;
    }

    body.page-admin-ai-formalizer-builder .app-body {
        overflow-y: auto;
    }

    body.page-admin-ai-formalizer-builder .content-scroll {
        overflow: visible;
    }

    .admin-metric-kpi-pair {
        grid-template-columns: 1fr;
    }

    .admin-metric-kpi-triple {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .ai-formalizer-raw-shell {
        height: calc(100vh - var(--header-height) - 14px);
        height: calc(100dvh - var(--header-height) - 14px);
    }

    .ai-formalizer-save-actions {
        justify-content: stretch;
    }

    .ai-formalizer-save-actions button {
        width: 100%;
    }
}

.controller-reading-cell-details {
    min-width: 150px;
}

.controller-reading-cell-details summary {
    position: relative;
    display: block;
    padding-right: 16px;
    cursor: pointer;
    list-style: none;
}

.controller-reading-cell-details summary::-webkit-details-marker {
    display: none;
}

.controller-reading-cell-details summary::after {
    content: "⌄";
    position: absolute;
    top: 0;
    right: 0;
    color: var(--accent-deep);
    font-weight: 700;
}

.controller-reading-cell-details[open] summary::after {
    content: "⌃";
}

.controller-reading-cell-preview {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--controller-cell-lines, 2);
    line-height: 1.35;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.controller-reading-cell-full,
.controller-reading-history-message {
    margin-top: 6px;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.controller-reading-cell-details--billing {
    color: #5a7183;
    font-size: 0.86rem;
}

.controller-reading-history-link {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.controller-reading-account-cell,
.controller-reading-account-cell {
    min-width: 8ch;
    white-space: nowrap;
}

.controller-reading-history-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin: -4px 0 4px;
    color: #355c7f;
}

.controller-reading-history-summary strong {
    color: #12395a;
}
