.app-page {
    display: grid;
    gap: 24px;
}

.app-page h1,
.app-page h2,
.app-page h3,
.app-page p {
    margin-top: 0;
}

.app-section {
    display: grid;
    gap: 16px;
    background:
        linear-gradient(180deg, rgba(13, 27, 38, 0.98), rgba(6, 18, 28, 0.98));
    border: 1px solid #2a3b47;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.app-section__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    border-bottom: 1px solid rgba(42, 59, 71, 0.8);
    padding-bottom: 12px;
}

.app-section__header h2 {
    margin-bottom: 0;
}

.app-section__aside {
    color: #ffccba;
    font-size: 14px;
    font-weight: 700;
}

.app-card {
    border: 1px solid #2a3b47;
    border-radius: 8px;
    background: #010d15;
}

.app-card--panel {
    padding: 16px;
}

.app-control-card {
    display: grid;
    gap: 12px;
    align-content: start;
}

.app-card.app-control-card h2,
.app-card.app-control-card h3,
.app-card.app-control-card p {
    margin-bottom: 0;
}

.app-card.app-control-card p {
    color: #c9d5df;
}

.app-card h2,
.app-card h3 {
    margin-bottom: 12px;
}

.app-feature-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    border: 1px solid #2a3b47;
    border-radius: 8px;
    padding: 16px;
    background:
        radial-gradient(circle at top left, rgba(30, 136, 229, 0.18), transparent 45%),
        #010d15;
}

.app-feature-card--danger {
    border-color: rgba(227, 19, 55, 0.45);
}

.app-feature-card--accent {
    border-color: rgba(30, 136, 229, 0.45);
}

.app-feature-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-feature-card__icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55));
}

.app-feature-card__body {
    min-width: 0;
}

.app-feature-card__topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.app-feature-card__topline h3 {
    margin-bottom: 0;
}

.app-grid {
    --app-grid-min: 280px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--app-grid-min)), 1fr));
    gap: 16px;
    align-items: stretch;
}

.app-grid--compact {
    gap: 8px;
}

.app-grid--loose {
    gap: 24px;
}

.app-grid--two {
    --app-grid-min: 340px;
}

.app-grid--three {
    --app-grid-min: 260px;
}

.app-grid--align-start {
    align-items: start;
}

.app-stack {
    display: grid;
    gap: 16px;
}

.app-stack--compact {
    gap: 8px;
}

.app-stack--loose {
    gap: 24px;
}

.app-status-grid {
    display: grid;
    gap: 16px;
}

.app-status-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.app-status-item {
    display: flex;
    gap: 12px;
    min-width: 0;
}

.app-status-item .material-symbols-outlined {
    flex: 0 0 auto;
}

.app-status-item strong,
.app-status-item span:not(.material-symbols-outlined) {
    display: block;
}

.app-status-item span:not(.material-symbols-outlined) {
    color: #c9d5df;
    font-size: 14px;
    line-height: 1.35;
}

.app-status-item--ready .material-symbols-outlined {
    color: #4caf50;
}

.app-status-item--attention .material-symbols-outlined {
    color: #fba342;
}

.app-eyebrow {
    display: block;
    color: #fba342;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.app-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #2a3b47;
    border-radius: 999px;
    padding: 2px 10px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 800;
}

.app-chip--ready {
    border-color: rgba(76, 175, 80, 0.7);
    color: #8df36a;
    background-color: rgba(76, 175, 80, 0.12);
}

.app-chip--danger {
    border-color: rgba(214, 51, 1, 0.75);
    color: #ffccba;
    background-color: rgba(214, 51, 1, 0.12);
}

.app-chip--muted {
    color: #c9d5df;
    background-color: rgba(42, 59, 71, 0.35);
}

.app-button {
    width: 100%;
    border: 1px solid rgba(30, 136, 229, 0.75);
    border-radius: 8px;
    padding: 10px 14px;
    background: linear-gradient(180deg, #1e88e5, #0f5ea4);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.app-button:not(:disabled):hover {
    background: linear-gradient(180deg, #42a5f5, #1e88e5);
}

.app-button:disabled {
    border-color: #2a3b47;
    background: #182531;
    color: #82909b;
    cursor: default;
}

.app-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #2a3b47;
    border-radius: 8px;
    color: #fff;
    background: #0d1b26;
}

.app-icon-button:hover {
    color: #fff;
    background: #1e88e5;
    text-decoration: none;
}

.app-action-cluster {
    display: inline-flex;
    gap: 8px;
}

.app-toggle-list {
    display: grid;
    gap: 12px;
}

.app-toggle {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin: 0;
    cursor: pointer;
}

.app-toggle input[type="checkbox"] {
    position: absolute;
    inset: 0 auto auto 0;
    width: 42px;
    height: 24px;
    opacity: 0;
    pointer-events: none;
}

.app-toggle__control {
    position: relative;
    width: 42px;
    height: 24px;
    border: 1px solid #2a3b47;
    border-radius: 999px;
    background: #182531;
    box-sizing: border-box;
    transition: background-color 0.2s, border-color 0.2s;
}

.app-toggle__control::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #c9d5df;
    transition: transform 0.2s, background-color 0.2s;
}

