@font-face {
    font-family: "Comfortaa";
    src: url("/assets/fonts/comfortaa-latin-wght-normal.woff2") format("woff2");
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Google Sans Watermark";
    src: url("/assets/fonts/google-sans-regular.ttf") format("truetype");
    font-weight: 300 400;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --brand-white: #F6F6F6;
    --brand-gray: #4D4D4D;
    --brand-line: #D6D6D6;
    --accent: #7D74B8;
    --bg: #0f0f10;
    --surface: #171718;
    --surface-2: #202022;
    --surface-soft: #1b1b1d;
    --line: #303033;
    --line-soft: rgba(246, 246, 246, 0.08);
    --text: #F6F6F6;
    --muted: #a7a7a7;
    --button-bg: #F6F6F6;
    --button-text: #161616;
    --button-muted: #252527;
    --logo-color: #D6D6D6;
    --danger: #B84A4A;
    --success: #4F8F67;
    --focus: rgba(125, 116, 184, 0.24);
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.26);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #F6F6F6;
    --surface: #ffffff;
    --surface-2: #eeeeee;
    --surface-soft: #f2f2f2;
    --line: #D6D6D6;
    --line-soft: rgba(77, 77, 77, 0.12);
    --text: #222222;
    --muted: #6a6a6a;
    --button-bg: #4D4D4D;
    --button-text: #ffffff;
    --button-muted: #f2f2f2;
    --logo-color: #4D4D4D;
    --accent: #5B4E93;
    --danger: #9E4545;
    --success: #3F7A59;
    --focus: rgba(91, 78, 147, 0.16);
    --shadow: 0 18px 55px rgba(77, 77, 77, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

code {
    color: var(--text);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
    word-break: break-word;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    justify-items: center;
    padding: 0;
    background:
        linear-gradient(180deg, rgba(246, 246, 246, 0.04), transparent 260px),
        var(--bg);
}

:root[data-theme="light"] .login-shell {
    background:
        linear-gradient(180deg, rgba(77, 77, 77, 0.04), transparent 260px),
        var(--bg);
}

.login-stage {
    width: min(1120px, calc(100% - 56px));
    min-height: 500px;
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(340px, 0.7fr);
    align-self: center;
    margin: 28px 0;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.renew-stage {
    width: min(560px, calc(100% - 56px));
    align-self: center;
    margin: 28px 0;
}

.renew-card {
    margin: 0;
}

.renew-card .primary-button {
    width: 100%;
}

.renew-details {
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
}

.renew-details div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    padding: 11px 12px;
}

.renew-details span {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.renew-logout {
    margin-top: 10px;
}

.renew-logout .secondary-button {
    width: 100%;
}

.login-status {
    padding: 30px;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    background: var(--surface-soft);
}

.login-brand,
.brand-lockup {
    display: inline-flex;
    align-items: center;
    color: var(--logo-color);
    line-height: 0;
}

.brand-logo {
    display: block;
    width: auto;
    height: 30px;
    color: inherit;
    overflow: visible;
}

.login-brand .brand-logo {
    height: 36px;
}

.terminal-topbar .brand-logo {
    height: 34px;
}

.error-panel .brand-logo {
    height: 34px;
    margin: 0 auto;
}

.login-side-copy {
    max-width: 520px;
}

.login-side-copy p {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.login-side-copy h2 {
    max-width: 460px;
    margin: 0;
    font-size: clamp(25px, 3.1vw, 38px);
    line-height: 1.06;
    font-weight: 720;
}

.login-side-copy > span {
    display: block;
    max-width: 520px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.access-request {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
    padding: 14px;
}

.access-request span {
    color: var(--muted);
    font-size: 12px;
}

.access-request .secondary-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.status-grid div,
.signal-panel,
.login-card,
.terminal-panel,
.metric-tile,
.error-panel {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 6px;
}

.status-grid div {
    padding: 14px;
}

.status-grid span,
.signal-row span,
.metric-tile span,
.panel-heading span,
.page-heading p,
.login-heading p,
label span,
td small {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.status-grid strong,
.signal-row strong {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 660;
}

.signal-panel {
    padding: 4px 14px;
}

.signal-row {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line-soft);
}

.signal-row:last-child {
    border-bottom: 0;
}

.login-card {
    align-self: center;
    margin: 28px;
    padding: 26px;
}

.login-heading {
    margin-bottom: 22px;
}

.login-heading p,
.page-heading p {
    margin: 0 0 6px;
    color: var(--accent);
    font-weight: 700;
}

.login-heading h1,
.page-heading h1 {
    margin: 0;
    font-size: clamp(28px, 3.6vw, 40px);
    line-height: 1.05;
    font-weight: 720;
}

.auth-form,
.control-strip {
    display: grid;
    gap: 12px;
}

label {
    display: grid;
    gap: 6px;
}

input,
select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--text);
    padding: 0 10px;
    outline: 0;
}

.auth-form input,
.auth-form select {
    font-size: 16px;
}

.auth-form input::placeholder {
    font-size: inherit;
}

input[name="username"],
input[name="reset_username"] {
    text-transform: uppercase;
}

.native-custom-select {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.custom-select {
    position: relative;
    min-width: 0;
    display: block;
    width: 100%;
}

.custom-select-button {
    position: relative;
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--text);
    padding: 0 28px 0 10px;
    cursor: pointer;
    font: inherit;
    text-align: left;
    outline: 0;
}

.custom-select-button:hover,
.custom-select.is-open .custom-select-button {
    background: var(--surface-2);
}

.custom-select-button:focus,
.custom-select-button:focus-visible {
    border-color: var(--line);
    box-shadow: none;
}

.custom-select-button:disabled {
    cursor: default;
    opacity: 0.56;
}

.custom-select-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-icon {
    position: absolute;
    right: 9px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-65%) rotate(45deg);
    color: var(--muted);
    pointer-events: none;
}

.custom-select-menu {
    position: fixed;
    z-index: 80;
    display: grid;
    gap: 4px;
    max-height: min(260px, calc(100vh - 28px));
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    box-shadow: var(--shadow);
    padding: 4px;
}

.custom-select-option {
    min-height: 30px;
    width: 100%;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    padding: 0 9px;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 720;
    text-align: left;
}

.custom-select-option:hover,
.custom-select-option[aria-selected="true"] {
    border-color: var(--line-soft);
    background: var(--button-muted);
}

.custom-select-option:disabled {
    color: var(--muted);
    cursor: default;
    opacity: 0.58;
}

input::placeholder {
    color: var(--muted);
    font-size: 13px;
}

input:focus,
select:focus {
    border-color: var(--line);
    box-shadow: none;
}

button:focus,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 0;
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-right: 62px;
}

.password-field button {
    position: absolute;
    top: 50%;
    right: 7px;
    min-width: 48px;
    height: 26px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
}

.password-field button:hover {
    color: var(--text);
}

.text-link {
    width: max-content;
    border: 0;
    background: transparent;
    color: var(--accent);
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 720;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.text-link:hover {
    color: var(--text);
}

.text-link:focus-visible {
    color: var(--text);
}

.forgot-password-link {
    margin-top: -4px;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 680;
}

.primary-button {
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    background: var(--button-bg);
    color: var(--button-text);
    padding: 0 14px;
}

.primary-button:disabled,
.secondary-button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.secondary-button {
    min-height: 36px;
    display: inline-grid;
    place-items: center;
    background: var(--button-muted);
    color: var(--text);
    border-color: var(--line);
    padding: 0 12px;
}

.danger-button {
    min-height: 32px;
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 42%, transparent);
    padding: 0 10px;
}

.icon-button {
    width: 40px;
    height: 34px;
    background: var(--button-muted);
    color: var(--text);
    border-color: var(--line);
    font-size: 11px;
}

.theme-switch {
    position: relative;
    width: 122px;
    height: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    padding: 2px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    overflow: hidden;
}

.theme-switch::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 2px);
    height: calc(100% - 4px);
    border-radius: 999px;
    background: var(--button-bg);
    transition: transform 160ms ease;
}

.theme-switch[data-theme-value="light"]::before {
    transform: translateX(100%);
}

.theme-switch span {
    position: relative;
    z-index: 1;
    display: inline-grid;
    place-items: center;
    color: var(--muted);
}

.theme-switch[data-theme-value="dark"] span:first-child,
.theme-switch[data-theme-value="light"] span:last-child {
    color: var(--button-text);
}

.form-alert {
    border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 5px;
    margin-bottom: 16px;
}

.form-alert[hidden] {
    display: none;
}

.form-alert.is-success {
    border-color: color-mix(in srgb, var(--success) 45%, transparent);
    background: color-mix(in srgb, var(--success) 10%, transparent);
    color: var(--success);
}

.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--bg) 76%, transparent);
    padding: 18px;
}

.modal-backdrop[hidden] {
    display: none;
}

.password-reset-modal,
.help-request-modal,
.admin-mfa-modal {
    position: relative;
    width: min(480px, 100%);
    max-height: min(680px, calc(100vh - 36px));
    margin: 0;
    overflow: auto;
    box-shadow: var(--shadow);
}

.password-reset-modal .login-heading,
.help-request-modal .login-heading,
.admin-mfa-modal .login-heading {
    margin-bottom: 14px;
    padding-right: 38px;
}

.password-reset-modal .login-heading h1,
.help-request-modal .login-heading h1,
.admin-mfa-modal .login-heading h1 {
    font-size: 24px;
    line-height: 1.15;
}

.password-reset-modal .login-heading p,
.help-request-modal .login-heading p,
.admin-mfa-modal .login-heading p {
    margin-top: 8px;
}

.help-request-modal {
    text-align: center;
}

.help-request-modal .login-heading {
    padding-left: 38px;
}

