:root {
    --sidebar-width: 248px;
    --sidebar-width-collapsed: 72px;
    --header-height: 64px;
    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-border: #9aaaca;
    --color-text: #18243b;
    --color-muted: #607087;
    --color-primary: #8da9ff;
    --color-primary-dark: #7897ef;
    --color-danger: #6d2942;
    --color-danger-dark: #8f3857;
    --sidebar-bg: #1b2f60;
    --sidebar-bg-active: #8da9ff;
    --sidebar-text: #d8e2f4;
    --sidebar-text-active: #ffffff;
    --color-header: #1b2f60;
    --color-success-bg: #e4f7ec;
    --color-success: #1a8a4a;
    --color-neutral-bg: #eceef2;
    --color-tool-header: #e8efff;
    --color-tool-tab-bg: #dfe9ff;
    --color-danger-bg: #fdeef0;
    --color-input-hover: #eef4fa;
    --color-switch-bg: #a8bdcc;
    --color-search-bg: #1b2f60;
    --color-focus: rgba(47, 94, 255, 0.15);
    --color-danger-border: #e5bbc8;
    --color-route-hover-border: #7284a8;
}

[data-theme="dark"] {
    --color-bg: #080f20;
    --color-surface: #19294d;
    --color-border: #2a3d67;
    --color-text: #eef3ff;
    --color-muted: #a5b2ca;
    --color-primary: #8ca8ff;
    --color-primary-dark: #a9bdff;
    --color-danger: #f28b9b;
    --color-danger-dark: #ffb1bd;
    --sidebar-bg: #1b3264;
    --sidebar-bg-active: #8ca8ff;
    --sidebar-text: #d8e2f4;
    --sidebar-text-active: #ffffff;
    --color-header: #1b3264;
    --color-success-bg: #153b2a;
    --color-success: #83d8a5;
    --color-neutral-bg: #374151;
    --color-tool-header: #243a66;
    --color-tool-tab-bg: #20355d;
    --color-danger-bg: #4a202a;
    --color-input-hover: #21365e;
    --color-switch-bg: #4b608c;
    --color-search-bg: #19294d;
    --color-focus: rgba(140, 168, 255, 0.25);
    --color-danger-border: #704052;
    --color-route-hover-border: #8094c0;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
}

a {
    color: var(--color-primary);
}

/* ---------- Login ---------- */

.login-shell {
    min-height: 100vh;
    padding: 0;
    background: #223564;
}

.login-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.login-panel {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 56px;
    /* Same color as .login-shell - declared explicitly so the near-white text below
       has a directly resolvable background for contrast tooling; no visual change. */
    background: #223564;
}

.login-panel-brand {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.login-panel-inner {
    width: min(100%, 360px);
    display: grid;
    gap: 18px;
}

.login-brand {
    /* Matches the inherited .login-shell background - declared here too so contrast
       tooling can verify this rule directly instead of resolving multi-level inheritance. */
    background: #223564;
    color: #f7f9fd;
    display: inline-flex;
    max-width: 124px;
}

.login-brand svg {
    width: 100%;
    height: auto;
    display: block;
}

.login-copy {
    display: grid;
    gap: 10px;
}

.login-copy h1,
.login-form-copy h2 {
    margin: 0;
    font-size: 2.15rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
    background: #223564;
    color: #f4f7fb;
}

.login-copy p,
.login-form-copy p {
    margin: 0;
    max-width: 34ch;
    color: rgba(236, 242, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.45;
}

.login-copy-line {
    display: block;
    white-space: nowrap;
}

.login-panel-form {
    gap: 16px;
}

.login-form-copy h2 {
    font-size: 1.95rem;
}

.login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 18px;
    border-radius: 4px;
    background: #080c15;
    border: 1px solid rgba(0, 0, 0, 0.55);
    color: #ffffff;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
    transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.login-button:hover {
    transform: translateY(-1px);
    background: #0d1320;
}

.login-button-mark {
    width: 10px;
    height: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
}

.login-button-mark span {
    display: block;
    width: 100%;
    height: 100%;
}

.login-button-mark-red {
    background: #f25022;
}

.login-button-mark-green {
    background: #7fba00;
}

.login-button-mark-blue {
    background: #00a4ef;
}

.login-button-mark-yellow {
    background: #ffb900;
}

@media (max-width: 920px) {
    .login-split {
        grid-template-columns: 1fr;
    }

    .login-panel {
        min-height: 50vh;
        padding: 32px 24px;
    }

    .login-panel-brand {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
            .app-shell.sidebar-collapsed .sidebar-footer > .sidebar-link {
                width: 100%;
                margin-inline: 0;
    }

    .login-copy h1,
    .login-form-copy h2 {
        font-size: 1.8rem;
    }
}

/* ---------- App shell / sidebar ---------- */

.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--color-bg);
    color: var(--color-text);
}

.app-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    padding: 0 0.75rem 1.25rem;
    transition: width 0.15s ease;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
}