.app-toggle input[type="checkbox"]:checked + .app-toggle__control {
    border-color: rgba(76, 175, 80, 0.7);
    background: rgba(76, 175, 80, 0.2);
}

.app-toggle input[type="checkbox"]:checked + .app-toggle__control::after {
    transform: translateX(18px);
    background: #8df36a;
}

.app-toggle input[type="checkbox"]:focus-visible + .app-toggle__control {
    outline: 2px solid rgba(30, 136, 229, 0.5);
    outline-offset: 2px;
}

.app-toggle input[type="checkbox"]:disabled + .app-toggle__control {
    opacity: 0.55;
}

.app-toggle__body {
    display: grid;
    gap: 2px;
}

.app-toggle__label {
    color: #f0f0f0;
    font-weight: 700;
    line-height: 1.35;
}

.app-toggle__hint {
    color: #c9d5df;
    font-size: 13px;
    line-height: 1.35;
}

.app-toggle--disabled .app-toggle__label,
.app-toggle--disabled .app-toggle__hint {
    color: #82909b;
}

.app-toggle--disabled {
    cursor: default;
}

.app-connection-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.app-connection-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.app-connection-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
}

.app-connection-card--primary {
    border-color: rgba(227, 19, 55, 0.42);
    background:
        radial-gradient(circle at top right, rgba(227, 19, 55, 0.12), transparent 38%),
        #010d15;
}

.app-connection-card--form {
    align-items: start;
}

.app-connection-card h3 {
    margin-bottom: 0;
}

.app-connection-card p {
    margin: 6px 0 0;
    color: #c9d5df;
}

.app-connection-card__status {
    align-self: stretch;
    display: grid;
    grid-template-columns: 1fr;
    justify-content: end;
    justify-items: end;
    align-content: center;
    gap: 12px;
    text-align: right;
}

.app-form-grid {
    display: grid;
    gap: 8px;
}

.app-form-grid label {
    color: #c9d5df;
    font-size: 14px;
    font-weight: 700;
}

.app-form-grid--split {
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
}

.app-inline-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.app-logo-button {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}

.app-logo-button img {
    height: 42px;
    border: 1px solid #fba342;
    border-radius: 8px;
    display: block;
    padding: 6px;
    box-sizing: border-box;
    background: #010d15;
}

.app-logo-button:hover img,
.app-logo-button:focus img {
    background: rgba(251, 163, 66, 0.14);
}

.app-notice {
    border: 1px solid;
    border-radius: 8px;
    padding: 14px 16px;
    font-weight: 700;
    text-align: center;
}

.app-submit-row {
    border-top: 1px solid rgba(42, 59, 71, 0.8);
    padding-top: 16px;
}

.app-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.app-tab {
    width: auto;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    padding: 0 0 4px;
    background: transparent;
    color: #c9d5df;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.app-tab.active,
.app-tab[aria-selected="true"] {
    color: #fff;
    border-bottom-color: #1e88e5;
}

.app-tab:not(.active):hover {
    color: #fff;
    border-bottom-color: #fff;
}

.app-tab-content {
    display: none;
}

.app-tab-content.active {
    display: block;
}

.app-tab-content.active.app-stack {
    display: grid;
}

.app-data-list {
    display: grid;
    border: 1px solid #2a3b47;
    border-radius: 8px;
    overflow: hidden;
    background: #010d15;
}

.app-data-list__row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 3fr;
}

.app-data-list__row:not(:first-child) {
    border-top: 1px solid #2a3b47;
}

.app-data-list__row:nth-child(odd) {
    background-color: rgba(13, 27, 38, 0.62);
}

.app-data-list__cell {
    padding: 8px;
    min-width: 0;
}

.app-field-error {
    display: none;
}

.app-input--full {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.is-hidden {
    display: none;
}

.hidden {
    display: none;
}

@media (max-width: 1100px) {
    .app-status-grid--four,
    .app-connection-grid--two {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-page {
        gap: 16px;
    }

    .app-grid {
        grid-template-columns: 1fr;
    }

    .app-section__header {
        display: grid;
    }

    .app-data-list__row {
        grid-template-columns: 1fr;
    }

    .app-feature-card,
    .app-connection-card {
        grid-template-columns: 1fr;
    }

    .app-feature-card__topline {
        display: grid;
    }

    .app-connection-card__status {
        justify-items: start;
        justify-content: start;
        text-align: left;
    }

    .app-form-grid--split,
    .app-inline-control {
        grid-template-columns: 1fr;
    }
}