.help-request-modal .modal-actions {
    justify-items: center;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--button-muted);
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 20px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-note {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.modal-actions {
    display: grid;
    gap: 10px;
}

.admin-generated-link {
    display: grid;
    gap: 5px;
    color: var(--text);
}

.admin-generated-link span,
.form-alert small {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.admin-generated-link input {
    width: 100%;
}

.terminal-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.terminal-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(16px);
}

.simple-topbar {
    position: relative;
}

.topbar-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 24px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.terminal-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-toggle {
    width: 34px;
    height: 34px;
    display: none;
    place-items: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.nav-toggle svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
    color: var(--text);
}

.terminal-nav a {
    min-height: 32px;
    display: inline-grid;
    place-items: center;
    padding: 0 11px;
    color: var(--muted);
    border-radius: 5px;
}

.terminal-nav a:hover {
    color: var(--text);
}

.terminal-nav a.is-active {
    color: var(--text);
}

.settings-menu {
    position: relative;
    flex: 0 0 auto;
}

.settings-menu summary {
    list-style: none;
}

.settings-menu summary::-webkit-details-marker {
    display: none;
}

.settings-trigger {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.settings-trigger svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.settings-menu[open] .settings-trigger,
.settings-trigger:hover {
    color: var(--text);
}

.settings-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    width: min(300px, calc(100vw - 24px));
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 12px;
}

.settings-account {
    display: grid;
    gap: 2px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
}

.settings-account strong {
    font-size: 13px;
}

.settings-account small,
.settings-row span,
.settings-grid span {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.settings-row {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.settings-grid {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.settings-grid div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface-soft);
}

.settings-grid strong {
    font-size: 12px;
}

.settings-links {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.settings-links a,
.settings-links button {
    min-height: 36px;
    display: flex;
    align-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--text);
    padding: 0 10px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.settings-links a:hover,
.settings-links button:hover {
    border-color: var(--line);
    background: var(--surface);
}

.settings-links .settings-help-button {
    width: 100%;
    justify-content: center;
    border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    color: var(--text);
    text-align: center;
}

.settings-links .settings-help-button:hover {
    border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
    background: color-mix(in srgb, var(--accent) 15%, var(--surface));
}

.settings-logout {
    margin-top: 10px;
}

.settings-logout .secondary-button {
    width: 100%;
}

.terminal-main {
    width: min(1220px, calc(100% - 32px));
    flex: 1;
    margin: 0 auto;
    padding: 28px 0 44px;
}

.terminal-footer {
    width: 100%;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 0 20px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 11px;
}

.terminal-footer nav {
    display: flex;
    align-items: center;
    gap: 0;
}

.terminal-footer a {
    color: var(--muted);
}

.terminal-footer a:hover {
    color: var(--text);
}

.terminal-footer a + a::before {
    content: "|";
    color: var(--line);
    padding: 0 9px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 18px;
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: end;
    flex-wrap: wrap;
    gap: 8px;
}

.legal-main {
    width: min(920px, calc(100% - 32px));
    padding-bottom: 64px;
}

.legal-heading {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 30px;
    text-align: left;
}

.legal-document {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
    display: grid;
    gap: 34px;
    color: var(--text);
}

.legal-updated {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
}

.legal-document section {
    display: grid;
    gap: 12px;
    padding-top: 22px;
    border-top: 1px solid var(--line-soft);
}

.legal-document h2 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    line-height: 1.28;
    font-weight: 720;
}

.legal-document p,
.legal-document li {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.72;
    text-align: justify;
}

.legal-document ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 20px;
}

.legal-document strong {
    color: var(--text);
    font-weight: 720;
}

.legal-notice-link,
.legal-notice-content a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-notice-modal {
    position: relative;
    width: min(560px, 100%);
    max-height: min(720px, calc(100vh - 36px));
    margin: 0;
    overflow: auto;
    box-shadow: var(--shadow);
}

.legal-notice-modal .login-heading {
    margin-bottom: 16px;
    padding-right: 38px;
}

.legal-notice-modal .login-heading h1 {
    font-size: 24px;
    line-height: 1.15;
}

.legal-notice-content {
    display: grid;
    gap: 18px;
}

.legal-notice-section {
    display: grid;
    gap: 10px;
}

.legal-notice-section h2 {
    margin: 0;
    font-size: 15px;
    line-height: 1.3;
}

.legal-notice-section p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.58;
}

.legal-notice-section dl {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 8px 12px;
    margin: 0;
}