.app-shell.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-width-collapsed);
}

.app-shell.sidebar-collapsed .sidebar-label {
    display: none;
}

.app-shell.sidebar-collapsed .sidebar-brand-logo {
    display: none;
}

.sidebar-brand-logo-collapsed {
    display: none;
    width: 28px;
    height: 28px;
}

.app-shell.sidebar-collapsed .sidebar-brand-logo-collapsed {
    display: block;
}

.sidebar-header {
    display: flex;
    align-items: center;
    height: var(--header-height);
    flex-shrink: 0;
    margin: 0 -0.75rem;
    padding: 0 1.25rem;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
    position: relative;
    z-index: 1;
}

.sidebar-brand {
    display: inline-flex;
    align-items: center;
    width: 100%;
    color: #fff;
}

.app-shell.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0;
}

.app-shell.sidebar-collapsed .sidebar-brand {
    width: auto;
}

.sidebar-brand-logo {
    width: 100%;
    max-width: none;
    height: auto;
    display: block;
    transition: width 0.15s ease;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sidebar-group-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100% + 1.5rem);
    margin-bottom: 0.1rem;
    margin-inline: -0.75rem;
    padding: 0.75rem 1.5rem;
    padding-right: 0.75rem;
    color: rgba(216, 226, 244, 0.62);
    background: color-mix(in srgb, white 4%, var(--sidebar-bg));
    border: 0;
    font: inherit;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    cursor: pointer;
}

.sidebar-group-label:hover {
    color: var(--sidebar-text-active);
}

.sidebar-group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1;
}


.sidebar-group-chevron {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition: transform 0.15s ease;
}

.sidebar-group-label.collapsed .sidebar-group-chevron {
    transform: rotate(-90deg);
}

.app-shell.sidebar-collapsed .sidebar-group-label {
    display: none;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.75rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    padding: 0.35rem 0.55rem 0.85rem;
}

.sidebar-user-avatar {
    width: 2.15rem;
    height: 2.15rem;
    flex: 0 0 2.15rem;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    object-fit: cover;
    background: #8ca8ff;
}

.sidebar-user-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #15264f;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.sidebar-user-photo + .sidebar-user-initials {
    display: none;
}

.sidebar-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.sidebar-user-name,
.sidebar-user-status {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-name {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 650;
}

.sidebar-user-status {
    margin-top: 0.15rem;
    color: rgba(216, 226, 244, 0.72);
    font-size: 0.68rem;
}

.app-shell.sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding: 0.35rem 0 0.85rem;
}

.app-shell.sidebar-collapsed .sidebar-user-details {
    display: none;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-inline: -0.75rem;
    padding: 0.65rem 1.5rem;
    border-radius: 0;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link:hover {
    background: transparent;
    color: var(--sidebar-text-active);
    font-weight: 400;
}

.sidebar-link.active {
    background: transparent;
    border: 0;
    color: var(--sidebar-text);
    font-weight: 650;
}

.app-shell.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding-inline: 0;
}

.app-shell.sidebar-collapsed .sidebar-footer > .sidebar-link {
    width: 100%;
    margin-inline: 0;
}

.sidebar-theme-toggle {
    width: 100%;
    border: 0;
    font: inherit;
    cursor: pointer;
    text-align: left;
    background: transparent;
    color: var(--sidebar-text);
}

[data-theme="light"] .sidebar-theme-toggle {
    background: transparent;
    color: var(--sidebar-text);
}

.sidebar-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--sidebar-text-active);
}

.sidebar-icon {
    width: 1.25rem;
    height: 1.25rem;
    text-align: center;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-icon svg,
.sidebar-toggle svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

/* ---------- Main content ---------- */

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
}

.app-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: var(--header-height);
    padding: 0 1.25rem;
    background: var(--color-header);
    border-bottom: 1px solid var(--color-header);
    flex-shrink: 0;
}

.sidebar-toggle {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
    color: var(--sidebar-text-active);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
}

.app-topbar-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--sidebar-text-active);
}

.app-content {
    padding: 1.5rem 1.25rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    background: var(--color-bg);
}

/* Cap each page's top-level content so it doesn't stretch edge-to-edge on wide monitors.
   Excludes the confirm dialog backdrop, which must span the full viewport. */
.app-content > *:not(.confirm-backdrop):not(.schema-modal-backdrop) {
    max-width: 1400px;
    margin-left: 0;
    margin-right: auto;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
}

.page-subtitle {
    margin: 0;
    color: var(--color-muted);
    max-width: 60ch;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(16, 25, 46, 0.04);
}

.empty-state {
    color: var(--color-muted);
}

.worker-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.worker-stats {
    margin-bottom: 1.25rem;
}

.worker-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
    gap: 1rem;
}

.worker-layout h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.worker-table-wrapper {
    overflow-x: auto;
}

.worker-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.worker-table th,
.worker-table td {
    padding: 0.7rem 0.55rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
    font-size: 0.82rem;
}

