/**
 * The plugin's only stylesheet. Loaded on every front-end page and every admin page,
 * with no conditional checks.
 *
 * Because it loads everywhere in wp-admin, it must never style a bare element — no
 * `table`, no `input`, no `h2`. Every selector is prefixed `offmarket-`, so nothing here
 * can reach WordPress's own chrome or another plugin's markup. Front and back use the
 * same classes, so a card or a form looks the same wherever it appears.
 */

:root {
    --offmarket-ink: #1d2327;
    --offmarket-muted: #646970;
    --offmarket-line: #dcdcde;
    --offmarket-surface: #fff;
    --offmarket-sunk: #f6f7f7;
    --offmarket-accent: #2271b1;
    --offmarket-accent-ink: #fff;
    --offmarket-danger: #b32d2e;
    --offmarket-good: #007017;
    --offmarket-radius: 4px;
    --offmarket-gap: 1rem;
    --offmarket-measure: 34rem;
}

/* ---- Layout ------------------------------------------------------------- */

.offmarket-stack > * + * {
    margin-top: var(--offmarket-gap);
}

.offmarket-grid {
    display: grid;
    gap: var(--offmarket-gap);
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.offmarket-grid--wide {
    grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
}

.offmarket-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--offmarket-gap);
    align-items: center;
}

.offmarket-card {
    background: var(--offmarket-surface);
    border: 1px solid var(--offmarket-line);
    border-radius: var(--offmarket-radius);
    padding: 1.25rem;
}

.offmarket-panel {
    background: var(--offmarket-sunk);
    border-radius: var(--offmarket-radius);
    padding: 1.25rem;
}

/* ---- Type --------------------------------------------------------------- */

.offmarket-title {
    margin: 0 0 .25rem;
    font-size: 1.35rem;
    line-height: 1.25;
    color: var(--offmarket-ink);
}

.offmarket-subtitle {
    margin: 0 0 1rem;
    color: var(--offmarket-muted);
}

.offmarket-eyebrow {
    margin: 0 0 .35rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--offmarket-muted);
}

.offmarket-meta {
    color: var(--offmarket-muted);
    font-size: .875rem;
}

.offmarket-hint {
    display: block;
    margin-top: .3rem;
    color: var(--offmarket-muted);
    font-size: .8125rem;
}

/* ---- Forms -------------------------------------------------------------- */

.offmarket-form {
    max-width: var(--offmarket-measure);
}

.offmarket-form .offmarket-field + .offmarket-field,
.offmarket-form .offmarket-field + .offmarket-fieldset,
.offmarket-form .offmarket-fieldset + .offmarket-field {
    margin-top: 1.1rem;
}

.offmarket-field {
    display: block;
}

.offmarket-field > .offmarket-label {
    display: block;
    margin-bottom: .3rem;
    font-weight: 600;
    color: var(--offmarket-ink);
}

.offmarket-input {
    box-sizing: border-box;
    width: 100%;
    padding: .55rem .65rem;
    border: 1px solid var(--offmarket-line);
    border-radius: var(--offmarket-radius);
    background: var(--offmarket-surface);
    color: var(--offmarket-ink);
    font: inherit;
    line-height: 1.4;
}

.offmarket-input:focus {
    border-color: var(--offmarket-accent);
    outline: 2px solid transparent;
    box-shadow: 0 0 0 2px var(--offmarket-accent);
}

.offmarket-fieldset {
    margin: 0;
    padding: 1rem 1.1rem 1.1rem;
    border: 1px solid var(--offmarket-line);
    border-radius: var(--offmarket-radius);
    background: var(--offmarket-sunk);
}

.offmarket-fieldset[hidden] {
    display: none;
}

.offmarket-fieldset > legend {
    padding: 0 .4rem;
    font-size: .8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--offmarket-muted);
}

.offmarket-fieldset .offmarket-field + .offmarket-field {
    margin-top: .9rem;
}

