:root {
    --bg: #0b1220;
    --panel: #111a2b;
    --text: #edf2ff;
    --muted: #96a3bf;
    --line: rgba(255, 255, 255, 0.08);
    --primary: #4f8cff;
    --primary-strong: #2d6df6;
    --success: #28c38a;
    --warning: #f4b740;
    --danger: #ff6b6b;
}

* {
    box-sizing: border-box;
}

html {
    font-family: Inter, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(79, 140, 255, 0.25), transparent 24rem),
        var(--bg);
}

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

p,
li,
small,
label,
input,
select,
textarea,
button {
    line-height: 1.55;
}

.shell {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(20px);
    background: rgba(11, 18, 32, 0.82);
    border-bottom: 1px solid var(--line);
}

.site-main {
    padding: 2rem 0 3rem;
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.site-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.site-nav a {
    color: var(--muted);
}

.site-nav a:hover,
.site-nav summary:hover,
.brand:hover {
    color: var(--text);
}

.hero,
.page-header {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    align-items: end;
    margin-bottom: 2rem;
}

.hero h1,
.page-header h1 {
    margin: 0.25rem 0 0.5rem;
    font-size: clamp(2rem, 4vw, 3.5rem);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    color: var(--primary);
    margin: 0;
}

.hero-copy {
    max-width: 50rem;
    color: var(--muted);
}

.hero-actions,
.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
}

.button-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    border-color: transparent;
}

.button-danger {
    background: rgba(255, 107, 107, 0.16);
    border-color: rgba(255, 107, 107, 0.35);
    color: #ffe3e3;
}

.action-menu {
    position: relative;
    display: inline-flex;
}

.action-menu summary {
    cursor: pointer;
    list-style: none;
}

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

.nav-menu summary {
    color: var(--muted);
}

.action-menu[open] summary {
    color: var(--text);
}

.action-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 30;
    display: grid;
    min-width: 210px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    background: rgba(11, 18, 32, 0.98);
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.28);
}

.action-menu-list a,
.action-menu-list button {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    padding: 0.75rem 0.9rem;
    text-align: left;
}

.action-menu-list a:hover,
.action-menu-list button:hover {
    background: rgba(79, 140, 255, 0.11);
}

.action-menu-list form {
    margin: 0;
}

.action-menu-list .menu-danger,
.menu-danger {
    color: #ffe3e3;
}

.nested-action-menu {
    border: 1px solid var(--line);
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.02);
}

.nested-action-menu summary {
    cursor: pointer;
    padding: 0.75rem;
    color: var(--muted);
    font-weight: 700;
}

.nested-action-menu[open] summary {
    color: var(--text);
}

.nested-action-menu .credential-list {
    padding: 0 0.55rem 0.55rem;
}

code,
.code-block {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
    padding: 0.2rem 0.45rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
}

.code-block {
    white-space: pre-wrap;
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    overflow-x: auto;
}

.stats-grid,
.grid-2,
.asset-grid,
.quick-grid,
.workflow-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.asset-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.quick-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.workflow-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.panel,
.stat-card,
.mini-card,
.flash {
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
}

.panel,
.mini-card,
.flash {
    padding: 1.15rem;
}

.stat-card {
    padding: 1rem 1.15rem;
}

.stat-label {
    color: var(--muted);
    display: block;
    margin-bottom: 0.35rem;
}

.stat-card strong {
    font-size: 2rem;
}

.stack {
    display: grid;
    gap: 0.85rem;
}

.integration-glance,
.channel-status-card {
    display: grid;
    gap: 0.9rem;
}

