:root {
    --bg: #0f172a;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --line: #dbe1ea;
    --brand: #8b5cf6;
    --brand-dark: #6d28d9;
    --success: #0f9d58;
    --error: #dc2626;
    --radius: 18px;
    --shadow: 0 24px 55px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
}

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

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.brand-mark {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), #ec4899);
}

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

.site-nav a,
.link-button,
.nav-toggle {
    color: #fff;
    background: transparent;
    border: 0;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

.nav-toggle {
    display: none;
    font-size: 1.5rem;
}

.inline-form {
    margin: 0;
}

.main-content {
    flex: 1;
    padding: 2rem 0 4rem;
}

.card {
    background: var(--panel);
    border: 1px solid rgba(219, 225, 234, 0.8);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.hero {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.hero h1,
.auth-card h1 {
    font-size: clamp(2rem, 3vw, 3.5rem);
    line-height: 1.05;
    margin: 0.5rem 0 1rem;
}

.hero-panel {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.12), rgba(15, 23, 42, 0.04));
    border-radius: calc(var(--radius) - 4px);
    padding: 1.5rem;
}

.eyebrow {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.12);
    color: var(--brand-dark);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

.hero-actions,
.dashboard-grid .button {
    margin-top: 1.5rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.2rem;
    border-radius: 999px;
    border: 0;
    background: linear-gradient(135deg, var(--brand), #ec4899);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.button-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--line);
}

.narrow {
    width: min(720px, 100%);
    margin: 0 auto;
}

.form-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

label span,
.definition-list dt {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 600;
}

input,
textarea {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    font: inherit;
    background: #fff;
}

textarea {
    resize: vertical;
}

.error-text {
    display: block;
    margin-top: 0.35rem;
    color: var(--error);
}

.flash-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    font-weight: 600;
}

.flash-success {
    background: rgba(15, 157, 88, 0.12);
    color: var(--success);
}

.flash-error {
    background: rgba(220, 38, 38, 0.12);
    color: var(--error);
}

.flash button {
    background: transparent;
    border: 0;
    color: currentColor;
    font-size: 1.1rem;
    cursor: pointer;
}

.definition-list {
    display: grid;
    gap: 1rem;
}

.definition-list dd {
    margin: 0;
    color: var(--muted);
}

.site-footer {
    background: #0f172a;
    color: rgba(255, 255, 255, 0.84);
    padding: 2rem 0;
}

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

@media (max-width: 860px) {
    .hero,
    .grid-two,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        right: 1rem;
        left: 1rem;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        background: rgba(15, 23, 42, 0.98);
        border-radius: 1rem;
        box-shadow: var(--shadow);
    }

    .site-nav.is-open {
        display: flex;
    }
}


select {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    font: inherit;
    background: #fff;
}

a {
    color: var(--brand-dark);
}

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

.compact-heading {
    margin-top: 2rem;
}

.lead-text {
    color: var(--muted);
    line-height: 1.7;
}

.card-grid {
    display: grid;
    gap: 1.5rem;
}

.card-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.entity-card,
.artwork-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.entity-card h2,
.artwork-card h2,
.artwork-card h3,
.detail-hero h1,
.artwork-detail h1 {
    margin: 0;
}

.meta-line {
    color: var(--muted);
    margin: 0;
}

.empty-state {
    text-align: center;
}

.inline-state {
    display: grid;
    gap: 1rem;
    justify-items: center;
}

.detail-hero,
.artwork-detail {
    display: grid;
    gap: 1.5rem;
}

.artwork-detail {
    grid-template-columns: minmax(240px, 420px) 1fr;
    align-items: start;
}

.artwork-thumb-wrap,
.artwork-detail-media {
    overflow: hidden;
    border-radius: 16px;
    background: #e2e8f0;
}

.artwork-thumb,
.artwork-detail-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.artwork-thumb {
    aspect-ratio: 4 / 3;
}

@media (max-width: 960px) {
    .card-grid-3,
    .artwork-detail {
        grid-template-columns: 1fr;
    }
}


select,
button,
input,
textarea {
    font: inherit;
}

select {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
}

code {
    padding: 0.15rem 0.4rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.08);
}

.helper-text {
    color: var(--muted);
}

.form-grid-tight {
    gap: 1rem;
}

.market-highlight {
    margin-bottom: 1.5rem;
}

.market-inline-heading {
    margin-bottom: 1rem;
}

.market-card,
.snapshot-card,
.option-builder-item {
    border-radius: calc(var(--radius) - 2px);
}

.compact-card {
    padding: 1.5rem;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.status-badge,
.meta-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.meta-pill {
    background: rgba(15, 23, 42, 0.08);
    color: var(--muted);
}

.status-draft {
    background: rgba(148, 163, 184, 0.18);
    color: #334155;
}

.status-open {
    background: rgba(15, 157, 88, 0.14);
    color: var(--success);
}

.status-closed {
    background: rgba(234, 179, 8, 0.18);
    color: #a16207;
}

.status-resolved {
    background: rgba(139, 92, 246, 0.14);
    color: var(--brand-dark);
}

.status-cancelled {
    background: rgba(220, 38, 38, 0.14);
    color: var(--error);
}

.meta-stack {
    display: grid;
    gap: 0.45rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.market-detail-hero {
    margin-bottom: 1.5rem;
}

.market-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-list-card {
    margin-bottom: 1.5rem;
}

.option-list,
.snapshot-list,
.admin-action-stack,
.market-options-builder,
.option-builder-list {
    display: grid;
    gap: 1rem;
}

.market-option-row {
    display: grid;
    gap: 0.75rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid rgba(219, 225, 234, 0.9);
}

.market-option-row:first-child {
    padding-top: 0;
}

.market-option-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.option-metrics {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
}

.option-metrics strong {
    font-size: 1.25rem;
    color: var(--text);
}

.probability-bar {
    width: 100%;
    height: 0.75rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.12);
    overflow: hidden;
}

.probability-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--brand), #ec4899);
}

.snapshot-card {
    padding: 1rem 1.2rem;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(219, 225, 234, 0.9);
}

.snapshot-card header {
    margin-bottom: 0.75rem;
}

.snapshot-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.6rem;
}

.snapshot-card li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.market-detail-grid {
    align-items: start;
}

.market-create-card {
    margin-bottom: 2rem;
}

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

.danger-link {
    color: var(--error);
}

.is-hidden {
    display: none;
}

@media (max-width: 900px) {
    .market-meta-grid,
    .market-detail-grid,
    .grid-two,
    .hero {
        grid-template-columns: 1fr;
    }
}