.worker-table th {
    color: var(--color-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.trase-table {
    min-width: 760px;
}

.trase-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--color-tool-header);
    white-space: nowrap;
}

.trase-table th:first-child,
.trase-table td:first-child {
    width: 3.25rem;
    color: var(--color-muted);
    text-align: center;
}

.trase-table tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--color-tool-header) 35%, transparent);
}

.trase-table tbody tr:hover {
    background: var(--color-input-hover);
}

.trase-table td {
    line-height: 1.35;
}

.hot-reload-success {
    color: var(--color-success);
    margin: 0 0 1rem;
}

.worker-details {
    margin: 0;
}

.worker-details > div {
    display: grid;
    grid-template-columns: minmax(8rem, 0.8fr) minmax(0, 1.2fr);
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--color-border);
}

.worker-details dt {
    color: var(--color-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.worker-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.badge-accent {
    background: var(--color-primary);
    color: #ffffff;
}

.badge-warning {
    background: #8b6b24;
    color: #fff7d6;
}

.badge-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

@media (max-width: 900px) {
    .worker-layout {
        grid-template-columns: 1fr;
    }
}

/* ---------- Stats ---------- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 2px rgba(16, 25, 46, 0.04);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-muted);
    font-weight: 600;
}

.muted {
    color: var(--color-muted);
}

/* ---------- Integration overview ---------- */

.integration-panel {
    padding: 0;
    overflow: hidden;
}

.integration-panel-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.5rem 1.1rem;
    border-bottom: 1px solid var(--color-border);
}

.integration-eyebrow {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--color-primary);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.integration-panel h2 {
    margin: 0;
    font-size: 1.15rem;
}

.integration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.integration-item {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr);
    gap: 0.85rem;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.integration-item:nth-child(odd) {
    border-right: 1px solid var(--color-border);
}

.integration-item-wide {
    grid-column: 1 / -1;
    border-right: 0;
}

.integration-bullet {
    width: 0.55rem;
    height: 0.55rem;
    margin-top: 0.35rem;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(140, 168, 255, 0.1);
}

.integration-item h3 {
    margin: 0 0 0.35rem;
    color: var(--color-text);
    font-size: 0.92rem;
}

.integration-item h3 small {
    color: var(--color-muted);
    font-size: 0.74rem;
    font-weight: 500;
}

.integration-item p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

@media (max-width: 760px) {
    .integration-grid {
        grid-template-columns: 1fr;
    }

    .integration-item,
    .integration-item:nth-child(odd) {
        grid-column: auto;
        border-right: 0;
    }

    .integration-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ---------- Embedded iframes ---------- */

.iframe-card {
    padding: 0;
    overflow: hidden;
    height: calc(100vh - 172px);
    min-height: 480px;
}

.kafkaflow-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ---------- FeedHub docs ---------- */

.route-search {
    margin-bottom: 1rem;
}

.route-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.92rem;
    background: var(--color-search-bg);
    color: #ffffff;
    border-color: var(--color-search-bg);
}

.route-search input::placeholder {
    color: #a5b2ca;
}

.route-search input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-focus);
}

/* ---------- Confirm dialog ---------- */

.confirm-backdrop {
    position: fixed;
    inset: 0;
    max-width: none;
    margin: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 15, 32, 0.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.confirm-card {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 12px 32px rgba(8, 15, 32, 0.35);
}

.confirm-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.confirm-card p {
    margin: 0;
}

.confirm-card-headered {
    padding: 0;
    overflow: hidden;
}

.confirm-card-body {
    padding: 1.5rem;
}

.eventissuer-form-card {
    max-width: 760px;
}

.overflow-wrap-anywhere {
    overflow-wrap: anywhere;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ---------- Event Issuer tool ---------- */

/* Combined selectors needed here: .form-grid's own max-width/grid-template-columns rule appears
   later in this file with equal specificity, so a plain single-class override would lose the cascade. */
.form-grid.eventissuer-connection-grid {
    max-width: none;
    width: 100%;
}

.eventissuer-actions {
    margin-top: 1.5rem;
    margin-bottom: 0;
}

.form-grid.eventissuer-single-column-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: none;
}

.eventissuer-modal-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
}

.eventissuer-empty-state {
    margin-top: 1rem;
}

.eventissuer-subscription-list-spaced {
    margin-top: 1rem;
}

.route-card-details.eventissuer-subscription-details {
    grid-template-columns: minmax(0, 1fr) max-content;
}

.eventissuer-application-id-detail {
    text-align: right;
}

.eventissuer-userinfo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.eventissuer-userinfo-card {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.9rem;
    background: var(--color-bg);
}