.offmarket-check {
    display: flex;
    gap: .55rem;
    align-items: flex-start;
    line-height: 1.45;
}

.offmarket-check input {
    margin-top: .2rem;
    flex: 0 0 auto;
}

.offmarket-button {
    display: inline-block;
    padding: .6rem 1.15rem;
    border: 1px solid transparent;
    border-radius: var(--offmarket-radius);
    background: var(--offmarket-accent);
    color: var(--offmarket-accent-ink);
    font: inherit;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}

.offmarket-button:hover,
.offmarket-button:focus {
    filter: brightness(1.08);
    color: var(--offmarket-accent-ink);
}

/* ---- Notices ------------------------------------------------------------ */

.offmarket-notice {
    margin: 0 0 var(--offmarket-gap);
    padding: .8rem 1rem;
    border-left: 4px solid var(--offmarket-accent);
    border-radius: var(--offmarket-radius);
    background: var(--offmarket-sunk);
    color: var(--offmarket-ink);
}

.offmarket-notice--error {
    border-left-color: var(--offmarket-danger);
}

.offmarket-notice--good {
    border-left-color: var(--offmarket-good);
}

/* ---- Data --------------------------------------------------------------- */

.offmarket-summary {
    display: grid;
    gap: .2rem .9rem;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    margin: .5rem 0 0;
    padding: 0;
    list-style: none;
}

.offmarket-summary > li {
    break-inside: avoid;
}

.offmarket-definitions {
    margin: 0;
}

.offmarket-definitions dt {
    margin-top: .8rem;
    font-weight: 600;
}

.offmarket-definitions dd {
    margin: 0;
}

.offmarket-scroll {
    overflow-x: auto;
}

/* ---- Badges ------------------------------------------------------------- */

.offmarket-badge {
    display: inline-block;
    padding: .1rem .45rem;
    border: 1px solid var(--offmarket-line);
    border-radius: 2rem;
    background: var(--offmarket-surface);
    color: var(--offmarket-ink);
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.offmarket-badge--supply {
    border-color: #2271b1;
    background: #2271b1;
    color: #fff;
}

.offmarket-badge--demand {
    border-color: #674399;
    background: #674399;
    color: #fff;
}

.offmarket-badge--quiet {
    background: var(--offmarket-sunk);
    color: var(--offmarket-muted);
    font-weight: 500;
}

.offmarket-badge--warn {
    border-color: #cc9200;
    background: #fcf3e3;
    color: #7a5800;
}

.offmarket-badge--good {
    border-color: #007017;
    background: #edfaef;
    color: #007017;
}

.offmarket-badge--ber {
    border-color: #007017;
    background: #007017;
    color: #fff;
}

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

.offmarket-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .8125rem;
}

/* ---- Standalone pages --------------------------------------------------- */
/* The brochure, data room and unsubscribe pages render outside the theme, so they carry
   their own page frame rather than inheriting one. */

.offmarket-page {
    margin: 0;
    padding: 3rem 1.5rem;
    background: var(--offmarket-sunk);
    color: var(--offmarket-ink);
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.offmarket-page .offmarket-sheet {
    max-width: 42rem;
    margin: 0 auto;
    padding: 2.5rem;
    background: var(--offmarket-surface);
    border-radius: var(--offmarket-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.offmarket-page .offmarket-sheet--narrow {
    max-width: 26rem;
}

.offmarket-page .offmarket-footnote {
    max-width: 42rem;
    margin: 1.25rem auto 0;
    font-size: .85rem;
    color: var(--offmarket-muted);
}

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

.offmarket-filelist > li {
    padding: .6rem 0;
    border-bottom: 1px solid var(--offmarket-sunk);
}

@media (max-width: 480px) {
    .offmarket-page {
        padding: 1.5rem 1rem;
    }

    .offmarket-page .offmarket-sheet {
        padding: 1.5rem;
    }
}