.dashboard-panel {
    margin-bottom: 1.5rem;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-copy {
    max-width: 32rem;
    color: var(--muted);
    margin: 0;
}

.mini-card h3,
.panel h2 {
    margin-top: 0;
}

.mini-card p,
.panel p,
small {
    color: var(--muted);
    margin-bottom: 0;
}

.action-card {
    display: grid;
    align-content: start;
    gap: 0.9rem;
}

.action-card .badge {
    justify-self: start;
}

.action-card .code-block {
    margin: 0;
}

.workflow-card {
    display: grid;
    gap: 0.75rem;
}

.workflow-step {
    display: inline-flex;
    width: 2.4rem;
    height: 2.4rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(79, 140, 255, 0.18);
    color: #dce7ff;
    font-size: 0.92rem;
    font-weight: 700;
}

.demo-hero {
    align-items: center;
}

.demo-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1.35fr);
    gap: 1.25rem;
    align-items: center;
    margin-bottom: 1.5rem;
    background:
        linear-gradient(135deg, rgba(79, 140, 255, 0.16), rgba(40, 195, 138, 0.08)),
        rgba(255, 255, 255, 0.02);
}

.demo-strip h2 {
    margin: 0.55rem 0 0.35rem;
}

.demo-flow-line {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.demo-flow-line span {
    display: flex;
    min-height: 4.5rem;
    align-items: center;
    justify-content: center;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(11, 18, 32, 0.45);
    color: #dce7ff;
    font-weight: 700;
    text-align: center;
}

.demo-product-card {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.simple-list,
.bullets {
    padding-left: 1rem;
    margin: 0;
}

.simple-list {
    list-style: none;
    padding-left: 0;
    display: grid;
    gap: 0.75rem;
}

.simple-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.simple-list li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.compact-list {
    gap: 0;
}

.compact-list li {
    padding: 0.65rem 0;
}

.badge {
    align-self: start;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.82rem;
    background: rgba(79, 140, 255, 0.18);
    color: #dce7ff;
}

.badge-success {
    background: rgba(40, 195, 138, 0.16);
    color: #d3ffef;
}

.badge-warning {
    background: rgba(244, 183, 64, 0.16);
    color: #ffeab2;
}

.link-card {
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.link-card:hover {
    transform: translateY(-2px);
    border-color: rgba(79, 140, 255, 0.5);
}

.active-card {
    border-color: rgba(79, 140, 255, 0.75);
    background: rgba(79, 140, 255, 0.08);
}

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

.flash {
    margin-bottom: 1rem;
}

.flash-success {
    border-color: rgba(40, 195, 138, 0.45);
}

.flash-warning {
    border-color: rgba(244, 183, 64, 0.45);
}

.flash-error {
    border-color: rgba(255, 107, 107, 0.45);
}

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

.form-group {
    display: grid;
    gap: 0.35rem;
}

.form-group-full {
    grid-column: 1 / -1;
}

label {
    font-weight: 600;
}

.required-marker {
    color: var(--warning);
}

.field-meta,
.muted-copy {
    color: var(--muted);
    font-size: 0.9rem;
}

.field-meta code {
    color: #dce7ff;
}

.checkbox-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
}

.checkbox-row input {
    width: auto;
}

.checkbox-row small {
    display: block;
    color: var(--muted);
    font-weight: 500;
    margin-top: 0.15rem;
}

.credential-page {
    display: grid;
    gap: 1.25rem;
}

.credential-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 1rem;
    align-items: end;
    padding: 1.35rem;
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    background:
        linear-gradient(135deg, rgba(79, 140, 255, 0.16), rgba(40, 195, 138, 0.06)),
        rgba(255, 255, 255, 0.02);
}

.credential-hero h1,
.credential-hero p {
    margin-bottom: 0;
}

.credential-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.credential-metrics article {
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(11, 18, 32, 0.44);
}

.credential-metrics strong {
    display: block;
    font-size: 1.7rem;
}

.credential-metrics span,
.credential-progress-card small {
    color: var(--muted);
    font-size: 0.85rem;
}

.credential-layout {
    display: grid;
    grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.credential-sidebar {
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 6rem);
    overflow: auto;
}

.credential-sidebar-head,
.credential-label-row,
.credential-editor-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.credential-sidebar-head {
    align-items: center;
    margin-bottom: 1rem;
}

.credential-sidebar-head h2,
.credential-editor-head h2 {
    margin: 0;
}

.credential-search {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.credential-search span {
    color: var(--muted);
    font-size: 0.85rem;
}

.credential-list {
    display: grid;
    gap: 0.55rem;
}

.credential-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid transparent;
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.025);
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.credential-card:hover {
    transform: translateX(2px);
    border-color: rgba(79, 140, 255, 0.45);
    background: rgba(79, 140, 255, 0.07);
}

.credential-card-copy {
    min-width: 0;
}

.credential-card-copy strong,
.credential-card-copy small {
    display: block;
}

.credential-card-copy small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.credential-avatar {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
    background: rgba(79, 140, 255, 0.16);
    color: #dce7ff;
    font-weight: 800;
}

.status-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
}

