:root {
    --ps-border: #dedede;
    --ps-soft: #f7f7f7;
    --ps-muted: #6c757d;
    --ps-dark: #101010;
}

* {
    letter-spacing: 0;
}

body {
    background: #fff;
    color: var(--ps-dark);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.navbar {
    min-height: 68px;
}

.brand-logo-link {
    display: inline-flex;
    align-items: center;
    width: 190px;
    height: 48px;
    overflow: hidden;
    padding: 0;
}

.brand-logo {
    width: 190px;
    height: 190px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.hero-logo-wrap {
    display: flex;
    align-items: center;
    width: min(100%, 520px);
    height: 150px;
    overflow: hidden;
}

.hero-logo {
    width: 100%;
    height: 520px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.tracking-tight {
    letter-spacing: 0;
}

.hero-section {
    padding: 72px 0 56px;
    background: linear-gradient(180deg, #fff 0%, #f8f8f8 100%);
    border-bottom: 1px solid var(--ps-border);
}

.content-section,
.auth-section {
    padding: 48px 0 64px;
}

.auth-section {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
}

.auth-card,
.marketplace-panel,
.panel-card,
.stat-card {
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.05);
}

.auth-card {
    max-width: 480px;
    margin: 0 auto;
    padding: 32px;
}

.marketplace-panel {
    padding: 24px;
}

.panel-card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.card {
    border-radius: 8px;
    border-color: var(--ps-border);
}

.btn,
.form-control,
.form-select {
    border-radius: 6px;
}

.btn-dark {
    background: #111;
    border-color: #111;
}

.btn-outline-dark:hover {
    background: #111;
    border-color: #111;
}

.eyebrow {
    color: var(--ps-muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.mini-list {
    display: grid;
    gap: 10px;
}

.mini-list-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--ps-border);
}

.mini-list-item:last-child {
    border-bottom: 0;
}

.item-card {
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.item-image,
.detail-image {
    width: 100%;
    object-fit: cover;
    background: var(--ps-soft);
}

.item-image {
    height: 220px;
}

.detail-image {
    min-height: 420px;
    max-height: 620px;
    border-radius: 8px;
    border: 1px solid var(--ps-border);
}

.placeholder-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ps-muted);
    font-weight: 600;
}

.price {
    white-space: nowrap;
    font-weight: 700;
}

.narrow-container {
    max-width: 820px;
}

.dashboard-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--ps-border);
}

.empty-state {
    padding: 44px;
    text-align: center;
    background: var(--ps-soft);
    border: 1px dashed #cfcfcf;
    border-radius: 8px;
    color: var(--ps-muted);
}

.small-empty {
    padding: 24px;
}

.stack-list {
    display: grid;
    gap: 14px;
}

.stack-list-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: start;
    padding: 16px 0;
    border-bottom: 1px solid var(--ps-border);
}

.stack-list-item:last-child {
    border-bottom: 0;
}

.request-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

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

.detail-meta > div {
    padding: 16px;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    background: #fff;
}

.detail-meta span {
    display: block;
    color: var(--ps-muted);
    font-size: .86rem;
    margin-bottom: 4px;
}

.detail-meta strong {
    display: block;
}

.owner-verification-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.owner-verification-badge.is-verified {
    color: #0f5132;
    background: #d1e7dd;
    border-color: #badbcc;
}

.owner-verification-badge.is-unverified {
    color: #664d03;
    background: #fff3cd;
    border-color: #ffecb5;
}

.verification-code {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 6px;
    background: #111;
    color: #fff;
    font-weight: 800;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.verification-code.compact {
    min-height: 0;
    padding: 6px 10px;
}

.verification-image {
    display: block;
    width: 100%;
    max-height: 760px;
    object-fit: contain;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    background: var(--ps-soft);
}

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

.meta-list {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px 16px;
    margin: 0;
}

.meta-list dt {
    color: var(--ps-muted);
    font-weight: 600;
}

.meta-list dd {
    margin: 0;
}

.stat-card {
    padding: 26px;
}

.stat-card span {
    display: block;
    color: var(--ps-muted);
    margin-bottom: 8px;
}

.stat-card strong {
    display: block;
    font-size: 2.4rem;
    line-height: 1;
}

.site-footer {
    padding: 28px 0;
    color: var(--ps-muted);
    background: #fff;
}

.legal-notice {
    padding: 0 0 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--ps-border);
    font-size: .9rem;
    line-height: 1.6;
}

.legal-notice strong {
    color: var(--ps-dark);
}

.legal-card p {
    color: var(--ps-muted);
    line-height: 1.75;
}

.legal-container {
    max-width: 1120px;
}

.legal-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.legal-toc {
    position: sticky;
    top: 92px;
}

.legal-toc-inner {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    background: #fff;
}

.legal-toc-inner strong {
    margin-bottom: 6px;
}

.legal-toc-inner a {
    color: var(--ps-muted);
    text-decoration: none;
    font-size: .92rem;
}

.legal-toc-inner a:hover {
    color: var(--ps-dark);
}

.legal-content {
    scroll-margin-top: 90px;
}

.legal-section {
    padding-bottom: 26px;
    margin-bottom: 26px;
    border-bottom: 1px solid var(--ps-border);
    scroll-margin-top: 96px;
}

.legal-section:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.legal-section h2 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.legal-section p {
    color: var(--ps-muted);
    line-height: 1.75;
}

.footer-bottom {
    font-size: .92rem;
}

.chat-shell .card-body {
    padding: 0;
}

.chat-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--ps-border);
    color: var(--ps-muted);
}

.chat-messages {
    height: min(58vh, 560px);
    min-height: 360px;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

.chat-message {
    display: flex;
    margin-bottom: 14px;
}

.chat-message.is-mine {
    justify-content: flex-end;
}

.chat-message.is-theirs {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: min(76%, 560px);
    padding: 12px 14px;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    background: #fff;
}

.chat-message.is-mine .chat-bubble {
    background: #111;
    color: #fff;
    border-color: #111;
}

.chat-message-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 6px;
    font-size: .78rem;
}

.chat-message-meta span {
    color: var(--ps-muted);
    white-space: nowrap;
}

.chat-message.is-mine .chat-message-meta span {
    color: rgba(255, 255, 255, .72);
}

.chat-message-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chat-form {
    padding: 18px 20px 20px;
    border-top: 1px solid var(--ps-border);
    background: #fff;
}

.chat-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: stretch;
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 48px 0;
    }

    .brand-logo-link {
        width: 160px;
        height: 44px;
    }

    .brand-logo {
        width: 160px;
        height: 160px;
    }

    .hero-logo-wrap {
        height: 118px;
    }

    .hero-logo {
        height: 390px;
    }

    .auth-card {
        padding: 24px;
    }

    .dashboard-head,
    .stack-list-item {
        display: block;
    }

    .request-actions {
        justify-content: flex-start;
        margin-top: 12px;
    }

    .detail-meta {
        grid-template-columns: 1fr;
    }

    .detail-image {
        min-height: 300px;
    }

    .meta-list {
        grid-template-columns: 1fr;
    }

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

    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-toc {
        position: static;
    }

    .chat-bubble {
        max-width: 92%;
    }

    .chat-input-row {
        grid-template-columns: 1fr;
    }
}