.eventissuer-userinfo-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.eventissuer-userinfo-value {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.eventissuer-userinfo-section {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.9rem;
    background: var(--color-bg);
    margin-bottom: 1rem;
}

.eventissuer-userinfo-section:last-child {
    margin-bottom: 0;
}

.eventissuer-userinfo-list {
    list-style: none;
    margin: 0.6rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.4rem;
}

.eventissuer-userinfo-list li {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
    background: var(--color-surface);
    overflow-wrap: anywhere;
}

.eventissuer-detail-modal {
    max-width: 760px;
    height: min(920px, calc(100vh - 2rem));
}

.eventissuer-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.eventissuer-detail-grid:last-child {
    margin-bottom: 0;
}

.eventissuer-detail-card-span2 {
    grid-column: 1 / -1;
}

.eventissuer-detail-section-body {
    margin-top: 0.75rem;
}

.eventissuer-detail-array-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.eventissuer-detail-array-item {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.9rem;
    background: var(--color-surface);
}

.eventissuer-detail-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--color-border);
    border-bottom: 0;
}

@media (max-width: 720px) {
    .form-grid.eventissuer-connection-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.8rem;
    }

    .eventissuer-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.6rem;
    }

    .eventissuer-actions > button {
        width: 100%;
    }

    .eventissuer-subscription-list-spaced .route-card-header {
        align-items: flex-start;
    }

    .eventissuer-subscription-list-spaced .route-card-title {
        min-width: 0;
        width: 100%;
    }

    .eventissuer-subscription-list-spaced .route-key {
        overflow-wrap: anywhere;
    }

    .eventissuer-subscription-list-spaced .route-card-header .row-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 0.5rem;
    }

    .eventissuer-subscription-list-spaced .route-card-header .row-actions > button {
        width: 100%;
    }

    .route-card-details.eventissuer-subscription-details {
        grid-template-columns: minmax(0, 1fr) minmax(7rem, max-content);
        gap: 0.75rem;
    }

    .eventissuer-application-id-detail .route-detail-value {
        overflow-wrap: anywhere;
    }
}

.tabs {
    display: flex;
    width: 100%;
    background: var(--sidebar-bg);
    border-radius: 999px;
    padding: 0.35rem;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
}

.config-layout {
    display: grid;
    flex: 1;
    min-height: 0;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    grid-template-columns: var(--config-tab-width, 220px) 16px minmax(0, 1fr);
}

.config-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.app-content:has(.config-page) {
    overflow: hidden;
}

.config-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.65rem;
    height: auto;
    min-width: 0;
    overflow-y: auto;
}

