:root {
    color-scheme: light dark;
    --bg: #0f1419;
    --surface: #1a2332;
    --text: #e7ecf3;
    --muted: #9aa8bc;
    --accent: #5b9fff;
    --border: #2a3648;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem;
}

.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.site-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.tagline {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.hero, .catalog-preview {
    margin-top: 2rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.links {
    padding-left: 1.25rem;
}

.links a {
    color: var(--accent);
}

.empty {
    color: var(--muted);
}

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

.site-header h1 a {
    color: inherit;
    text-decoration: none;
}

.provider-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
}

.provider-nav a {
    color: var(--accent);
}

.inline-form {
    display: inline;
    margin: 0;
}

.inline-form button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-decoration: underline;
}

.provider-main h2 {
    margin-top: 0;
}

.provider-form label {
    display: block;
    margin-bottom: 1rem;
}

.provider-form input,
.provider-form textarea,
.provider-form select {
    display: block;
    width: 100%;
    max-width: 480px;
    margin-top: 0.25rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
}

.provider-form button,
.button,
.button-primary {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
}

.button-primary {
    font-weight: 600;
}

fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    padding: 1rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #3d1f1f;
    border: 1px solid #8b3a3a;
}

.alert-success {
    background: #1f3d2a;
    border: 1px solid #3a8b5a;
}

.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.status-card {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.status-card.ok {
    border-color: #3a8b5a;
}

.status-card.pending {
    border-color: #8b7a3a;
}

.status-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

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

.mono {
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
}

.hint {
    color: var(--muted);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.checkbox-label input {
    width: auto;
    margin-top: 0.25rem;
}

.agreement-text {
    max-width: 640px;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.upload-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.publish-form {
    margin-top: 1.5rem;
}

/* Public catalog */

.site-brand h1 {
    margin: 0;
    font-size: 1.5rem;
}

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

.site-nav a {
    color: var(--accent);
    text-decoration: none;
}

.site-nav a[aria-current="page"] {
    color: var(--text);
    font-weight: 600;
}

.button-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
}

.button-block {
    display: block;
    width: 100%;
    text-align: center;
}

.catalog-main {
    padding-bottom: 3rem;
}

.catalog-hero {
    margin: 1.5rem 0;
}

.catalog-hero h2 {
    margin: 0 0 0.25rem;
}

.catalog-filters {
    margin: 1.5rem 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .filter-row {
        grid-template-columns: 2fr 1fr 1fr auto;
        align-items: end;
    }
}

.filter-field {
    display: block;
}

.filter-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.filter-field input,
.filter-field select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.catalog-meta {
    margin: 0 0 1rem;
}

.panel {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.empty-state {
    text-align: center;
    padding: 2rem 1.25rem;
}

.offer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (min-width: 540px) {
    .offer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .offer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.offer-grid-compact {
    margin-bottom: 1rem;
}

.offer-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    transition: border-color 0.15s ease;
}

.offer-card:hover {
    border-color: var(--accent);
}

.offer-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem;
    color: inherit;
    text-decoration: none;
}

.offer-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.offer-type,
.category-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.trust-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.trust-verified {
    background: #1f3d2a;
    color: #8fd4a8;
}

.trust-trusted {
    background: #1f2f3d;
    color: #8fc4ff;
}

.trust-community {
    background: #2a2a2a;
    color: var(--muted);
}

.offer-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.offer-summary {
    margin: 0 0 0.75rem;
    color: var(--muted);
    font-size: 0.95rem;
    flex: 1;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
}

.tag-list li {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: var(--bg);
    font-size: 0.8rem;
    color: var(--muted);
}

.offer-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.offer-price {
    font-weight: 600;
}

.offer-version {
    color: var(--muted);
}

.breadcrumb {
    margin: 1rem 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.breadcrumb a {
    color: var(--accent);
}

.offer-detail-header {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .offer-detail-header {
        grid-template-columns: 1fr 280px;
        align-items: start;
    }
}

.offer-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.offer-detail-intro h2 {
    margin: 0 0 0.5rem;
}

.offer-lead {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 1.05rem;
}

.offer-purchase {
    text-align: center;
}

.offer-price-large {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
}

.checkout-note {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
}

.offer-section {
    margin-bottom: 1.5rem;
}

.offer-section h3 {
    margin-top: 0;
}

.offer-description {
    white-space: pre-wrap;
}

.detail-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.5rem;
}

.detail-list dt {
    margin: 0;
    color: var(--muted);
    font-weight: 500;
}

.detail-list dd {
    margin: 0;
}

.release-table td:last-child {
    max-width: 280px;
}

.site-footer {
    margin-top: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.checkout-placeholder h2 {
    margin-top: 0;
}

.checkout-summary {
    max-width: 360px;
    margin: 1.5rem 0;
}

/* Ratings */

.rating-stars {
    color: #e8b84a;
    letter-spacing: 0.05em;
}

.offer-rating-summary {
    margin: 0 0 1rem;
}

.offer-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.verified-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    background: #1f3d2a;
    color: #8fd4a8;
    font-size: 0.75rem;
    font-weight: 600;
}

.review-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.review-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.review-body {
    margin: 0;
}

.provider-reply {
    margin: 0.75rem 0 0;
    padding: 0.75rem;
    border-left: 3px solid var(--accent);
    background: var(--bg);
    font-size: 0.95rem;
}

/* Admin UI */

.admin-body .wrap {
    max-width: 1100px;
}

.admin-header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.admin-nav a {
    color: var(--accent);
    text-decoration: none;
}

.admin-nav a[aria-current="page"] {
    color: var(--text);
    font-weight: 600;
}

.admin-main h2 {
    margin-top: 0;
}

.admin-login {
    max-width: 420px;
    margin: 2rem auto;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.25rem 0;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.admin-inline-input {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    max-width: 140px;
}

.admin-reject-form {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
}

.status-pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: lowercase;
    background: var(--bg);
    color: var(--muted);
}

.status-published,
.status-active,
.status-completed {
    background: #1f3d2a;
    color: #8fd4a8;
}

.status-paused,
.status-pending_review,
.status-pending {
    background: #3d351f;
    color: #d4c88f;
}

.status-suspended,
.status-blocked,
.status-hidden,
.status-refunded {
    background: #3d1f1f;
    color: #d48f8f;
}

.status-delisted,
.status-draft {
    background: #2a2a2a;
    color: var(--muted);
}

.audit-context {
    font-size: 0.75rem;
    max-width: 360px;
    word-break: break-all;
}