.legal-notice-section dt,
.legal-notice-section dd {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

.legal-notice-section dt {
    color: var(--muted);
}

.legal-notice-section dd {
    min-width: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.control-strip {
    grid-template-columns: minmax(160px, 1fr) minmax(110px, 0.65fr) auto;
    align-items: end;
    min-width: min(520px, 100%);
}

.terminal-panel {
    padding: 16px;
    margin-bottom: 14px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: baseline;
    margin-bottom: 14px;
}

.panel-heading h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.chart-panel {
    min-height: 390px;
}

.chart-grid {
    min-height: 300px;
    display: grid;
    place-items: stretch;
    background:
        linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
    background-size: 42px 42px;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
}

.chart-grid svg {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

.chart-grid polyline {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-grid line {
    stroke: var(--line-soft);
    stroke-width: 1;
}

.intel-grid,
.metrics-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.security-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.admin-user-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    align-items: end;
    gap: 10px;
}

.admin-user-form label {
    min-width: 0;
}

.admin-user-form input:not([type="checkbox"]) {
    width: 100%;
}

.admin-checkbox {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    white-space: nowrap;
}

.admin-checkbox input {
    width: auto;
}

.admin-user-list {
    display: grid;
    gap: 10px;
}

.admin-user-item {
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: var(--surface-soft);
    padding: 12px;
}

.admin-user-summary {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) repeat(6, minmax(70px, 0.7fr)) auto;
    align-items: center;
    gap: 14px;
}

.admin-user-summary[hidden],
.admin-user-edit[hidden] {
    display: none;
}

.admin-user-summary > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.admin-user-summary span {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.admin-user-summary strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-identity strong {
    font-size: 13px;
}

.admin-user-summary > .admin-user-actions,
.admin-user-actions form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-user-actions form {
    margin: 0;
}

.admin-user-actions .danger-button {
    min-height: 36px;
    display: inline-grid;
    place-items: center;
}

.admin-user-edit {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
}

.admin-user-form-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.password-reset-stage {
    justify-content: center;
}

.password-rules {
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--muted);
    padding: 10px;
    font-size: 12px;
    line-height: 1.45;
}

.metric-tile {
    padding: 14px;
}

.metric-tile strong {
    display: block;
    margin-top: 6px;
    font-size: 22px;
    font-weight: 700;
}

.intelligence-heading {
    align-items: end;
    justify-content: space-between;
}

.intelligence-search {
    flex: 1 1 auto;
    max-width: none;
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto auto auto;
    align-items: end;
    gap: 10px;
}

.wallet-search-field input {
    min-width: 0;
    padding-right: 76px;
}

.wallet-input-shell {
    position: relative;
    display: block;
    min-width: 0;
    color: inherit;
    font-size: inherit;
    text-transform: none;
}

.wallet-favorite-tools {
    position: absolute;
    right: 5px;
    bottom: 5px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.wallet-favorite-button,
.wallet-favorite-menu-toggle {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
}

.wallet-favorite-button:hover,
.wallet-favorite-menu-toggle:hover,
.wallet-favorite-button:focus,
.wallet-favorite-menu-toggle:focus,
.wallet-favorite-button:focus-visible,
.wallet-favorite-menu-toggle:focus-visible {
    color: var(--text);
    background: var(--button-muted);
    border-color: transparent;
    box-shadow: none;
}

.wallet-favorite-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.wallet-favorite-button svg,
.wallet-favorite-menu-toggle svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wallet-favorite-button.is-favorite {
    color: #d4a72c;
    border-color: color-mix(in srgb, #c59b2d 48%, transparent);
}

.wallet-favorite-button.is-favorite svg {
    fill: currentColor;
}

.wallet-favorite-menu {
    position: relative;
}

.wallet-favorite-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    min-width: 172px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 6px;
}

.wallet-favorite-menu-panel[hidden] {
    display: none;
}

.wallet-favorite-menu-panel button {
    width: 100%;
    min-height: 32px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    padding: 0 9px;
    text-align: left;
    font-size: 12px;
    font-weight: 680;
}

.wallet-favorite-menu-panel button:hover {
    background: var(--surface-soft);
}

.range-selector {
    height: 38px;
    min-height: 38px;
    display: inline-grid;
    grid-auto-flow: column;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    padding: 3px;
}

.intelligence-search .primary-button {
    height: 38px;
    min-height: 38px;
}

.range-selector button {
    min-width: 42px;
    height: 100%;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
    font-weight: 760;
}

.range-selector button:hover,
.range-selector button.is-active {
    background: var(--button-bg);
    color: var(--button-text);
}

.custom-range-fields {
    display: grid;
    grid-template-columns: repeat(2, 134px);
    gap: 8px;
}

.custom-range-fields input {
    padding: 0 7px;
}

.custom-range-fields[hidden] {
    display: none;
}

.movers-workspace {
    display: grid;
    gap: 12px;
}

.movers-panel-heading span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 780;
    letter-spacing: 0;
    text-transform: uppercase;
}

.movers-tabs {
    display: grid;
    grid-template-columns: repeat(10, minmax(124px, 1fr));
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    overflow-x: auto;
    padding: 4px;
}

.movers-tabs button {
    display: grid;
    align-content: center;
    gap: 2px;
    min-width: 124px;
    min-height: 46px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 6px 9px;
    text-align: left;
}

.movers-tabs button span,
.movers-tabs button strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movers-tabs button span {
    font-size: 9px;
    font-weight: 760;
    text-transform: uppercase;
}

.movers-tabs button strong {
    color: inherit;
    font-size: 11px;
    font-weight: 800;
}

.movers-tabs button:hover,
.movers-tabs button.is-active {
    background: var(--button-bg);
    color: var(--button-text);
}

.movers-tab-panel {
    min-width: 0;
    margin-bottom: 0;
}

.movers-tab-panel[hidden] {
    display: none;
}

.movers-panel-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.movers-panel-heading h2 {
    margin: 2px 0 0;
    color: var(--text);
    font-size: 17px;
}

.movers-controls {
    display: flex;
    align-items: end;
    justify-content: start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.movers-controls .primary-button {
    height: 38px;
    min-height: 38px;
}

.movers-controls label {
    min-width: 132px;
}

.movers-controls.is-loading {
    opacity: 0.72;
}

.movers-limit-control {
    width: 88px;
    min-width: 88px;
}

.movers-custom-range {
    align-items: end;
}

.movers-controls .custom-select-button {
    min-height: 38px;
    font-size: 12px;
    font-weight: 680;
}

.movers-controls input[type="number"]::-webkit-inner-spin-button,
.movers-controls input[type="number"]::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}

.movers-controls input[type="number"] {
    appearance: textfield;
}

.alerts-workspace {
    display: grid;
    gap: 12px;
}

.alerts-channel-panel,
.alerts-builder-panel,
.alerts-list-panel {
    margin-bottom: 0;
}

.alerts-panel-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.alerts-panel-title span,
.alerts-section-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 780;
    text-transform: uppercase;
}

.alerts-panel-title h2 {
    margin: 2px 0 0;
    font-size: 17px;
}

.alerts-channel-grid,
.alerts-layout {
    display: grid;
    gap: 12px;
}

.alerts-channel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alerts-layout {
    grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
}

.alerts-builder-panel,
.alerts-list-panel {
    min-height: 0;
}

.alerts-list-panel {
    display: flex;
    overflow: hidden;
    flex-direction: column;
    align-self: start;
}

.alert-channel-card,
.alerts-form-section {
    min-width: 0;
    display: grid;
    gap: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: var(--surface-soft);
    padding: 12px;
}

.alert-channel-card.is-locked label {
    opacity: 0.7;
}

.alert-channel-card.is-locked input {
    cursor: not-allowed;
}

.alert-channel-head {
    min-height: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.alert-channel-head > span {
    color: var(--text);
    font-size: 13px;
    font-weight: 780;
}

.alert-channel-head strong {
    color: var(--muted);
    font-size: 11px;
    font-weight: 720;
}

.alert-channel-head strong.is-configured {
    color: var(--success);
}

.alert-channel-head strong.is-error {
    max-width: 260px;
    color: var(--danger);
    text-align: right;
}

.alert-channel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.alert-channel-actions .primary-button,
.alert-channel-actions .secondary-button {
    min-height: 34px;
    padding: 0 12px;
}

.alerts-builder {
    display: grid;
    gap: 10px;
}

.alerts-delivery-section input[readonly] {
    cursor: pointer;
    caret-color: transparent;
}

.alerts-delivery-section input[readonly]:hover,
.alerts-delivery-section input[readonly]:focus {
    border-color: var(--line);
    background: var(--surface-2);
}

.alerts-local-feedback {
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--muted);
    padding: 8px 10px;
    font-size: 11px;
}

.alerts-local-feedback[data-mode="success"] {
    border-color: color-mix(in srgb, var(--success) 42%, var(--line));
    color: var(--success);
}

.alerts-local-feedback[data-mode="error"] {
    border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
    color: var(--danger);
}

.alerts-two-fields,
.alerts-three-fields {
    display: grid;
    gap: 8px;
}

.alerts-two-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alerts-three-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.alert-source-toggle,
.alert-channel-options {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    padding: 4px;
}

.alert-source-toggle {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alert-source-toggle button {
    min-height: 36px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 760;
}

.alert-source-toggle button:hover,
.alert-source-toggle button.is-active {
    background: var(--button-bg);
    color: var(--button-text);
}

.metric-picker-button {
    width: 100%;
    min-height: 46px;
    display: grid;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
    padding: 8px 10px;
    text-align: left;
}

.metric-picker-button:hover {
    border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
}

.metric-picker-button strong,
.metric-picker-button small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-picker-button small {
    color: var(--muted);
    font-size: 11px;
}

.alert-channel-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alert-channel-options label {
    position: relative;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: color-mix(in srgb, var(--surface-soft) 80%, var(--line));
    color: var(--muted);
    padding: 0 12px;
    cursor: not-allowed;
    font-size: 12px;
    font-weight: 760;
}

.alert-channel-options label.is-configured {
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.alert-channel-options input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.alert-channel-options label:has(input:checked) {
    border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    color: var(--text);
}

.alert-channel-options input:disabled + span {
    color: var(--muted);
}

.alerts-count {
    color: var(--muted);
    font-size: 12px;
}

.favorite-library-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.favorite-library-heading h3 {
    margin: 0;
    font-size: 14px;
}

.alerts-list {
    min-height: 0;
    flex: 1 1 auto;
    display: grid;
    align-content: start;
    gap: 14px;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    scrollbar-gutter: stable;
    padding-right: 4px;
}

.alert-list-section {
    display: grid;
    gap: 8px;
}

.alert-list-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.alert-list-section-title > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-list-section-title .secondary-button {
    min-height: 28px;
    padding: 0 8px;
    font-size: 10px;
    text-transform: none;
    letter-spacing: normal;
}

.alerts-empty,
.alert-list-item {
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: var(--surface-soft);
}

.alerts-empty {
    color: var(--muted);
    padding: 16px;
}

.alert-list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 9px 10px;
}

.alert-list-item.is-history {
    opacity: 0.72;
}

.alert-list-main {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.alert-list-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.alert-list-title span {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    padding: 1px 5px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.alert-list-title strong,
.alert-list-main p {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alert-list-main p {
    margin: 0;
    color: var(--text);
    font-size: 12px;
}

.alert-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--muted);
    font-size: 10px;
}

.alert-list-meta > span,
.alert-list-channels {
    border-right: 1px solid var(--line);
    padding-right: 6px;
}

.alert-list-meta > :last-child {
    border-right: 0;
    padding-right: 0;
}

.alert-list-channels {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.alert-channel-badge {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 1px 6px;
    color: var(--text);
    font-size: 9px;
    font-weight: 750;
}

.alert-channel-badge.is-slack {
    border-color: color-mix(in srgb, #611f69 55%, var(--line));
}

.alert-channel-badge.is-telegram {
    border-color: color-mix(in srgb, #229ed9 55%, var(--line));
}

.alert-trigger-time {
    color: var(--success);
}

.alert-list-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.alert-list-actions .secondary-button {
    min-height: 29px;
    padding: 0 8px;
    font-size: 11px;
}

.alert-list-actions .danger-button {
    border-color: color-mix(in srgb, var(--danger) 32%, var(--line));
    color: var(--danger);
}

.danger-button:hover {
    border-color: color-mix(in srgb, var(--danger) 54%, var(--line));
    color: var(--danger);
}

.alerts-metric-modal .chart-modal-panel {
    height: min(720px, calc(100vh - 40px));
    grid-template-rows: max-content minmax(0, 1fr);
}

.alerts-metric-library {
    height: 100%;
}

.alerts-form-section[hidden],
.alerts-two-fields[hidden],
.alerts-three-fields[hidden],
label[hidden] {
    display: none;
}

.movers-table-shell {
    position: relative;
    overflow: auto;
    max-height: min(720px, calc(100vh - 320px));
}

.page-rankings .movers-table-shell.is-loading,
.page-movers .movers-table-shell.is-loading {
    min-height: 180px;
}

.movers-table-shell .table-loading {
    inset: 0;
    min-height: 180px;
}

.movers-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: 0 1px 0 var(--line-soft);
}

.movers-table {
    min-width: 1180px;
    table-layout: fixed;
}

.movers-flow-table th:nth-child(1),
.movers-flow-table td:nth-child(1),
.movers-event-table th:nth-child(1),
.movers-event-table td:nth-child(1),
.movers-labeled-table th:nth-child(1),
.movers-labeled-table td:nth-child(1),
.movers-transactions-table th:nth-child(1),
.movers-transactions-table td:nth-child(1) {
    width: 70px;
}

.movers-transactions-table th:nth-child(2),
.movers-transactions-table td:nth-child(2),
.movers-event-table th:nth-child(7),
.movers-event-table td:nth-child(7) {
    width: 150px;
}

.movers-flow-table th:nth-child(2),
.movers-flow-table td:nth-child(2),
.movers-event-table th:nth-child(2),
.movers-event-table td:nth-child(2),
.movers-transactions-table th:nth-child(4),
.movers-transactions-table td:nth-child(4),
.movers-transactions-table th:nth-child(5),
.movers-transactions-table td:nth-child(5),
.movers-labeled-table th:nth-child(3),
.movers-labeled-table td:nth-child(3),
.movers-labeled-table th:nth-child(4),
.movers-labeled-table td:nth-child(4) {
    width: 220px;
}

.movers-flow-table th:nth-child(3),
.movers-flow-table td:nth-child(3),
.movers-flow-table th:nth-child(4),
.movers-flow-table td:nth-child(4),
.movers-flow-table th:nth-child(5),
.movers-flow-table td:nth-child(5),
.movers-flow-table th:nth-child(6),
.movers-flow-table td:nth-child(6),
.movers-flow-table th:nth-child(7),
.movers-flow-table td:nth-child(7),
.movers-event-table th:nth-child(3),
.movers-event-table td:nth-child(3),
.movers-event-table th:nth-child(4),
.movers-event-table td:nth-child(4),
.movers-event-table th:nth-child(5),
.movers-event-table td:nth-child(5),
.movers-event-table th:nth-child(6),
.movers-event-table td:nth-child(6),
.movers-event-table th:nth-child(8),
.movers-event-table td:nth-child(8),
.movers-labeled-table th:nth-child(2),
.movers-labeled-table td:nth-child(2),
.movers-labeled-table th:nth-child(5),
.movers-labeled-table td:nth-child(5),
.movers-labeled-table th:nth-child(6),
.movers-labeled-table td:nth-child(6),
.movers-transactions-table th:nth-child(3),
.movers-transactions-table td:nth-child(3),
.movers-transactions-table th:nth-child(6),
.movers-transactions-table td:nth-child(6),
.movers-transactions-table th:nth-child(7),
.movers-transactions-table td:nth-child(7) {
    width: 132px;
}

.movers-wallet-link {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
    font-weight: 650;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movers-wallet-link:hover {
    color: var(--accent);
}

.movers-badge {
    display: inline-grid;
    min-height: 22px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 8px;
    font-size: 10px;
    font-weight: 800;
}

.movers-badge.is-hot {
    border-color: rgba(239, 68, 68, 0.32);
    color: var(--danger);
}

.rank-cell {
    color: var(--muted);
    font-weight: 760;
}

.net-change {
    font-weight: 720;
}

.net-change.positive {
    color: var(--success);
}

.net-change.negative {
    color: var(--danger);
}

.intelligence-workspace {
    display: grid;
    gap: 12px;
}

.wallet-favorites-modal[hidden] {
    display: none;
}

.wallet-favorites-modal {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: grid;
    place-items: center;
    padding: 20px;
}

.wallet-favorites-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(10px);
}

.wallet-favorites-panel {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: min(640px, calc(100vh - 40px));
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 16px;
    overflow-y: auto;
}

.wallet-favorites-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.wallet-favorites-heading p {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 760;
    text-transform: uppercase;
}

.wallet-favorites-heading h2 {
    margin: 0;
    font-size: 20px;
}

.wallet-favorites-list {
    display: grid;
    gap: 8px;
}

.wallet-favorite-option,
.wallet-favorites-empty {
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--text);
    padding: 10px 12px;
}

.wallet-favorite-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.wallet-favorite-option:hover {
    border-color: var(--line);
    background: var(--surface);
}

.wallet-favorite-main {
    min-width: 0;
    display: grid;
    gap: 4px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.wallet-favorite-main strong {
    overflow: hidden;
    font-size: 13px;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-favorite-main span,
.wallet-favorites-empty {
    color: var(--muted);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
}

.wallet-favorite-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wallet-favorite-actions button {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--muted);
    cursor: pointer;
    padding: 0;
}

.wallet-favorite-actions button:hover {
    border-color: var(--line);
    color: var(--text);
}

.wallet-favorite-actions button:disabled {
    cursor: default;
    opacity: 0.5;
}

.wallet-favorite-actions svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wallet-favorite-editor-panel {
    width: min(460px, 100%);
}

.wallet-favorite-editor-summary,
.wallet-favorite-note-field {
    display: grid;
    gap: 6px;
}

.wallet-favorite-editor-summary span,
.wallet-favorite-note-field span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    text-transform: uppercase;
}

.wallet-favorite-editor-summary strong {
    overflow-wrap: anywhere;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    padding: 10px;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
}

.wallet-favorite-note-field textarea {
    width: 100%;
    min-height: 86px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--text);
    padding: 10px;
    font: inherit;
    font-size: 12px;
    outline: 0;
}

.wallet-favorite-note-field textarea:focus {
    border-color: var(--line);
    background: var(--surface-2);
}

.wallet-favorite-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.address-copy-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-wallet-button {
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--muted);
    cursor: pointer;
    padding: 0;
}

.address-copy-row .copy-wallet-button {
    width: 22px;
    height: 22px;
}

.address-copy-row .copy-wallet-button svg {
    width: 12px;
    height: 12px;
}

.copy-wallet-button:hover {
    color: var(--text);
    border-color: var(--line);
}

.copy-wallet-button svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.copy-wallet-button .check-icon,
.copy-wallet-button.is-copied .copy-icon {
    display: none;
}

.copy-wallet-button.is-copied {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 42%, var(--line));
}

.copy-wallet-button.is-copied .check-icon {
    display: block;
}

.intelligence-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.intelligence-panel {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.balance-panel,
.flow-panel {
    min-height: 390px;
}

.transactions-panel,
.overview-panel {
    align-self: start;
    height: auto;
    min-height: 0;
}

.overview-panel {
    --overview-blue: #60A5FA;
    --overview-green: #10B981;
    --overview-yellow: #F59E0B;
    --overview-red: #F43F5E;
}

.intelligence-chart-shell {
    position: relative;
    min-height: 318px;
    flex: 1 1 auto;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface);
    overflow: hidden;
}

.intelligence-chart {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 318px;
    height: 100%;
}

.page-intel .intelligence-chart-shell .chart-loading {
    inset: 0;
}

.balance-panel:not(.is-fullscreen) .intelligence-chart-shell,
.flow-panel:not(.is-fullscreen) .intelligence-chart-shell {
    flex: 0 0 318px;
    height: 318px;
    max-height: 318px;
}

.balance-panel:not(.is-fullscreen) .intelligence-chart,
.flow-panel:not(.is-fullscreen) .intelligence-chart {
    height: 318px;
    max-height: 318px;
}

.balance-chart-tooltip {
    position: absolute;
    z-index: 6;
    min-width: 160px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    color: var(--text);
    font-size: 12px;
    line-height: 1.45;
    padding: 8px 10px;
    pointer-events: none;
}

.balance-chart-tooltip strong,
.balance-chart-tooltip span {
    display: block;
}

.balance-chart-tooltip span {
    color: var(--muted);
}

.intelligence-chart .tv-lightweight-charts table {
    width: auto;
    min-width: 0;
    border-collapse: separate;
}

.intelligence-chart .tv-lightweight-charts td {
    padding: 0;
    border-bottom: 0;
}

.balance-controls,
.flow-controls {
    display: flex;
    align-items: center;
    justify-content: end;
    flex-wrap: wrap;
    gap: 8px;
}

.balance-axis-toggle,
.flow-mode-toggle {
    height: 30px;
    display: inline-grid;
    grid-auto-flow: column;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    padding: 2px;
}

.balance-axis-toggle button,
.flow-mode-toggle button {
    min-height: 24px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 0 9px;
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
}

.balance-axis-toggle button.is-active,
.flow-mode-toggle button.is-active {
    background: var(--button-bg);
    color: var(--button-text);
}

.flow-limit-control,
.flow-dust-control {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--muted);
    padding: 0 4px 0 8px;
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
}