.config-tabs-label {
    padding: 0.35rem 0.7rem 0.55rem;
    color: var(--color-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.config-tab {
    width: 100%;
    border: 0;
    border-radius: 7px;
    padding: 0.65rem 0.7rem;
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    text-align: left;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.config-tab:hover {
    background: rgba(140, 168, 255, 0.1);
    color: var(--color-text);
}

.config-tab.active {
    background: rgba(140, 168, 255, 0.18);
    color: var(--color-text);
    font-weight: 700;
}

.config-resizer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 2rem;
    cursor: col-resize;
    touch-action: none;
}

.config-resizer-grip {
    width: 2px;
    height: 100%;
    background: var(--color-border);
    transition: width 0.15s ease, background-color 0.15s ease;
}

.config-resizer:hover .config-resizer-grip,
.config-resizer:focus-visible .config-resizer-grip,
.config-layout.is-resizing .config-resizer-grip {
    width: 4px;
    background: var(--color-primary);
}

.config-layout.is-resizing {
    cursor: col-resize;
    user-select: none;
}

.config-panel {
    min-width: 0;
    height: 100%;
    padding: 1.25rem 1.25rem 1.25rem 1.25rem;
    overflow-y: auto;
}

.config-panel > .card {
    min-height: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.config-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.config-section-header h2 {
    margin: 0;
    color: var(--color-primary);
    font-size: 1.15rem;
}

.config-table-wrapper {
    overflow-x: auto;
}

.config-table-wrapper dl {
    margin: 0;
}

.config-row {
    display: grid;
    grid-template-columns: minmax(12rem, 0.7fr) minmax(0, 1.3fr);
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.config-row:last-child {
    border-bottom: 0;
}

.config-row dt {
    color: var(--color-muted);
    font-size: 0.78rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.config-row dd {
    margin: 0;
    color: var(--color-text);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .config-layout {
        display: contents;
        height: auto;
        min-height: 0;
        grid-template-columns: 1fr;
        grid-auto-rows: min-content;
        align-content: start;
        overflow: visible;
    }

    .config-tabs {
        flex-direction: row;
        align-items: center;
        gap: 0.35rem;
        padding: 0.6rem 0.75rem;
        overflow-x: auto;
        scrollbar-width: thin;
        overflow-y: hidden;
        border: 1px solid var(--color-border);
        border-radius: 12px;
        background: var(--color-neutral-bg);
        margin-bottom: 0.75rem;
    }

    .config-resizer {
        display: none;
    }

    .config-panel {
        height: auto;
        padding: 0;
        overflow-y: visible;
    }

    .config-panel > .card {
        min-height: 0;
        padding: 1rem;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: 10px;
        box-shadow: 0 1px 2px rgba(16, 25, 46, 0.04);
    }

    .config-tabs-label {
        display: none;
    }

    .config-tab {
        width: auto;
        flex: 0 0 auto;
        white-space: nowrap;
        border-radius: 999px;
        padding: 0.45rem 0.85rem;
        font-size: 0.82rem;
    }

    .config-tab:hover {
        background: transparent;
        color: var(--color-text);
    }

    .config-tab.active {
        background: var(--color-header);
        color: #fff;
        box-shadow: 0 2px 8px rgba(47, 94, 255, 0.35);
        font-weight: 600;
    }

    .config-section-header {
        flex-wrap: wrap;
        gap: 0.35rem;
        margin-bottom: 0.75rem;
    }

    .config-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        padding: 0.65rem 0;
    }

    .config-row dd {
        font-size: 0.82rem;
    }
}

.tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: none;
    border: none;
    border-radius: 999px;
    padding: 0.35rem 1rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tab:hover {
    color: #fff;
}

.tab.active {
    background: var(--color-header);
    color: #fff;
    box-shadow: 0 2px 8px rgba(47, 94, 255, 0.35);
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: color-mix(in srgb, white 15%, var(--sidebar-bg));
    color: color-mix(in srgb, white 85%, var(--sidebar-bg));
    font-size: 0.75rem;
    font-weight: 700;
}

/* Light theme: the dark navy search/tabs bars read as jarring against the
   white page background, so use a light, bordered surface instead. */
[data-theme="light"] .route-search input {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

[data-theme="light"] .route-search input::placeholder {
    color: var(--color-muted);
}

[data-theme="light"] .tabs {
    background: var(--color-neutral-bg);
    border: 1px solid var(--color-border);
}

[data-theme="light"] .tab {
    color: #000000;
}

[data-theme="light"] .tab:hover {
    color: var(--color-text);
}

[data-theme="light"] .tab.active {
    color: #fff;
}

[data-theme="light"] .tab-count {
    background: rgba(24, 36, 59, 0.08);
    color: var(--color-muted);
}

[data-theme="light"] .tab.active .tab-count {
    background: color-mix(in srgb, white 25%, var(--color-header));
    color: #fff;
}

/* Dark theme: .tabs and the active tab both use dark navy shades that are
   nearly identical, so darken the tabs bar itself to keep the active pill visible. */
[data-theme="dark"] .tabs {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
}

.tab.active .tab-count {
    background: color-mix(in srgb, white 25%, var(--color-header));
    color: #fff;
}

.tab-panel {
    padding-top: 0.25rem;
}

.method-name {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-weight: 700;
    color: var(--color-primary);
}

.method-params-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.method-params-table th {
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-muted);
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.hub-empty-parameters {
    margin-left: 0.65rem;
}

.method-params-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.85rem;
    vertical-align: top;
}

.feedhub-docs-panel .method-params-table th:nth-child(2),
.feedhub-docs-panel .method-params-table td:nth-child(2) {
    text-align: right;
}

.schema {
    white-space: pre-wrap;
    margin: 0;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.78rem;
}

/* ---------- Route list (multi-row cards) ---------- */

.route-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.route-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem 1.15rem;
}

.route-card:hover {
    border-color: var(--color-route-hover-border);
}

.route-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.route-card-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.route-lock-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
}

.route-lock-button:hover {
    color: var(--color-text);
    background: var(--color-bg);
    border-color: var(--color-border);
}

.route-lock-button svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.route-card-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem 1.5rem;
}

@media (max-width: 720px) {
    .route-card-details {
        grid-template-columns: 1fr;
    }

    .topic-routes-page > .page-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .topic-routes-page > .page-header .row-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .topic-routes-page > .page-header .row-actions > * {
        width: 100%;
        box-sizing: border-box;
    }

    .topic-routes-page .tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        gap: 0.3rem;
        border-radius: 12px;
        scrollbar-width: thin;
    }

    .topic-routes-page .tab {
        flex: 0 0 auto;
        min-width: max-content;
        min-height: 2.75rem;
        padding: 0.45rem 0.65rem;
        line-height: 1.1;
        white-space: nowrap;
    }

    .topic-routes-page .tab-count {
        min-width: 1.2rem;
        height: 1.2rem;
        padding: 0 0.25rem;
        font-size: 0.68rem;
    }

    .topic-routes-page .route-card-header .row-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
}

/* ---------- FeedHub docs refinement ---------- */

.feedhub-docs-page {
    width: 100%;
}

