.landing-page {
    display: grid;
    min-height: 100vh;
    padding: clamp(20px, 5vw, 64px);
}

.landing-shell {
    width: min(100%, 920px);
    margin: auto;
}

.landing-hero {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: clamp(24px, 5vw, 52px);
    align-items: center;
    margin-bottom: 28px;
}

.landing-page .logo {
    display: grid;
    width: 132px;
    height: 132px;
    margin: 0 !important;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 32px;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 20px 55px rgba(15, 23, 42, .12);
    backdrop-filter: blur(18px);
}

.landing-page .logo img {
    width: 118px !important;
    height: 118px;
    object-fit: contain;
}

.hero-copy h1 {
    margin: 9px 0 7px;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.08;
    letter-spacing: -.035em;
}

.hero-copy p {
    max-width: 580px;
    margin: 0;
    color: var(--dx-muted);
    font-size: 16px;
}

.server-status {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--dx-success);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
}

.server-status > span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, .13);
}

.dev-joke {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    margin: 0 0 18px;
    padding: 13px 17px;
    border: 1px solid rgba(99, 102, 241, .18);
    border-radius: 16px;
    background: rgba(238, 242, 255, .72);
    color: #39415f;
}

.dev-joke > span {
    color: #6366f1;
    font: 700 34px/1 Georgia, serif;
}

.dev-joke p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
}

.dev-joke code {
    color: #4338ca;
    font-weight: 750;
}

.demo-disclaimer {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 18px;
    padding: 17px 19px;
    border: 1px solid #f1c56a;
    border-radius: 18px;
    background: #fff8df;
    color: #553c08;
    box-shadow: 0 12px 34px rgba(120, 82, 12, .09);
}

.demo-disclaimer-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: #f59e0b;
    color: #fff;
    font-size: 24px;
    font-weight: 850;
}

.demo-disclaimer h2 {
    margin: 0 0 5px;
    font-size: 16px;
}

.demo-disclaimer p {
    margin: 0 0 7px;
    font-size: 13px;
    line-height: 1.55;
}

.demo-disclaimer a {
    color: #8a4b08;
    font-size: 13px;
    font-weight: 750;
}

.connection-panel {
    padding: clamp(22px, 4vw, 36px);
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: 24px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
    backdrop-filter: blur(20px);
}

.upload-database {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 62px;
    padding: 10px 15px;
    border: 1px solid #bcd0f5;
    border-radius: 14px;
    background: var(--dx-primary-soft);
    color: var(--dx-primary);
    font-weight: 750;
    text-decoration: none;
    transition: border-color .15s, background-color .15s, transform .15s, box-shadow .15s;
}

.upload-database:hover {
    border-color: #8cafe9;
    background: #e8f0ff;
    box-shadow: 0 9px 24px rgba(37, 99, 235, .1);
    transform: translateY(-1px);
}

.upload-database:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .22);
    outline-offset: 2px;
}

.upload-database-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 11px;
    background: #fff;
    font-size: 21px;
}

.connection-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--dx-muted);
    font-size: 12px;
    font-weight: 700;
}

.connection-divider::before,
.connection-divider::after {
    height: 1px;
    background: var(--dx-border);
    content: "";
    flex: 1;
}

#connection-form label,
.connection-section h2 {
    display: block;
    margin: 0 0 10px;
    color: #43516a;
    font-size: 13px;
    font-weight: 700;
}

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

.connection-control input {
    min-width: 0;
    min-height: 50px !important;
    padding-inline: 15px !important;
    font-size: 16px !important;
}

.connection-control button {
    display: inline-flex;
    min-width: 130px;
    min-height: 50px;
    gap: 12px;
    align-items: center;
    justify-content: center;
    border-color: var(--dx-primary);
    background: var(--dx-primary);
    color: #fff;
    font-weight: 700;
}

.connection-control button:hover {
    border-color: var(--dx-primary-hover);
    background: var(--dx-primary-hover);
}

.connection-error {
    min-height: 21px;
    margin: 7px 0 0;
    color: var(--dx-danger);
    font-size: 13px;
}

[aria-invalid="true"] {
    border-color: var(--dx-danger) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .1) !important;
}

.connection-hint {
    margin: 7px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--dx-border);
    color: var(--dx-muted);
}

.connection-section {
    margin-top: 7px;
    padding-top: 20px;
    border-top: 1px solid var(--dx-border);
}

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

.connection-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    min-height: 96px;
    padding: 10px 14px;
    border: 1px solid var(--dx-border);
    border-radius: 13px;
    background: var(--dx-surface-soft);
    color: var(--dx-text);
    text-decoration: none;
    transition: border-color .15s, background-color .15s, transform .15s, box-shadow .15s;
}

.connection-card:hover {
    border-color: #a8bee0;
    background: var(--dx-primary-soft);
    box-shadow: 0 9px 24px rgba(37, 99, 235, .1);
    transform: translateY(-1px);
}

.connection-card:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .22);
    outline-offset: 2px;
}

.connection-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 10px;
    background: #fff;
}

.connection-icon img {
    width: 21px;
    height: 21px;
}