.flow-dust-control {
    padding: 0 8px;
}

.flow-limit-control select {
    width: 66px;
    min-height: 30px;
    padding: 0 7px;
}

.flow-limit-control .custom-select {
    width: 66px;
}

.flow-limit-control .custom-select-button {
    min-height: 24px;
    border: 0;
    background: transparent;
    padding: 0 18px 0 4px;
    font-size: 11px;
    font-weight: 720;
}

.flow-limit-control .custom-select-button:hover,
.flow-limit-control .custom-select.is-open .custom-select-button {
    background: transparent;
    color: var(--text);
}

.flow-limit-control .custom-select-icon {
    right: 5px;
}

.flow-custom-select-menu {
    z-index: 1002;
}

.flow-dust-control input {
    width: 14px;
    min-height: 14px;
    margin: 0;
}

.flow-dust-control span {
    display: block;
    line-height: 1;
}

.flow-fullscreen-button {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--muted);
    cursor: pointer;
    padding: 0;
}

.flow-fullscreen-button:hover {
    color: var(--text);
    border-color: var(--line);
}

.flow-fullscreen-button svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.flow-fullscreen-button .collapse-icon,
.balance-panel.is-fullscreen .balance-fullscreen-button .expand-icon,
.flow-panel.is-fullscreen .flow-fullscreen-button .expand-icon,
.transactions-panel.is-fullscreen .transaction-fullscreen-button .expand-icon {
    display: none;
}

.balance-panel.is-fullscreen .balance-fullscreen-button .collapse-icon,
.flow-panel.is-fullscreen .flow-fullscreen-button .collapse-icon,
.transactions-panel.is-fullscreen .transaction-fullscreen-button .collapse-icon {
    display: block;
}

.flow-fullscreen-label {
    display: none;
}

.transaction-fullscreen-button {
    width: auto;
    min-width: 82px;
    grid-auto-flow: column;
    gap: 5px;
    padding: 0 8px;
}

.balance-fullscreen-button {
    width: 30px;
    min-width: 0;
    gap: 0;
    padding: 0;
}

.transaction-fullscreen-button .flow-fullscreen-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    font-weight: 760;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.transactions-panel.is-fullscreen .transaction-fullscreen-button {
    width: 30px;
    min-width: 0;
    gap: 0;
    padding: 0;
}

.transactions-panel.is-fullscreen .transaction-fullscreen-button .flow-fullscreen-label {
    display: none;
}

body.has-flow-fullscreen,
body.has-balance-fullscreen,
body.has-transactions-fullscreen {
    overflow: hidden;
}

body.has-flow-fullscreen::before,
body.has-balance-fullscreen::before,
body.has-transactions-fullscreen::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.56);
}

.balance-panel.is-fullscreen,
.flow-panel.is-fullscreen,
.transactions-panel.is-fullscreen {
    position: fixed;
    inset: 12px;
    z-index: 1000;
    min-height: 0;
    margin: 0;
    padding: 18px;
    box-shadow: var(--shadow);
}

.transactions-panel.is-fullscreen {
    height: calc(100vh - 24px) !important;
    height: calc(100dvh - 24px) !important;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
}

.balance-panel.is-fullscreen {
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
}

.balance-panel.is-fullscreen .panel-heading,
.flow-panel.is-fullscreen .panel-heading,
.transactions-panel.is-fullscreen .panel-heading {
    flex: 0 0 auto;
}

.balance-panel.is-fullscreen .intelligence-chart-shell,
.flow-panel.is-fullscreen .intelligence-chart-shell {
    min-height: 0;
    flex: 1 1 auto;
}

.balance-panel.is-fullscreen .intelligence-chart,
.flow-panel.is-fullscreen .intelligence-chart {
    min-height: 0;
}

.transactions-panel.is-fullscreen .intelligence-table-shell {
    min-height: 0;
    flex: 1 1 auto;
}

.transactions-panel.is-fullscreen .transaction-table {
    min-width: 1180px;
}

.flow-tooltip-address {
    max-width: 320px;
    display: block;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
    white-space: normal;
}

.intelligence-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    transform: translate(-50%, -50%);
    color: color-mix(in srgb, var(--text) 26%, transparent);
    font-family: "Google Sans Watermark", Inter, ui-sans-serif, sans-serif;
    font-size: 26px;
    font-weight: 300;
    letter-spacing: 0;
    pointer-events: none;
    user-select: none;
}

.intelligence-table-shell {
    position: relative;
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-gutter: stable;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
}

.page-intel .intelligence-table-shell.is-loading {
    min-height: 180px;
}

.page-intel .intelligence-table-shell .table-loading {
    inset: 0;
    min-height: 180px;
}

.intelligence-table-shell::-webkit-scrollbar {
    height: 10px;
}

.intelligence-table-shell::-webkit-scrollbar-track {
    background: var(--surface-soft);
}

.intelligence-table-shell::-webkit-scrollbar-thumb {
    border: 2px solid var(--surface-soft);
    border-radius: 999px;
    background: var(--line);
}

.intelligence-table-shell::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

.overview-table-shell {
    min-height: 0;
    flex: 1 1 auto;
    overflow: visible;
}

.page-intel .overview-panel.is-loading {
    min-height: 260px;
}

.page-intel .overview-panel .overview-loading {
    inset: 50px 0 0;
    min-height: 180px;
}

.intelligence-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    font-size: 12px;
}

.intelligence-table th,
.intelligence-table td {
    border-bottom: 1px solid var(--line-soft);
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
}

.intelligence-table th {
    background: var(--surface);
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
}

.intelligence-table tr:last-child td {
    border-bottom: 0;
}

.transaction-table {
    min-width: 1180px;
    table-layout: fixed;
}

.tx-col-time {
    width: 18%;
}