.feedhub-docs-header {
    align-items: flex-end;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.feedhub-docs-eyebrow {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--color-primary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.feedhub-docs-total {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    color: var(--color-muted);
    white-space: nowrap;
}

.feedhub-docs-total strong {
    color: var(--color-text);
    font-size: 1.35rem;
}

.feedhub-docs-total span {
    font-size: 0.78rem;
}

.feedhub-docs-search {
    position: relative;
    margin-top: 1.25rem;
}

.feedhub-docs-search input {
    padding-left: 2.5rem;
}

.feedhub-search-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 0.9rem;
    color: var(--color-muted);
    font-size: 1.45rem;
    line-height: 1;
    transform: translateY(-55%);
    pointer-events: none;
}

.feedhub-docs-tabs {
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 999px;
}

.feedhub-docs-tabs .tab {
    flex: 1;
}

.feedhub-docs-panel {
    padding-top: 0;
}

.feedhub-docs-panel .route-list {
    gap: 0.65rem;
}

.feedhub-docs-panel .route-card {
    padding: 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(8, 15, 32, 0.12);
}

.feedhub-docs-panel .route-card-header {
    margin: 0;
    padding: 0.95rem 1.15rem;
    border-bottom: 1px solid var(--color-border);
}

.feedhub-docs-panel .method-params-table {
    margin: 0;
}

.feedhub-docs-panel .method-params-table th,
.feedhub-docs-panel .method-params-table td {
    padding: 0.65rem 1.15rem;
}

.feedhub-docs-panel .method-params-table th {
    background: rgba(140, 168, 255, 0.06);
}

.feedhub-docs-panel .method-params-table tr:last-child td {
    border-bottom: 0;
}

.type-description-trigger {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--color-primary);
    cursor: pointer;
    font: inherit;
}

.type-description-trigger:hover code,
.type-description-trigger:focus-visible code {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.type-description-trigger:focus-visible,
.type-description-close:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

.type-description-backdrop {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(8, 15, 32, 0.68);
}

.type-description-dialog {
    width: min(100%, 680px);
    max-height: min(80vh, 720px);
    overflow: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    color: var(--color-text);
    box-shadow: 0 20px 60px rgba(8, 15, 32, 0.35);
}

.type-description-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.type-description-label {
    color: var(--color-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.type-description-dialog h2 {
    margin: 0.3rem 0 0;
    color: var(--color-primary);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 1rem;
}

.type-description-close {
    border: 0;
    padding: 0.1rem 0.35rem;
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
    font-size: 1.65rem;
    line-height: 1;
}

.type-description-close:hover {
    color: var(--color-text);
}

.type-description-content {
    padding: 1.25rem;
}

.type-description-content pre {
    margin: 0;
    white-space: pre-wrap;
}

@media (max-width: 600px) {
    .feedhub-docs-header {
        align-items: flex-start;
        flex-direction: column;
    }

}

.route-detail {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.route-detail-span-all {
    grid-column: 1 / -1;
}

.route-detail-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-muted);
    margin-bottom: 0.2rem;
}

.route-detail-value {
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.route-key {
    font-weight: 600;
    font-size: 1rem;
}

.row-actions {
    display: flex;
    gap: 0.5rem;
    white-space: nowrap;
}

/* ---------- Badges ---------- */

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-muted {
    background: var(--color-neutral-bg);
    color: var(--color-muted);
}

/* ---------- Forms ---------- */

.back-link {
    display: inline-block;
    margin-bottom: 0.75rem;
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--color-primary);
}

.form-section {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.form-section:last-of-type {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.form-section-header {
    margin-bottom: 1rem;
}

.form-section-header h2 {
    font-size: 1.05rem;
    margin: 0 0 0.2rem;
}

.form-section-header p {
    margin: 0;
    font-size: 0.88rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
    max-width: 760px;
}

.form-row {
    display: flex;
    flex-direction: column;
}

.form-row-toggle {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.form-row-toggle label {
    margin-bottom: 0;
}

.form-row label {
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.form-row input:not([type="checkbox"]),
.form-row select {
    height: 42px;
    padding: 0 0.85rem;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--color-surface);
    color: var(--color-text);
    width: 100%;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-row input:not([type="checkbox"]).input-mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88rem;
}

.form-row select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7686'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.168l3.71-3.938a.75.75 0 1 1 1.08 1.04l-4.24 4.5a.75.75 0 0 1-1.08 0l-4.24-4.5a.75.75 0 0 1 .02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    padding-right: 2.35rem;
    cursor: pointer;
}

.form-row input::placeholder {
    color: #a3aab8;
}

.form-row input:hover,
.form-row select:hover {
    background: var(--color-input-hover);
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    background: var(--color-surface);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-focus);
}

.form-row input.invalid,
.form-row select.invalid {
    border-color: var(--color-danger);
}

.form-row input.invalid:focus,
.form-row select.invalid:focus {
    box-shadow: 0 0 0 3px rgba(209, 67, 91, 0.15);
}

.form-row input:disabled,
.form-row select:disabled {
    background: var(--color-bg);
    color: var(--color-muted);
    cursor: not-allowed;
}

.switch {
    position: relative;
    display: inline-flex;
    width: 42px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.switch-track {
    position: absolute;
    inset: 0;
    background: var(--color-switch-bg);
    border-radius: 999px;
    transition: background-color 0.15s ease;
    pointer-events: none;
}

.switch-track::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.switch input:checked + .switch-track {
    background: var(--color-primary);
}

.switch input:checked + .switch-track::before {
    transform: translateX(18px);
}

.switch-state {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

/* ---------- Buttons ---------- */

.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg);
}

.btn-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.btn-danger:hover {
    background: var(--color-danger);
    color: #fff;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.error {
    color: var(--color-danger-dark);
    font-weight: 600;
    background: var(--color-danger-bg);
    border: 1px solid var(--color-danger-border);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    margin-bottom: 1rem;
}

/* ---------- Base64 tool ---------- */

.base64-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.app-content:has(.base64-page) {
    overflow: hidden;
}

.base64-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.base64-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.base64-mode-switch {
    display: flex;
    width: 100%;
    padding: 0.35rem;
    border-radius: 999px;
    gap: 0.25rem;
    background: #080f20;
}

.base64-mode-button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    border: none;
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.base64-mode-button:hover {
    color: var(--color-text);
}

.base64-mode-button.active {
    color: #fff;
    background: var(--color-header);
    box-shadow: 0 2px 8px rgba(47, 94, 255, 0.35);
}

[data-theme="light"] .base64-mode-switch {
    background: var(--color-neutral-bg);
    border: 1px solid var(--color-border);
}

[data-theme="light"] .base64-mode-button {
    color: #000;
}

[data-theme="light"] .base64-mode-button:hover {
    color: var(--color-text);
}

[data-theme="light"] .base64-mode-button.active {
    color: #fff;
}

.base64-mode-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-focus);
}

.base64-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.base64-panel {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    min-height: 0;
}

.base64-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: 2.5rem;
    padding: 0.4rem 0.9rem;
    background: var(--color-tool-header);
    border-bottom: 1px solid var(--color-border);
    flex: 0 0 auto;
}

