:root {
    color-scheme: light;
    --ink: #1b1b1b;
    --muted: #5c5c5c;
    --line: #e4e4e4;
    --bg: #f6f5f2;
    --panel: #fff;
    --accent: #1f4d3a;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ink);
    background: var(--bg);
}

h1, h2, .brand {
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 { margin: 0 0 0.4rem; font-size: 2rem; }

.lede {
    margin: 0 0 1.25rem;
    color: var(--muted);
    font-size: 1.15rem;
}

.shell {
    max-width: 40rem;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--panel);
    border: 1px solid var(--line);
}

.app-shell {
    display: grid;
    grid-template-columns: 14rem 1fr;
    min-height: 100vh;
}

.sidebar {
    padding: 1.25rem 1rem;
    border-right: 1px solid var(--line);
    background: var(--panel);
}

.brand {
    margin: 0 0 1.25rem;
    font-size: 1.05rem;
}

.brand span {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-family: system-ui, sans-serif;
}

.sidebar nav a {
    display: block;
    padding: 0.4rem 0.5rem;
    color: var(--ink);
    text-decoration: none;
    border-radius: 4px;
}

.sidebar nav a.active,
.sidebar nav a:hover {
    background: var(--bg);
}

.content {
    padding: 2rem 2.25rem;
}

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

.button {
    display: inline-block;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font: inherit;
    cursor: pointer;
}

.button.secondary {
    background: var(--panel);
    color: var(--ink);
    border-color: var(--line);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
}

.filters input[type="search"] {
    flex: 1 1 16rem;
    min-width: 12rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    font: inherit;
}

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

.state-empty,
.state-error { max-width: 36rem; }

.state-error { border-color: #b42318; }

.selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.85rem;
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}

.product-card:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.product-card__media {
    display: block;
    aspect-ratio: 1;
    background: #eceae4;
}

.product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--muted);
    font-family: system-ui, sans-serif;
    font-size: 0.85rem;
}

.product-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.75rem 0.85rem 1rem;
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
}

.product-card__name { font-family: Georgia, serif; }

.product-card__select {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.pager__links { display: flex; gap: 0.5rem; }

.loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(246, 245, 242, 0.82);
    font-size: 1.1rem;
}

.loading-overlay[hidden] { display: none; }

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--accent);
    font-family: system-ui, sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.stepper {
    margin: 0 0 1.5rem;
}

.stepper ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: system-ui, sans-serif;
    font-size: 0.85rem;
}

.stepper li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
}

.stepper li.is-current { color: var(--ink); font-weight: 600; }
.stepper li.is-done { color: var(--accent); }

.stepper__n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.75rem;
}

.stepper li.is-current .stepper__n,
.stepper li.is-done .stepper__n {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.wizard-form { max-width: 48rem; }

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.65rem;
}

.choice-grid--wide {
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

.choice-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.85rem 0.9rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
}

.choice-card--compact { padding: 0.7rem 0.8rem; }

.choice-card:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.choice-card input { accent-color: var(--accent); }

.field-stack {
    margin: 0 0 1.35rem;
    padding: 0;
    border: 0;
}

.field-stack legend,
.field-label {
    display: block;
    margin-bottom: 0.55rem;
    font-weight: 600;
}

.custom-colour { display: none; margin-top: 0.75rem; }

.field-stack:has([name="colour"][value="custom"]:checked) .custom-colour {
    display: block;
}

.custom-colour input[type="text"],
.wizard-form input[type="text"],
textarea {
    width: 100%;
    max-width: 36rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    font: inherit;
}

.field-error {
    margin: 0 0 0.75rem;
    color: #b42318;
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
}

.wizard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1.5rem;
}

.wizard-actions form { margin: 0; }

.review-panel { max-width: 36rem; }

.review-list {
    display: grid;
    gap: 0.85rem;
    margin: 0;
}

.review-list div { margin: 0; }

.review-list dt {
    color: var(--muted);
    font-family: system-ui, sans-serif;
    font-size: 0.8rem;
}

.review-list dd { margin: 0.15rem 0 0; }

.notes-kept {
    max-width: 36rem;
    margin: 0 0 1.25rem;
}

.notes-kept p {
    margin: 0.4rem 0 0;
}

.prompt-block {
    margin: 0 0 1.25rem;
}

.prompt-block h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.prompt-output {
    margin: 0;
    padding: 1rem 1.1rem;
    max-width: 48rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    white-space: pre-wrap;
    font-family: system-ui, sans-serif;
    font-size: 0.95rem;
    line-height: 1.45;
}

.export { max-width: 48rem; }

.export-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.format-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.format-switch__btn {
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    border-radius: 4px;
    font: inherit;
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
}

.format-switch__btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.export-copy {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.copy-status {
    color: var(--accent);
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
}

.export-panel textarea.visually-hidden,
.export-panel--storage {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.bulk-results { max-width: 64rem; }

.bulk-results__meta {
    margin: 0 0 1rem;
    color: var(--muted);
    font-family: system-ui, sans-serif;
    font-size: 0.95rem;
}

.bulk-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
}

.bulk-table {
    width: 100%;
    border-collapse: collapse;
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
}

.bulk-table th,
.bulk-table td {
    padding: 0.7rem 0.75rem;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid var(--line);
}

.bulk-table thead th {
    border-top: 0;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.bulk-table__thumb { width: 4rem; }

.bulk-table__thumb img {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    background: #eceae4;
}

.bulk-table__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #eceae4;
    color: var(--muted);
    border-radius: 4px;
    font-size: 0.65rem;
    text-align: center;
    line-height: 1.2;
}

.bulk-table__name {
    font-family: Georgia, serif;
    font-size: 1rem;
}

.bulk-table__sku { white-space: nowrap; }

.bulk-status {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
}

.bulk-status--ready { color: var(--accent); }

.bulk-status--unavailable { color: var(--muted); }

.bulk-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.bulk-preview { margin: 0; }

.bulk-preview summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.85rem;
}

.bulk-preview__text {
    margin-top: 0.55rem;
    max-width: 40rem;
    max-height: 16rem;
    overflow: auto;
}

.brand-preset-choice { max-width: 36rem; margin-bottom: 1.25rem; }

.brand-preset-choice__toggle {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    cursor: pointer;
}

.brand-preset-choice__toggle strong { display: block; }

.brand-preset-choice p { margin: 0.55rem 0 0; }

.history-list {
    display: grid;
    gap: 0.75rem;
    max-width: 48rem;
}

.history-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.9rem 1rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.history-card h2 {
    margin: 0.2rem 0 0;
    font-size: 1.15rem;
}

.plan-compare {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.plan-compare ul { padding-left: 1.1rem; }

.plan-pill {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.4rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--accent);
    font-family: system-ui, sans-serif;
    font-size: 0.7rem;
    vertical-align: middle;
}

.choice-card--locked { opacity: 0.72; cursor: default; }

.history-card__meta {
    margin: 0;
    color: var(--muted);
    font-family: system-ui, sans-serif;
    font-size: 0.8rem;
}

@media (max-width: 720px) {
    .bulk-table th:nth-child(3),
    .bulk-table td:nth-child(3) {
        display: none;
    }
}

@media (max-width: 720px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
    .content { padding: 1.25rem 1rem 2rem; }
    .stepper ol { gap: 0.45rem 0.75rem; }
    .history-card { flex-direction: column; align-items: flex-start; }
}