.status-dot-ready {
    background: var(--success);
    box-shadow: 0 0 0 0.3rem rgba(40, 195, 138, 0.12);
}

.status-dot-open {
    background: var(--warning);
    box-shadow: 0 0 0 0.3rem rgba(244, 183, 64, 0.12);
}

.credential-editor {
    display: grid;
    gap: 1rem;
}

.credential-editor-head {
    align-items: start;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.credential-editor-head p {
    margin-bottom: 0;
}

.credential-progress-card {
    min-width: 150px;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
}

.credential-progress-card span {
    display: block;
    font-weight: 800;
}

.credential-progress {
    height: 0.45rem;
    margin-top: 0.65rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.credential-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--success));
}

.credential-detail-note {
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.025);
}

.credential-detail-note summary {
    cursor: pointer;
    font-weight: 700;
}

.credential-detail-note p {
    margin: 0.5rem 0 0;
}

.credential-alert {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(244, 183, 64, 0.3);
    border-radius: 0.95rem;
    background: rgba(244, 183, 64, 0.08);
}

.credential-alert span {
    color: var(--muted);
}

.credential-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.credential-field {
    display: grid;
    gap: 0.5rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.022);
}

.credential-field:focus-within {
    border-color: rgba(79, 140, 255, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(79, 140, 255, 0.08);
}

.credential-field-toggle {
    grid-column: 1 / -1;
}

.credential-label-row {
    align-items: center;
}

.icon-button {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    padding: 0.25rem 0.55rem;
}

.icon-button:hover {
    border-color: rgba(79, 140, 255, 0.55);
    color: var(--text);
}

.secret-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
}

.toggle-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    cursor: pointer;
}

.toggle-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-switch {
    position: relative;
    flex: 0 0 auto;
    width: 3rem;
    height: 1.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.16s ease;
}

.toggle-switch::after {
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 999px;
    background: var(--text);
    content: "";
    transition: transform 0.16s ease;
}

.toggle-row input:checked + .toggle-switch {
    background: rgba(40, 195, 138, 0.5);
}

.toggle-row input:checked + .toggle-switch::after {
    transform: translateX(1.4rem);
}

.toggle-row small {
    display: block;
    color: var(--muted);
    font-weight: 500;
}

.credential-save-bar {
    position: sticky;
    bottom: 1rem;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(11, 18, 32, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.22);
}

.credential-save-bar > span {
    color: var(--muted);
}

.credential-page.is-dirty .credential-save-bar > span {
    color: #ffeab2;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    padding: 0.8rem 0.9rem;
    font: inherit;
}

textarea {
    resize: vertical;
}

.inline-form {
    display: inline-flex;
}

.asset-preview {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 0.8rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
}

.login-shell {
    max-width: 520px;
    margin: 5rem auto 0;
}

@media (max-width: 720px) {
    .hero,
    .page-header,
    .row-between,
    .section-head {
        flex-direction: column;
        align-items: start;
    }

    .site-nav {
        flex-wrap: wrap;
    }

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

    .demo-strip,
    .demo-flow-line {
        grid-template-columns: 1fr;
    }
}