.base64-panel-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--color-text);
}

.base64-panel-body {
    padding: 0.9rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
}

.base64-textarea {
    width: 100%;
    height: 100%;
    resize: none;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
    padding: 0.75rem;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.55;
}

.base64-panel:first-child .base64-panel-body {
    padding: 0;
}

.base64-panel:first-child .base64-textarea {
    border: 0;
    border-radius: 0;
}

.base64-textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-focus);
}

.base64-output {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--color-text);
}

.base64-copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--color-muted);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.base64-copy-button svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.base64-copy-button:hover:not(:disabled) {
    color: var(--color-text);
}

.base64-copy-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.base64-error {
    border-radius: 8px;
    border: 1px solid var(--color-danger-border);
    background: var(--color-danger-bg);
    color: var(--color-danger-dark);
    padding: 0.75rem 0.9rem;
    line-height: 1.55;
    width: 100%;
    overflow: auto;
}

.base64-code-view {
    padding: 0;
}

.base64-code-line {
    min-height: 1.55em;
}

.base64-xml-tag {
    color: #4ea1ff;
    font-weight: 700;
}

.base64-xml-attribute {
    color: #d8a657;
}

.base64-xml-value {
    color: #8fce8f;
}

.base64-xml-bracket,
.base64-xml-punctuation {
    color: var(--color-muted);
}

.base64-xml-text {
    color: var(--color-text);
    font-weight: 600;
}

@media (max-width: 720px) {
    .config-page,
    .base64-page,
    .xsd-page {
        height: auto;
        min-height: 0;
    }

    .app-content:has(.config-page),
    .app-content:has(.base64-page),
    .app-content:has(.xsd-page) {
        overflow: visible;
    }

    .base64-card,
    .base64-stack,
    .xsd-layout {
        flex: none;
        min-height: auto;
    }

    .base64-panel {
        min-height: 20rem;
    }

    .base64-stack {
        grid-template-columns: 1fr;
    }

    .config-page {
        overflow: visible;
    }
}

/* ---------- Xsd Validator tool ---------- */

.xsd-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.app-content:has(.xsd-page) {
    overflow: hidden;
}

.xsd-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.xsd-main-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

.xsd-schema-card,
.xsd-xml-card,
.xsd-report-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.xsd-schema-card {
    height: 100%;
    min-height: 0;
}

.xsd-schema-card .xsd-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.xsd-xml-card {
    flex: 1;
    min-height: 0;
}

.xsd-xml-card .xsd-panel-body {
    flex: 1;
    min-height: 0;
    display: flex;
    padding: 0;
}

.xsd-xml-card .base64-textarea {
    border: 0;
    border-radius: 0;
}

.xsd-toolbar {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
}

.xsd-report-card {
    flex: 0 1 auto;
    max-height: 40%;
}

.xsd-report-card .xsd-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.xsd-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    background: var(--color-tool-header);
    border-bottom: 1px solid var(--color-border);
    flex: 0 0 auto;
}

.xsd-panel-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--color-text);
}

.xsd-panel-body {
    padding: 0.9rem;
}

.xsd-link-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    padding: 0.3rem 0.45rem;
    color: var(--color-primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
}

.xsd-link-button:hover {
    background: var(--color-tool-tab-bg);
    color: var(--color-primary);
    text-decoration: underline;
}