.tx-col-amount {
    width: 15%;
}

.tx-col-wallet {
    width: 21%;
}

.tx-col-kind {
    width: 11%;
}

.tx-col-block {
    width: 14%;
}

.transaction-filter-cell {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.transaction-filter-cell > span {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    line-height: 1.1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.transaction-filter-cell input,
.transaction-filter-cell select {
    min-height: 28px;
    border-color: var(--line-soft);
    padding: 0 8px;
    font-size: 11px;
    font-weight: 650;
}

.transactions-panel:not(.is-fullscreen) .transaction-sort-toggle,
.transactions-panel:not(.is-fullscreen) .transaction-sort-toggle button,
.transactions-panel:not(.is-fullscreen) .transaction-date-range-filter,
.transactions-panel:not(.is-fullscreen) .transaction-compare-filter,
.transactions-panel:not(.is-fullscreen) .transaction-filter-cell > input,
.transactions-panel:not(.is-fullscreen) .transaction-filter-cell > select,
.transactions-panel:not(.is-fullscreen) .transaction-filter-cell > .custom-select {
    display: none;
}

.transaction-filter-cell input[type="search"] {
    appearance: none;
}

.transaction-filter-cell input[type="number"]::-webkit-inner-spin-button,
.transaction-filter-cell input[type="number"]::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}

.transaction-filter-cell input[type="number"] {
    appearance: textfield;
}

.transaction-date-range-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    min-width: 0;
}

.transaction-date-range-filter input[readonly] {
    cursor: pointer;
    caret-color: transparent;
}

.custom-range-fields input[readonly] {
    cursor: pointer;
    caret-color: transparent;
}

.transaction-date-range-filter input[readonly]:hover,
.transaction-date-range-filter input[readonly]:focus,
.custom-range-fields input[readonly]:hover,
.custom-range-fields input[readonly]:focus {
    border-color: var(--line);
    background: var(--surface-2);
}

.transaction-filter-cell .custom-select-button {
    min-height: 28px;
    border-color: var(--line-soft);
    padding: 0 24px 0 8px;
    font-size: 11px;
    font-weight: 650;
}

.transaction-filter-cell .custom-select-icon {
    right: 8px;
    width: 6px;
    height: 6px;
}

.transaction-filter-select-menu {
    z-index: 1002;
}

.transaction-calendar-menu {
    position: fixed;
    z-index: 1003;
    display: grid;
    gap: 8px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    box-shadow: var(--shadow);
    padding: 8px;
}

.transaction-calendar-heading {
    display: grid;
    grid-template-columns: 30px 1fr 30px;
    align-items: center;
    gap: 6px;
}

.transaction-calendar-title {
    overflow: hidden;
    min-height: 30px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 760;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-calendar-heading button,
.transaction-calendar-footer button,
.transaction-calendar-month-heading button {
    min-height: 30px;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 11px;
    font-weight: 760;
}

.transaction-calendar-heading button:hover,
.transaction-calendar-footer button:hover,
.transaction-calendar-month-heading button:hover,
.transaction-calendar-title:hover {
    border-color: var(--line);
    background: var(--surface-2);
}

.transaction-calendar-heading button:disabled {
    cursor: default;
    opacity: 0.36;
}

.transaction-calendar-weekdays,
.transaction-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.transaction-calendar-weekdays span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 760;
    text-align: center;
    text-transform: uppercase;
}

.transaction-calendar-day {
    aspect-ratio: 1;
    min-height: 28px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.transaction-calendar-day:hover {
    border-color: var(--line-soft);
    background: var(--button-muted);
}

.transaction-calendar-day.is-today {
    border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
}

.transaction-calendar-day.is-selected {
    border-color: var(--button-bg);
    background: var(--button-bg);
    color: var(--button-text);
}

.transaction-calendar-day:disabled,
.transaction-calendar-day.is-empty {
    cursor: default;
    opacity: 0.32;
}

.transaction-calendar-day.is-empty {
    min-height: 28px;
    pointer-events: none;
}

.transaction-calendar-month-picker,
.transaction-calendar-year-picker {
    display: grid;
    gap: 8px;
}

.transaction-calendar-month-heading {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px;
}

.transaction-calendar-month-heading strong,
.transaction-calendar-picker-label {
    color: var(--text);
    font-size: 12px;
    font-weight: 760;
    text-align: center;
}

.transaction-calendar-month-grid,
.transaction-calendar-year-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.transaction-calendar-year-grid {
    max-height: 190px;
    overflow-y: auto;
    padding-right: 2px;
}

.transaction-calendar-month,
.transaction-calendar-year {
    min-height: 34px;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 11px;
    font-weight: 760;
}

.transaction-calendar-month:hover,
.transaction-calendar-year:hover {
    border-color: var(--line);
    background: var(--surface-2);
}

.transaction-calendar-month.is-selected,
.transaction-calendar-year.is-selected {
    border-color: var(--button-bg);
    background: var(--button-bg);
    color: var(--button-text);
}

.transaction-calendar-month:disabled,
.transaction-calendar-year:disabled {
    cursor: default;
    opacity: 0.36;
}

.transaction-calendar-footer {
    display: flex;
    justify-content: flex-end;
}

.transaction-calendar-footer button {
    min-width: 64px;
    min-height: 28px;
}

.transaction-sort-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface-soft);
    padding: 2px;
}

.transaction-sort-toggle button {
    min-width: 0;
    min-height: 22px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 0 5px;
    font-size: 9px;
    font-weight: 760;
    text-transform: uppercase;
}

.transaction-sort-toggle button:hover {
    color: var(--text);
}

.transaction-sort-toggle button.is-active {
    background: var(--button-bg);
    color: var(--button-text);
}

.transaction-compare-filter {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 5px;
    min-width: 0;
}

.address-cell {
    min-width: 118px;
    display: grid;
    gap: 4px;
}

.transaction-table .address-cell {
    min-width: 0;
}

.transaction-table .address-cell.is-searched-wallet strong,
.transaction-table .address-cell.is-searched-wallet .label-pill {
    opacity: 0.48;
}

.address-cell strong {
    min-width: 0;
    overflow: hidden;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-wallet-search {
    min-width: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    padding: 0;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 52%, transparent);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-wallet-search:hover,
.transaction-wallet-search:focus-visible {
    color: var(--accent);
    outline: 0;
}

.address-cell small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.label-pill,
.direction-pill {
    width: fit-content;
    max-width: 100%;
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 8px;
    font-size: 10px;
    font-weight: 760;
    line-height: 1;
}

.label-pill {
    text-align: center;
    text-transform: uppercase;
}

.label-pill.conviction-1 {
    border-color: color-mix(in srgb, var(--danger) 44%, transparent);
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
}

.label-pill.conviction-2 {
    border-color: color-mix(in srgb, #C8A24A 48%, transparent);
    background: color-mix(in srgb, #C8A24A 12%, transparent);
    color: #C8A24A;
}

.label-pill.conviction-3 {
    border-color: color-mix(in srgb, var(--success) 44%, transparent);
    background: color-mix(in srgb, var(--success) 10%, transparent);
    color: var(--success);
}

.direction-pill {
    text-transform: none;
    white-space: nowrap;
}

.direction-pill.inbound {
    border-color: color-mix(in srgb, var(--success) 44%, transparent);
    background: color-mix(in srgb, var(--success) 10%, transparent);
    color: var(--success);
}

.direction-pill.outbound {
    border-color: color-mix(in srgb, var(--danger) 44%, transparent);
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
}

.overview-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.overview-metric-card {
    min-width: 0;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface);
    padding: 11px;
}

.overview-metric-card span,
.overview-flow-card span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
}

.overview-metric-card strong {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    font-size: 15px;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-metric-card small,
.overview-flow-card small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.overview-metric-card.is-balance strong {
    color: var(--overview-blue);
}

.overview-metric-card.is-volume strong {
    color: var(--overview-yellow);
}

.overview-metric-card.is-tx strong {
    color: var(--overview-green);
}

.overview-metric-card.is-network strong {
    color: var(--overview-red);
}

.overview-intelligence {
    display: grid;
    gap: 10px;
}

.overview-empty {
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface);
    color: var(--muted);
    padding: 14px;
    font-size: 12px;
}

.overview-flow-card {
    min-width: 0;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface);
}

.overview-flow-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.overview-flow-card {
    padding: 11px;
}

.overview-flow-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.overview-flow-card-head strong {
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-flow-bar {
    height: 6px;
    overflow: hidden;
    margin-top: 10px;
    border-radius: 999px;
    background: var(--surface-soft);
}

.overview-flow-bar span {
    height: 100%;
    display: block;
    border-radius: inherit;
}

.overview-flow-card.is-inbound .overview-flow-bar span {
    background: var(--overview-green);
}

.overview-flow-card.is-outbound .overview-flow-bar span {
    background: var(--overview-red);
}

.overview-flow-card.is-inbound strong {
    color: var(--overview-green);
}

.overview-flow-card.is-outbound strong {
    color: var(--overview-red);
}

.overview-flow-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
}

.overview-flow-meta span {
    min-width: 0;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface-soft);
    padding: 7px 8px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
}

.overview-flow-meta strong {
    margin-right: 4px;
    font-size: 12px;
    font-weight: 800;
}

.overview-flow-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.overview-flow-stats div {
    min-width: 0;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    padding: 8px;
}

.overview-flow-stats span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
}

.overview-flow-stats strong {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    font-size: 12px;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.intelligence-search.is-loading .primary-button {
    opacity: 0.68;
    pointer-events: none;
}

.intelligence-search.is-loading .range-selector button {
    background: transparent;
    color: var(--muted);
    opacity: 0.68;
    pointer-events: none;
}

.intelligence-search.is-loading .range-selector button.is-active {
    background: var(--button-bg);
    color: var(--button-text);
}

.transaction-pagination {
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 10px;
    margin-top: 10px;
}

.transaction-pagination[hidden] {
    display: none;
}

.transaction-pagination span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.transaction-pagination .secondary-button {
    min-height: 30px;
    padding: 0 10px;
}

.transaction-pagination .secondary-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.live-pill,
.event-badge {
    min-height: 24px;
    display: inline-grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--success) 36%, transparent);
    color: var(--success);
    background: color-mix(in srgb, var(--success) 8%, transparent);
    border-radius: 999px;
    padding: 0 9px;
    font-size: 11px;
    font-weight: 700;
}

