body {
    font-family: "Segoe UI", Tahoma, sans-serif;
    margin: 0;
    background: #f3f4ef;
    color: #111;
}

.page {
    margin: 2rem auto;
    max-width: 72rem;
    padding: 0 1rem;
}

.page-wide {
    max-width: 96rem;
}

.page.narrow {
    max-width: 28rem;
}

.auth-stack {
    display: grid;
    gap: 1rem;
}

.compact-panel {
    padding: 1rem;
}

.auth-panel {
    margin-bottom: 1rem;
}

.auth-panel-wide {
    margin-bottom: 1.5rem;
}

.passkey-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.passkey-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid rgba(11, 107, 85, 0.12);
    border-radius: 1rem;
    background: #f8fbf9;
    padding: 0.9rem 1rem;
}

.notice,
.error {
    border-radius: 0.9rem;
    padding: 0.8rem 0.9rem;
}

.notice {
    background: #e2f0eb;
    color: #0b6b55;
}

.error {
    background: #fde8e6;
    color: #8a2d1f;
}

.error-text {
    color: #8a2d1f;
}

.page-header,
.topbar,
.panel-header,
.hero-header,
.sidebar-header,
.compact-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.page-subtitle,
.lede,
.subtle,
.eyebrow {
    margin: 0.25rem 0 0;
    color: #5a625a;
}

.eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0b6b55;
}

.page-actions,
.topbar-actions,
.toolbar,
.pager {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.action-link,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid #0b6b55;
    background: #0b6b55;
    color: #f6fbf9;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.ghost-button {
    background: #fff;
    color: #0b6b55;
}

.ghost-button-small {
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
}

.ghost-button:hover,
.action-link:hover {
    text-decoration: none;
    filter: brightness(0.98);
}

.app-shell {
    background:
        radial-gradient(circle at top right, rgba(11, 107, 85, 0.08), transparent 30%),
        linear-gradient(180deg, #f6f6f1 0%, #edf0e6 100%);
}

.db-page {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

.db-layout {
    display: grid;
    grid-template-columns: minmax(18rem, 22rem) minmax(0, 1fr);
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.db-main,
.db-detail-stack {
    display: grid;
    gap: 1rem;
}

.panel {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 1.25rem;
    box-shadow: 0 18px 40px rgba(38, 47, 39, 0.08);
    padding: 1.25rem;
}

.sidebar-panel {
    padding: 1rem;
}

.hero-panel {
    padding-bottom: 1rem;
}

.overview-grid,
.chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.split-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 1rem;
}

.metric-card,
.chip-card {
    display: grid;
    gap: 0.3rem;
    border: 1px solid rgba(11, 107, 85, 0.12);
    border-radius: 1rem;
    background: #f8fbf9;
    padding: 0.9rem 1rem;
}

.metric-label {
    color: #5a625a;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.65rem;
}

.search-field,
.inline-field {
    display: grid;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: #425044;
}

.search-field input,
.inline-field select {
    width: 100%;
    margin: 0;
    border: 1px solid #ced6ca;
    border-radius: 0.85rem;
    background: #fff;
}

.table-list {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
    max-height: 70vh;
    overflow: auto;
    padding-right: 0.25rem;
}

.table-pill {
    width: 100%;
    display: grid;
    gap: 0.18rem;
    text-align: left;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 1rem;
    background: #f4f6f2;
    padding: 0.85rem 0.95rem;
}

.table-pill.active {
    background: #0b6b55;
    color: #f8fffd;
}

.table-pill-name {
    font-weight: 700;
}

.table-pill-meta,
.table-pill-subtle,
.meta-row span,
.chip-card span,
.null-token,
.list-empty {
    color: #5a625a;
    font-size: 0.88rem;
}

.table-pill.active .table-pill-meta,
.table-pill.active .table-pill-subtle {
    color: rgba(248, 255, 253, 0.8);
}

.chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    background: #e2f0eb;
    color: #0b6b55;
    font-weight: 600;
    margin: 0 0.4rem 0.4rem 0;
}

.meta-list {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.meta-row {
    display: grid;
    gap: 0.2rem;
    padding: 0.8rem 0.9rem;
    border-radius: 0.9rem;
    background: #f4f6f2;
}

.grid-wrap {
    overflow: auto;
    border: 1px solid #dbe3d6;
    border-radius: 1rem;
    margin-top: 1rem;
}

.data-grid {
    margin: 0;
    background: transparent;
}

.data-grid th {
    position: sticky;
    top: 0;
    background: #eef3ec;
    z-index: 1;
}

.data-grid td,
.data-grid th {
    min-width: 10rem;
    vertical-align: top;
}

.data-grid code {
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.8rem;
}

.grid-empty {
    text-align: center;
    color: #5a625a;
    padding: 2rem 1rem;
}

.schema-block {
    margin: 0.8rem 0 0;
    padding: 1rem;
    border-radius: 1rem;
    background: #17211b;
    color: #dbece5;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.notice {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
}

.notice-error {
    background: #fff0ef;
    color: #8a1f20;
    border: 1px solid #f0c6c2;
}

.empty-panel {
    text-align: center;
}

.hidden {
    display: none;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 1rem;
    background: #fff;
}

th,
td {
    border: 1px solid #d7d7d7;
    padding: 0.5rem;
    text-align: left;
}

input,
button {
    display: block;
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.7rem;
    box-sizing: border-box;
}

.error {
    color: #a61b1b;
}

a {
    color: #0068b5;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

@media (max-width: 960px) {
    .db-layout {
        grid-template-columns: 1fr;
    }

    .page-header,
    .topbar,
    .panel-header,
    .hero-header,
    .sidebar-header,
    .compact-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions,
    .topbar-actions,
    .toolbar,
    .pager {
        flex-wrap: wrap;
    }
}