.xsd-link-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    text-decoration: none;
}

.xsd-hidden-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.xsd-report-modal {
    width: min(720px, calc(100vw - 2rem));
    height: auto;
    max-height: min(520px, calc(100vh - 3rem));
}

.xsd-report-modal .schema-modal-search {
    justify-content: flex-end;
    border-top: 1px solid var(--color-border);
    border-bottom: 0;
}

.xsd-schema-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.4rem;
}

.xsd-category {
    margin-bottom: 0.9rem;
}

.xsd-category:last-child {
    margin-bottom: 0;
}

.xsd-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.xsd-category-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.xsd-category-header .xsd-category-label {
    margin-bottom: 0;
}

.xsd-select-all {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--color-muted);
    cursor: pointer;
}

.xsd-schema-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
}

.xsd-schema-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text);
    cursor: pointer;
    overflow-wrap: anywhere;
}

.xsd-schema-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    background: transparent;
    color: var(--color-muted);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    border-radius: 6px;
    flex: 0 0 auto;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.xsd-schema-remove:hover {
    color: var(--color-danger);
    background: var(--color-danger-bg);
}

.xsd-schema-remove:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    background: transparent;
    color: var(--color-muted);
}

.xsd-report-success {
    color: var(--color-success);
    font-weight: 600;
}

.xsd-error-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.xsd-error-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--color-danger-border);
    background: var(--color-danger-bg);
    border-radius: 8px;
}

.xsd-error-loc {
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-danger-dark);
    white-space: nowrap;
}

.xsd-error-message {
    color: var(--color-text);
    overflow-wrap: anywhere;
}

@media (max-width: 720px) {
    .xsd-page {
        height: auto;
    }

    .app-content:has(.xsd-page) {
        overflow: visible;
    }

    .xsd-layout {
        grid-template-columns: 1fr;
    }

    .xsd-schema-card {
        height: auto;
        max-height: none;
    }

    .xsd-xml-card {
        min-height: 20rem;
    }

    .xsd-xml-card .xsd-panel-body,
    .xsd-xml-card .base64-textarea {
        min-height: 0;
    }

    .xsd-report-card {
        max-height: none;
    }
}

.xsd-schema-name-button {
    flex: 1;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    overflow-wrap: anywhere;
}

.xsd-schema-name-button:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* ---------- Schema viewer modal ---------- */

.schema-modal-backdrop {
    position: fixed;
    inset: 0;
    max-width: none;
    margin: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 15, 32, 0.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.schema-modal-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(8, 15, 32, 0.35);
    width: min(900px, 100%);
    height: min(850px, 100%);
    overflow: hidden;
}

.schema-modal-card-maximized {
    width: 96vw;
    height: 92vh;
}

.schema-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    background: var(--color-tool-header);
    border-bottom: 1px solid var(--color-border);
    flex: 0 0 auto;
}

.schema-modal-title {
    font-size: 0.92rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.schema-modal-header-actions {
    display: flex;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.schema-modal-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid var(--color-border);
    flex: 0 0 auto;
}

.schema-modal-search-input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

.schema-modal-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-focus);
}

.schema-modal-search-count {
    flex: 0 0 auto;
    font-size: 0.78rem;
    color: var(--color-muted);
    white-space: nowrap;
}

.schema-modal-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.9rem;
}

.xml-search-match {
    background: #8b6b24;
    color: #fff7d6;
    border-radius: 2px;
}

.xml-search-match-active {
    background: var(--color-primary);
    color: #ffffff;
}

@media (max-width: 720px) {
    .schema-modal-card {
        width: 100%;
        height: 100%;
    }

    .eventissuer-detail-modal {
        height: 100%;
    }
}

/* ---------- Trase tool ---------- */

.trase-combobox {
    position: relative;
    width: 100%;
}

.trase-section-spaced {
    margin-top: 1rem;
}

.trase-combobox-input {
    width: 100%;
    height: 42px;
    padding: 0 2.25rem 0 0.85rem;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88rem;
}

.trase-combobox-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-focus);
}

.trase-combobox-clear {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--color-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
}

.trase-combobox-clear:hover {
    color: var(--color-text);
}

.trase-combobox-dropdown {
    position: absolute;
    z-index: 50;
    top: calc(100% + 0.3rem);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0.3rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.25);
}

.trase-combobox-item {
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    font-size: 0.88rem;
    cursor: pointer;
}

.trase-combobox-item-highlighted {
    background: var(--color-bg);
}

.trase-combobox-item-selected {
    background: color-mix(in srgb, var(--color-primary) 16%, var(--color-surface));
}

.trase-combobox-empty {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    color: var(--color-muted);
}

.trase-status {
    margin: 0.75rem 0 0;
}

.trase-response-card details {
    width: 100%;
}

.trase-details-summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92rem;
}

.trase-json-pre {
    margin: 0.9rem 0 0;
    max-height: 60vh;
    overflow: auto;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.8rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--color-text);
}