.event-badge.danger {
    border-color: color-mix(in srgb, var(--danger) 45%, transparent);
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.event-badge.muted {
    border-color: var(--line);
    color: var(--muted);
    background: var(--surface-soft);
}

.country-pill {
    min-width: 32px;
    min-height: 24px;
    display: inline-grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-radius: 5px;
    background: color-mix(in srgb, var(--accent) 7%, transparent);
    color: var(--text);
    font-size: 11px;
    font-weight: 760;
}

.context-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 320px;
}

.context-stack span {
    min-height: 24px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--text);
    padding: 0 7px;
    font-size: 11px;
    white-space: nowrap;
}

.muted-text {
    color: var(--muted);
    font-size: 12px;
}

.danger-zone {
    border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
    background: color-mix(in srgb, var(--danger) 5%, var(--surface));
}

.danger-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
    gap: 12px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

th,
td {
    padding: 10px 10px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 680;
}

td strong,
td small {
    display: block;
}

tr.is-warning td {
    background: color-mix(in srgb, var(--danger) 6%, transparent);
}

.empty-cell {
    color: var(--muted);
    text-align: center;
}

.charts-workspace {
    width: calc(100vw - 40px);
    margin-left: calc(50% - 50vw + 20px);
}

.chart-actions {
    display: flex;
    align-items: center;
    justify-content: end;
    flex-wrap: wrap;
    gap: 8px;
}

.chart-actions .secondary-button {
    grid-auto-flow: column;
    gap: 8px;
}

.chart-actions span {
    min-width: 28px;
    min-height: 20px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
}

.chart-terminal {
    width: 100%;
    height: calc(100vh - 124px);
    min-height: 560px;
    max-height: 760px;
    display: grid;
    grid-template-columns: 363px minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow);
}

@media (min-width: 981px) {
    .page-charts,
    .page-movers,
    .page-rankings {
        height: 100vh;
        overflow: hidden;
    }

    .page-intel .terminal-main,
    .page-alerts .terminal-main,
    .page-movers .terminal-main,
    .page-rankings .terminal-main,
    .page-charts .terminal-main {
        width: calc(100vw - 40px);
    }

    .page-movers .terminal-main,
    .page-rankings .terminal-main {
        min-height: 0;
        flex: 1 1 auto;
        display: flex;
        max-width: 1680px;
        padding: 12px 0;
    }

    .page-intel .terminal-main {
        padding-top: 20px;
    }

    .page-movers .movers-workspace,
    .page-rankings .movers-workspace {
        width: 100%;
        min-height: 0;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        flex: 1 1 auto;
    }

    .page-movers .movers-tab-panel,
    .page-rankings .movers-tab-panel {
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .page-movers .movers-tab-panel[hidden],
    .page-rankings .movers-tab-panel[hidden] {
        display: none;
    }

    .page-movers .movers-table-shell,
    .page-rankings .movers-table-shell {
        min-height: 0;
        max-height: none;
        flex: 1 1 auto;
    }

    .page-charts .terminal-main {
        min-height: 0;
        flex: 1 1 auto;
        display: flex;
        padding: 12px 0;
    }

    .page-charts .charts-workspace {
        min-height: 0;
        display: flex;
        flex: 1 1 auto;
    }

    .page-charts .chart-terminal {
        height: auto;
        min-height: 0;
        max-height: none;
        flex: 1 1 auto;
    }
}

@media (min-width: 1800px) and (min-height: 1000px) {
    .page-intel {
        height: 100vh;
        overflow: hidden;
    }

    .page-intel .terminal-main {
        min-height: 0;
        flex: 1 1 auto;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        padding: 12px 0;
    }

    .page-intel .page-heading {
        margin-bottom: 12px;
    }

    .page-intel .intelligence-workspace {
        min-height: 0;
        grid-template-rows: minmax(0, 1fr);
    }

    .page-intel .intelligence-grid {
        min-height: 0;
        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    }

    .page-intel .intelligence-panel {
        overflow: hidden;
    }

    .page-intel .balance-panel,
    .page-intel .flow-panel {
        min-height: 0;
    }

    .page-intel .balance-panel:not(.is-fullscreen) .intelligence-chart-shell,
    .page-intel .flow-panel:not(.is-fullscreen) .intelligence-chart-shell {
        min-height: 0;
        height: auto;
        max-height: none;
        flex: 1 1 auto;
    }

    .page-intel .balance-panel:not(.is-fullscreen) .intelligence-chart,
    .page-intel .flow-panel:not(.is-fullscreen) .intelligence-chart {
        min-height: 0;
        height: 100%;
        max-height: none;
    }

    .page-intel .transactions-panel,
    .page-intel .overview-panel {
        align-self: stretch;
        height: auto !important;
    }

    .page-intel .intelligence-table-shell,
    .page-intel .overview-table-shell {
        overflow: auto;
    }
}

.chart-sidebar {
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    border-right: 1px solid var(--line);
    background: var(--surface-soft);
    padding: 12px;
    overflow-y: auto;
}

.add-series-button {
    width: 100%;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px dashed color-mix(in srgb, var(--accent) 44%, var(--line));
    border-radius: 5px;
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
    color: var(--text);
    cursor: pointer;
    font-weight: 760;
}

.add-series-button span {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--button-bg);
    color: var(--button-text);
    font-size: 0;
    line-height: 1;
    transform: translateY(1.4px);
}

.add-series-button span::before {
    content: "+";
    font-size: 18px;
    line-height: 1;
    transform: translateY(0.5px);
}

.add-series-launcher {
    position: relative;
}

.add-series-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 35;
    width: 100%;
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 6px;
}

.add-series-menu[hidden] {
    display: none;
}

.add-series-menu button {
    min-height: 48px;
    display: grid;
    gap: 2px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: var(--text);
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
}

.add-series-menu button:hover {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
    background: var(--surface);
}

.add-series-menu strong {
    font-size: 12px;
}

.add-series-menu span {
    color: var(--muted);
    font-size: 10px;
}

.builder-grid {
    display: grid;
    gap: 11px;
}

.builder-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}

.builder-row.is-compact {
    grid-template-columns: 42px minmax(0, 1fr);
}

.builder-row.is-compact.indicator-action-row {
    grid-template-columns: minmax(0, 1fr);
}

.indicator-action-row > span {
    display: none;
}

.indicator-parameter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.indicator-parameter-grid label[hidden] {
    display: none;
}

.indicator-parameter-grid input,
.indicator-parameter-grid select {
    width: 100%;
}

.indicator-action-row .modal-action-row {
    display: contents;
}

.indicator-action-row .modal-action-row .primary-button {
    width: 100%;
}

.builder-row input[type="color"],
.legend-item input[type="color"] {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 4px;
    cursor: pointer;
}

.builder-row input[type="color"]::-webkit-color-swatch-wrapper,
.legend-item input[type="color"]::-webkit-color-swatch-wrapper {
    width: 100%;
    height: 100%;
    padding: 0;
}

.builder-row input[type="color"]::-webkit-color-swatch,
.legend-item input[type="color"]::-webkit-color-swatch {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 4px;
}

.builder-row input[type="color"]::-moz-color-swatch,
.legend-item input[type="color"]::-moz-color-swatch {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 4px;
}

.modal-action-row {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 10px;
    align-items: end;
}

.modal-action-row .primary-button,
.modal-action-row .secondary-button {
    min-height: 38px;
}

.modal-action-row .primary-button {
    width: 100%;
}

.modal-action-row .secondary-button {
    width: auto;
    padding: 0 12px;
}

.chart-stage {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

body.has-chart-fullscreen {
    overflow: hidden;
}

body.has-chart-fullscreen::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.56);
}

.chart-stage.is-fullscreen {
    position: fixed;
    inset: 12px;
    z-index: 1000;
    width: auto;
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    max-height: none;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.chart-fullscreen-toggle .collapse-icon,
.chart-stage.is-fullscreen .chart-fullscreen-toggle .expand-icon {
    display: none;
}

.chart-stage.is-fullscreen .chart-fullscreen-toggle .collapse-icon {
    display: block;
}

.chart-stage.is-fullscreen .chart-toolbar {
    display: flex;
}

.chart-toolbar {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line-soft);
}

.axis-mode-control .custom-select-value {
    color: var(--text);
    font-size: 11px;
    font-weight: 720;
    text-transform: none;
}

.axis-mode-control .custom-select-icon {
    color: var(--muted);
}

.axis-mode-control select:focus,
.legend-item select:focus {
    border-color: transparent;
    box-shadow: none;
}

.chart-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.chart-tools {
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 6px;
    margin-left: auto;
}

.axis-mode-control {
    width: auto;
    min-height: 32px;
    display: grid;
    grid-template-columns: auto max-content;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    padding: 0 4px 0 8px;
}

.axis-mode-control span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
}

.axis-mode-control select {
    width: auto;
    min-width: 40px;
    min-height: 24px;
    border: 0;
    background: transparent;
    padding: 0 4px;
    font-size: 11px;
    font-weight: 720;
}

.axis-mode-control .custom-select {
    width: 72px;
}

.axis-mode-control .custom-select-button {
    min-height: 24px;
    border: 0;
    background: transparent;
    padding: 0 18px 0 4px;
    font-size: 11px;
    font-weight: 720;
}

.axis-mode-control .custom-select-button:hover,
.axis-mode-control .custom-select.is-open .custom-select-button {
    background: transparent;
}

.axis-mode-control[hidden] {
    display: none;
}

.chart-tool-button {
    width: 34px;
    min-height: 32px;
    padding: 0;
}

.icon-only svg,
.legend-visibility svg,
.legend-favorite svg,
.legend-edit svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.legend-visibility,
.legend-favorite,
.legend-edit {
    display: inline-grid;
    place-items: center;
}

.legend-visibility svg,
.legend-favorite svg,
.legend-edit svg {
    display: block;
    transform: translateY(0.5px);
}

.legend-favorite svg {
    transform: translateY(0);
}