.connection-name {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.connection-details {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.connection-alias,
.connection-source {
    color: var(--dx-muted);
    font-size: 11px;
}

.connection-description {
    display: -webkit-box;
    overflow: hidden;
    color: #53647d;
    font-size: 12px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.connection-credentials {
    width: fit-content;
    margin-top: 3px;
    padding: 3px 7px;
    border-radius: 7px;
    background: #e7efff;
    color: #244d9d;
    font-size: 11px;
    font-weight: 700;
}

.connection-compat {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.connection-compat > span,
.connection-compat-pending {
    width: fit-content;
    padding: 3px 7px;
    border: 1px solid #cbd8ec;
    border-radius: 999px;
    background: #f7faff;
    color: #435672;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.25;
}

.connection-compat-ready > span {
    border-color: #b7ddc2;
    background: #effaf2;
    color: #24613a;
}

.connection-compat-warning > span {
    border-color: #ead6a5;
    background: #fff9e9;
    color: #805b12;
}

.connection-compat-pending {
    display: inline-block;
    margin-top: 4px;
    border-style: dashed;
    color: var(--dx-muted);
}

.connection-arrow {
    color: var(--dx-primary);
    font-size: 19px;
}

html[data-theme="dark"] .landing-page .logo {
    border-color: rgba(100, 127, 164, .38);
    background: rgba(17, 28, 47, .78);
    box-shadow: 0 22px 56px rgba(0, 0, 0, .32);
}

html[data-theme="dark"] .dev-joke {
    border-color: rgba(129, 140, 248, .3);
    background: rgba(30, 41, 79, .72);
    color: #d6dcf5;
}

html[data-theme="dark"] .dev-joke code {
    color: #aeb8ff;
}

html[data-theme="dark"] .demo-disclaimer {
    border-color: #7b5a18;
    background: #2b2415;
    color: #f2d58c;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .2);
}

html[data-theme="dark"] .demo-disclaimer a {
    color: #ffc96c;
}

html[data-theme="dark"] .connection-panel {
    border-color: rgba(100, 127, 164, .38);
    background: rgba(17, 28, 47, .92);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

html[data-theme="dark"] .upload-database-icon,
html[data-theme="dark"] .connection-icon {
    background: #21304a;
}

html[data-theme="dark"] .upload-database:hover {
    background: #1c3761;
}

html[data-theme="dark"] #connection-form label,
html[data-theme="dark"] .connection-section h2 {
    color: #c7d4e8;
}

html[data-theme="dark"] .connection-card {
    border-color: var(--dx-border);
    background: var(--dx-surface-soft);
    color: var(--dx-text);
}

html[data-theme="dark"] .connection-card:hover {
    border-color: #58739a;
    background: #1a2b45;
}

html[data-theme="dark"] .connection-description {
    color: #a9b8ce;
}

html[data-theme="dark"] .connection-credentials {
    background: #1c3761;
    color: #c3d6ff;
}

html[data-theme="dark"] .connection-compat > span,
html[data-theme="dark"] .connection-compat-pending {
    border-color: #405370;
    background: #18263d;
    color: #bdcbe0;
}

html[data-theme="dark"] .connection-compat-ready > span {
    border-color: #2f6948;
    background: #142d22;
    color: #87e2a9;
}

html[data-theme="dark"] .connection-compat-warning > span {
    border-color: #745b28;
    background: #2c2516;
    color: #f0cd7f;
}

.server-meta {
    margin-top: 24px;
    color: var(--dx-muted);
    font-size: 12px;
    line-height: 1.65;
    text-align: center;
}

.server-meta a {
    color: #53647d;
}

.terms-page {
    min-height: 100vh;
    padding: clamp(18px, 5vw, 56px);
}

.terms-shell {
    width: min(100%, 900px);
    margin: 0 auto;
}

.terms-back {
    display: inline-flex;
    margin: 0 0 16px;
    color: var(--dx-primary);
    font-weight: 700;
    text-decoration: none;
}

.terms-card {
    padding: clamp(24px, 5vw, 54px);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 26px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
}

.terms-card h1 {
    max-width: 700px;
    margin: 5px 0 8px;
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.08;
    letter-spacing: -.035em;
}

.terms-card h2 {
    margin: 0 0 8px;
    color: #17233b;
    font-size: 19px;
}

.terms-card section {
    margin-top: 28px;
}

.terms-card p {
    margin: 0 0 10px;
    color: #43516a;
    line-height: 1.7;
}

.terms-card ul {
    margin: 10px 0 12px;
    padding-left: 24px;
    color: #43516a;
}

.terms-card li {
    margin: 8px 0;
    line-height: 1.6;
}

.terms-kicker {
    color: var(--dx-primary) !important;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.terms-updated {
    color: var(--dx-muted) !important;
    font-size: 13px;
}

.terms-warning {
    padding: 18px 20px;
    border: 1px solid #f1c56a;
    border-radius: 16px;
    background: #fff8df;
}

.terms-note {
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid var(--dx-border);
    font-size: 13px;
}

@media (max-width: 640px) {
    .landing-page {
        align-items: start;
        padding: 24px 14px;
    }

    .landing-hero {
        grid-template-columns: 74px minmax(0, 1fr);
        gap: 17px;
        margin: 0 8px 22px;
    }

    .landing-page .logo {
        width: 74px;
        height: 74px;
        border-radius: 21px;
    }

    .landing-page .logo img {
        width: 68px !important;
        height: 68px;
    }

    .hero-copy h1 {
        margin-top: 6px;
        font-size: clamp(25px, 8vw, 34px);
    }

    .hero-copy p {
        font-size: 14px;
    }

    .connection-panel {
        padding: 20px;
        border-radius: 19px;
    }

    .demo-disclaimer {
        grid-template-columns: 34px minmax(0, 1fr);
        padding: 14px;
    }

    .demo-disclaimer-icon {
        width: 34px;
        height: 34px;
        border-radius: 9px;
        font-size: 19px;
    }

    .terms-page {
        padding: 14px;
    }

    .terms-card {
        padding: 24px 20px;
        border-radius: 19px;
    }

    .connection-control,
    .connection-grid {
        grid-template-columns: 1fr;
    }

    .connection-control button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .connection-card {
        transition: none;
    }
}