.legend-favorite.is-favorite {
    color: #d4a72c;
    border-color: color-mix(in srgb, #c59b2d 48%, var(--line));
}

.legend-favorite.is-favorite svg {
    fill: currentColor;
}

.chart-status {
    min-height: 28px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    padding: 0 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.chart-canvas-shell {
    position: relative;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 6px 6px 0;
    overflow: hidden;
}

.chart-readout {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    max-width: min(460px, calc(100% - 24px));
    display: grid;
    gap: 5px;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    color: var(--text);
    padding: 8px 10px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
    pointer-events: none;
}

.chart-watermark {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    transform: translate(-50%, -50%);
    color: color-mix(in srgb, var(--text) 10%, transparent);
    font-family: "Google Sans Watermark", Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: clamp(37px, 4.32vw, 74px);
    font-weight: 300;
    letter-spacing: 0;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

.chart-readout[hidden] {
    display: none;
}

.chart-loading,
.table-loading {
    position: absolute;
    inset: 6px 6px 0;
    z-index: 4;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
    color: var(--text);
    text-align: center;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.chart-loading[hidden],
.table-loading[hidden] {
    display: none;
}

.chart-loading strong,
.table-loading strong {
    font-size: 12px;
    font-weight: 760;
    text-transform: uppercase;
}

.chart-loading.is-error,
.table-loading.is-error {
    background: var(--surface);
}

.chart-loading.is-error strong,
.table-loading.is-error strong {
    max-width: min(520px, calc(100% - 32px));
    color: var(--danger);
    font-size: 13px;
    line-height: 1.35;
    text-transform: none;
}

.chart-loading.is-error .chart-loading-spinner,
.table-loading.is-error .chart-loading-spinner {
    display: none;
}

.chart-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid color-mix(in srgb, var(--accent) 22%, var(--line));
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: chart-loading-spin 0.8s linear infinite;
}

@keyframes chart-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .chart-loading-spinner {
        animation: none;
    }
}

.chart-readout strong {
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    text-transform: uppercase;
}

.chart-readout span {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    font-size: 12px;
    font-weight: 620;
}

.chart-readout i {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 999px;
}

.chart-readout b {
    font-weight: 760;
}

.chart-canvas {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.chart-canvas .tv-lightweight-charts table {
    width: auto;
    min-width: 0;
    border-collapse: separate;
}

.chart-canvas .tv-lightweight-charts td {
    padding: 0;
    border-bottom: 0;
}

.series-legend {
    min-height: 0;
    display: grid;
    align-content: start;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow-y: auto;
}

.legend-item {
    min-width: 0;
    display: grid;
    gap: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface);
    padding: 10px;
}

.legend-item.is-hidden-series {
    opacity: 0.62;
}

.legend-item-header {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.legend-meta {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.legend-meta strong {
    display: inline;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
}

.legend-meta strong {
    font-size: 13px;
}

.legend-empty {
    color: var(--muted);
    font-size: 11px;
}

.legend-controls {
    display: grid;
    grid-template-columns: 34px repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.legend-controls input[type="color"] {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 4px;
}

.legend-item select {
    width: 100%;
    min-height: 34px;
    padding: 0 7px;
}

.legend-item .custom-select-button {
    min-height: 34px;
    padding: 0 24px 0 7px;
    font-size: 11px;
    font-weight: 720;
}

.legend-actions {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 6px;
}

.legend-remove {
    margin-left: auto;
    border-color: color-mix(in srgb, #ef4444 34%, var(--line));
    background: color-mix(in srgb, #ef4444 8%, var(--surface));
    color: #ef4444;
}

.legend-remove:hover,
.legend-remove:focus-visible {
    border-color: color-mix(in srgb, #ef4444 62%, var(--line));
    background: color-mix(in srgb, #ef4444 14%, var(--surface));
    color: #dc2626;
}

.legend-empty {
    min-height: 70px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
}

.chart-modal[hidden] {
    display: none;
}

.chart-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 20px;
}

.chart-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(10px);
}

.chart-modal-panel {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    height: auto;
    max-height: min(720px, calc(100vh - 40px));
    display: grid;
    grid-template-rows: auto minmax(0, auto);
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 16px;
    overflow: hidden;
}

.chart-modal-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.chart-modal-heading p {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 760;
    text-transform: uppercase;
}

.chart-modal-heading h2 {
    margin: 0;
    font-size: 20px;
}

.add-step-panel[hidden] {
    display: none;
}

.add-step-panel {
    min-height: 0;
    height: auto;
    max-height: min(620px, calc(100vh - 132px));
    overflow: auto;
}

.add-step-panel[data-add-step="metric"] {
    overflow: hidden;
    height: min(620px, calc(100vh - 132px));
}

.metric-library,
.custom-builder,
.favorite-library {
    min-width: 0;
}

.metric-library {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.metric-search {
    margin-bottom: 12px;
}

.metric-browser {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(260px, 1.5fr);
    gap: 10px;
}

.metric-browser-column {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 7px;
}

.metric-browser-column > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
}

.metric-browser-list,
.metric-results,
.favorite-library {
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 6px;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: var(--surface-soft);
    padding: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.metric-nav-button,
.metric-result-button {
    min-width: 0;
    display: grid;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: var(--text);
    padding: 10px;
    text-align: left;
    cursor: pointer;
}

.metric-nav-button {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.metric-nav-button:hover,
.metric-nav-button.is-active,
.metric-result-button:hover {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
    background: var(--surface);
}

.metric-nav-button strong,
.metric-result-button strong {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-nav-button span {
    color: var(--muted);
    font-size: 10px;
}

.metric-result-button {
    gap: 7px;
}

.metric-result-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-result-button strong {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-description-help {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    line-height: 1;
}

.metric-description-help:hover,
.metric-description-help:focus-visible {
    border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
    color: var(--text);
}

.metric-description-tooltip {
    position: fixed;
    z-index: 80;
    width: min(280px, calc(100vw - 20px));
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    padding: 9px 10px;
    font-size: 11px;
    font-weight: 560;
    line-height: 1.45;
    pointer-events: none;
}

.metric-description-tooltip[hidden] {
    display: none;
}

.metric-result-context {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}

.metric-result-context span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 620;
}

.metric-result-context i {
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: var(--muted);
    opacity: 0.55;
}

.metric-resolution-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.metric-resolution-row span {
    min-height: 18px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 72%, var(--surface-soft));
    color: var(--muted);
    padding: 0 6px;
    font-size: 9px;
    font-weight: 760;
}

.metric-empty,
.favorite-empty {
    min-height: 120px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
}

.metric-edit-controls {
    margin-top: 12px;
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--line-soft);
    padding-top: 12px;
}

.metric-edit-controls[hidden] {
    display: none;
}

.custom-builder {
    display: grid;
    gap: 0;
}

.custom-step {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 16px;
}

.custom-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 16px;
    top: 34px;
    bottom: 0;
    width: 1px;
    background: var(--line);
}

.custom-step-marker {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--line));
    border-radius: 999px;
    background: var(--surface);
    color: var(--accent);
    font-size: 12px;
    font-weight: 760;
}

.custom-step-body {
    min-width: 0;
    display: grid;
    gap: 9px;
}

.custom-step-body h3 {
    margin: 6px 0 0;
    font-size: 14px;
}

.resolution-pills {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.resolution-pill {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--muted);
    padding: 0 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 780;
}

.resolution-pill.is-active,
.resolution-pill:hover {
    border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    color: var(--text);
}

.expression-shell {
    position: relative;
}

.expression-composer {
    width: 100%;
    min-height: 156px;
    display: block;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--text);
    padding: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.75;
    outline: none;
    overflow-y: auto;
    white-space: pre-wrap;
}

.expression-composer:focus {
    border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.expression-composer:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
    pointer-events: none;
}

.expression-token {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    max-width: min(260px, 100%);
    margin: 0 4px;
    border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    color: var(--text);
    padding: 0 9px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 760;
    vertical-align: baseline;
}

.expression-token > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.expression-token.is-delete-pending {
    border-color: color-mix(in srgb, var(--danger) 64%, var(--line));
    background: color-mix(in srgb, var(--danger) 12%, var(--surface));
    color: var(--danger);
}

.expression-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.expression-toolbar button {
    min-width: 34px;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--text);
    padding: 0 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 760;
}

.expression-toolbar .secondary-button {
    min-width: 104px;
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.expression-toolbar button:hover {
    border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
}

.expression-toolbar button.expression-clear {
    min-width: 64px;
    margin-left: auto;
    border-color: color-mix(in srgb, #ef4444 34%, var(--line));
    background: color-mix(in srgb, #ef4444 8%, var(--surface));
    color: #ef4444;
}

.expression-toolbar button.expression-clear:hover,
.expression-toolbar button.expression-clear:focus-visible {
    border-color: color-mix(in srgb, #ef4444 62%, var(--line));
    background: color-mix(in srgb, #ef4444 14%, var(--surface));
    color: #dc2626;
}

.custom-expression-error {
    margin: 10px 0 0;
}

.custom-metric-picker {
    margin-top: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: color-mix(in srgb, var(--surface-soft) 76%, var(--surface));
    padding: 8px;
}

.custom-metric-picker[hidden] {
    display: none;
}

.custom-metric-search {
    margin-bottom: 8px;
}

.custom-metric-browser {
    height: 330px;
    min-height: 0;
}

.custom-finish-row {
    grid-template-columns: minmax(0, 1fr) 52px;
}

.favorite-library {
    max-height: 520px;
    border: 0;
    background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.centered-error {
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: stretch;
    justify-items: center;
    padding: 0;
}

.centered-error .simple-topbar {
    justify-self: stretch;
}

.error-panel {
    width: min(400px, calc(100% - 56px));
    align-self: center;
    margin: 28px 0;
    padding: 24px;
    text-align: center;
}

.error-panel h1 {
    margin: 14px 0 8px;
}

.error-panel .primary-button {
    margin-top: 16px;
}

@media (max-width: 980px) {
    .overview-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .overview-flow-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .security-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .chart-terminal {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    .chart-sidebar {
        grid-row: 2;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        overflow: visible;
    }

    .chart-stage {
        grid-row: 1;
        grid-template-rows: auto minmax(360px, 58vh) auto;
        overflow: visible;
    }

    .chart-toolbar {
        display: contents;
    }

    .chart-meta {
        grid-row: 1;
        justify-content: start;
        padding: 10px 12px;
        border-bottom: 1px solid var(--line-soft);
    }

    .chart-tools {
        grid-row: 3;
        justify-content: start;
        margin-left: 0;
        padding: 10px 12px;
        border-top: 1px solid var(--line-soft);
    }

    .chart-canvas,
    .chart-canvas-shell {
        min-height: 360px;
    }
}

@media (max-width: 1180px) {
    .movers-controls {
        justify-content: start;
    }

    .movers-tabs {
        grid-template-columns: repeat(10, 132px);
    }

}

@media (max-width: 860px) {
    .login-stage,
    .status-grid,
    .intel-grid,
    .intelligence-grid,
    .metrics-row,
    .security-metrics {
        grid-template-columns: 1fr;
    }

    .login-stage {
        min-height: 0;
    }

    .login-status {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        gap: 22px;
    }

    .login-side-copy,
    .login-side-copy h2,
    .login-side-copy > span {
        max-width: none;
    }

    .terminal-topbar {
        align-items: center;
        padding: 14px;
    }

    .topbar-left {
        flex: 1 1 auto;
        gap: 12px;
        flex-wrap: nowrap;
    }

    .nav-toggle {
        display: inline-grid;
    }

    .terminal-nav {
        position: absolute;
        top: 56px;
        right: 14px;
        width: min(180px, calc(100vw - 28px));
        z-index: 30;
        display: none;
        align-items: stretch;
        flex-direction: column;
        gap: 2px;
        border: 1px solid var(--line);
        border-radius: 6px;
        background: var(--surface);
        box-shadow: var(--shadow);
        padding: 6px;
    }

    .terminal-nav.is-open {
        display: flex;
    }

    .terminal-nav a {
        min-height: 34px;
        justify-content: end;
        padding: 0 10px;
        text-align: right;
    }

    .page-heading {
        display: grid;
        align-items: start;
    }

    .intelligence-heading {
        width: 100%;
        justify-content: stretch;
    }

    .page-actions {
        justify-content: start;
    }

    .chart-actions {
        justify-content: start;
    }

    .control-strip,
    .intelligence-search,
    .movers-controls,
    .danger-form,
    .admin-user-form {
        grid-template-columns: 1fr;
        width: 100%;
        min-width: 0;
        justify-self: stretch;
    }

    .admin-user-summary {
        grid-template-columns: 1fr 1fr;
    }

    .admin-user-identity,
    .admin-user-summary > .admin-user-actions {
        grid-column: 1 / -1;
    }

    .movers-controls {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .movers-controls label,
    .movers-limit-control {
        width: 100%;
        min-width: 0;
    }

    .movers-panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .movers-table-shell {
        max-height: none;
    }

    .page-movers,
    .page-rankings {
        overflow-x: hidden;
    }

    .page-movers .terminal-main,
    .page-rankings .terminal-main,
    .movers-workspace,
    .movers-tab-panel,
    .movers-table-shell {
        max-width: 100%;
        min-width: 0;
    }

    .range-selector {
        width: 100%;
        grid-auto-flow: initial;
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .range-selector button {
        min-width: 0;
    }

    .custom-range-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .transactions-panel,
    .overview-panel {
        height: auto;
        min-height: 0;
    }

    .balance-panel .panel-heading,
    .flow-panel .panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .balance-controls,
    .flow-controls {
        display: grid;
        grid-template-columns: auto auto max-content;
        align-items: center;
        justify-content: stretch;
        gap: 6px;
    }

    .balance-controls {
        grid-template-columns: minmax(0, 1fr) max-content;
    }

    .balance-axis-toggle,
    .flow-mode-toggle {
        grid-column: 1 / -1;
        grid-auto-flow: initial;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        height: 28px;
    }

    .balance-controls .balance-axis-toggle {
        grid-column: auto;
    }

    .balance-controls .balance-fullscreen-button {
        justify-self: end;
    }

    .balance-axis-toggle button,
    .flow-mode-toggle button {
        min-height: 22px;
        padding: 0 7px;
        font-size: 10px;
    }

    .flow-limit-control,
    .flow-dust-control {
        min-height: 28px;
        gap: 5px;
        font-size: 9px;
    }

    .flow-limit-control {
        padding: 0 4px 0 7px;
    }

    .flow-dust-control {
        padding: 0 7px;
    }

    .flow-limit-control .custom-select {
        width: 58px;
    }

    .flow-limit-control .custom-select-button {
        min-height: 22px;
        padding-left: 3px;
        font-size: 10px;
    }

    .flow-dust-control input {
        width: 12px;
        min-height: 12px;
    }

    .flow-fullscreen-button {
        width: auto;
        min-width: 82px;
        height: 28px;
        grid-auto-flow: column;
        gap: 5px;
        padding: 0 8px;
    }

    .transaction-fullscreen-button {
        display: inline-grid;
    }

    .balance-fullscreen-button {
        width: 28px;
        min-width: 0;
        gap: 0;
        padding: 0;
    }

    .flow-fullscreen-button svg {
        width: 14px;
        height: 14px;
    }

    .flow-fullscreen-label {
        display: block;
        min-width: 0;
        overflow: hidden;
        color: var(--muted);
        font-size: 9px;
        font-weight: 760;
        text-overflow: ellipsis;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .flow-panel.is-fullscreen .flow-fullscreen-label,
    .balance-panel.is-fullscreen .flow-fullscreen-label,
    .transactions-panel.is-fullscreen .flow-fullscreen-label {
        display: none;
    }

    .flow-panel:not(.is-fullscreen) .intelligence-chart {
        pointer-events: none;
    }

    .transactions-panel.is-fullscreen {
        inset: 0;
        width: 100%;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        padding: 12px;
    }

    .transactions-panel.is-fullscreen .panel-heading {
        align-items: center;
        flex-direction: row;
        gap: 10px;
    }

    .transactions-panel.is-fullscreen .panel-heading h2 {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .transactions-panel.is-fullscreen .intelligence-table-shell {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .transactions-panel.is-fullscreen .transaction-table {
        min-width: 980px;
    }

    .page-intel {
        overflow-x: hidden;
    }

    .page-intel .terminal-main,
    .intelligence-workspace,
    .intelligence-grid,
    .intelligence-panel,
    .intelligence-chart-shell,
    .intelligence-table-shell,
    .overview-table-shell {
        max-width: 100%;
        min-width: 0;
    }

    .page-intel input,
    .page-intel select,
    .page-intel button {
        font-size: 16px;
    }

    .page-intel label span,
    .page-intel .range-selector button,
    .page-intel .transaction-pagination span,
    .page-intel .wallet-favorite-menu-panel button {
        font-size: 11px;
    }

    .page-intel .balance-axis-toggle button,
    .page-intel .flow-mode-toggle button {
        font-size: 10px;
    }

    .page-intel .flow-limit-control .custom-select-button {
        font-size: 10px;
    }

    .page-intel .flow-fullscreen-button {
        font-size: 12px;
    }

    .page-intel .transaction-filter-cell input,
    .page-intel .transaction-filter-cell select,
    .page-intel .transaction-filter-cell .custom-select-button,
    .page-intel .transaction-sort-toggle button {
        font-size: 11px;
    }

    .transaction-pagination {
        justify-content: space-between;
    }

}

@media (max-width: 560px) {
    .login-stage {
        width: calc(100% - 28px);
        margin: 14px 0;
    }

    .renew-stage {
        width: min(560px, calc(100% - 28px));
        margin: 14px 0;
    }

    .error-panel {
        width: min(400px, calc(100% - 28px));
        margin: 14px 0;
    }

    .login-status,
    .login-card {
        padding: 20px;
    }

    .access-request {
        align-items: stretch;
        flex-direction: column;
    }

    .access-request .secondary-button {
        width: 100%;
    }

    .login-card {
        margin: 14px;
    }

    .terminal-main {
        width: min(100% - 20px, 1220px);
        margin-top: 0;
        padding-top: 20px;
    }

    .overview-metrics,
    .overview-flow-split {
        grid-template-columns: 1fr;
    }

    .overview-flow-meta {
        grid-template-columns: 1fr;
    }

    .charts-workspace {
        width: calc(100vw - 20px);
        margin-left: calc(50% - 50vw + 10px);
    }

    .chart-terminal {
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .chart-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .chart-status {
        justify-self: start;
    }

    .builder-row,
    .builder-row.is-compact {
        grid-template-columns: 1fr;
    }

    .chart-modal {
        padding: 10px;
    }

    .chart-modal-panel {
        height: auto;
        max-height: calc(100vh - 20px);
        padding: 12px;
    }

    .add-step-panel {
        max-height: calc(100vh - 104px);
    }

    .add-step-panel[data-add-step="metric"] {
        height: calc(100vh - 104px);
    }

    .metric-browser {
        min-height: 0;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, minmax(0, 1fr));
    }

    .metric-browser-list,
    .metric-results {
        max-height: none;
    }

    .custom-metric-browser {
        height: 561px;
    }

    .custom-step {
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 10px;
    }

    .custom-step-marker {
        width: 28px;
        height: 28px;
    }

    .custom-step:not(:last-child)::after {
        left: 14px;
        top: 30px;
    }

    .resolution-pills {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .custom-finish-row {
        grid-template-columns: 1fr;
    }

    .chart-stage {
        grid-template-rows: auto minmax(330px, 54vh) auto;
    }

    .chart-canvas,
    .chart-canvas-shell {
        min-height: 330px;
    }

    .chart-watermark {
        font-size: clamp(23px, 5.4vw, 26px);
    }

    .series-legend {
        grid-template-columns: 1fr;
    }

    .terminal-footer {
        width: 100%;
        min-height: 38px;
        flex-wrap: wrap;
        align-content: center;
        padding: 0 10px;
    }

    .terminal-topbar .brand-logo {
        height: 31px;
    }

    .settings-popover {
        width: min(300px, calc(100vw - 20px));
    }
}

@media (max-width: 980px) {
    .alerts-channel-grid,
    .alerts-layout {
        grid-template-columns: 1fr;
    }

    .alerts-list-panel {
        height: auto;
        overflow: visible;
    }

    .alerts-list {
        overflow-y: visible;
        padding-right: 0;
    }

    .alert-list-item {
        grid-template-columns: 1fr;
    }

    .alert-list-actions {
        justify-content: stretch;
    }

    .alert-list-actions .secondary-button {
        flex: 1;
    }
}

@media (max-width: 640px) {
    .alerts-two-fields,
    .alerts-three-fields,
    .alert-channel-options {
        grid-template-columns: 1fr;
    }

    .alerts-panel-title {
        align-items: stretch;
        flex-direction: column;
    }

    .alerts-panel-title .primary-button,
    .alerts-panel-title .secondary-button {
        width: 100%;
    }

    .alert-list-title,
    .alert-list-main p {
        white-space: normal;
    }

    .alert-list-actions {
        flex-direction: column;
    }

    .alert-list-actions .secondary-button {
        width: 100%;
    }
}
