/* CutNest theme (Figma "Cutnest-design"): near-black / light grey
   workshop surfaces, one safety-orange accent, square corners, and three
   faces: Space Grotesk for display, Geist for body, IBM Plex Mono for labels. */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;700&display=swap');

:root {
    --bg: #191919;
    --bg-sidebar: #1d1d1d;
    --bg-card: #242424;
    --bg-raised: #252525;
    --bg-input: #1d1d1d;
    --bg-canvas: #1d1d1d;
    --border: #454545;
    --border-strong: #777777;
    --text: #f1f1f1;
    --text-dim: #aaaaaa;
    /* Orange as text/lines; --accent-fill sits behind dark --on-accent text. */
    --accent: #ff833f;
    --accent-hover: #ff9a5e;
    --accent-fill: #ff6b1a;
    --accent-fill-hover: #ff7d36;
    --accent-rgb: 255, 107, 26;
    --on-accent: #191919;
    --success: #4cc38a;
    --error: #f87171;
    --warning: #fbbf24;
    --radius: 0px;
    --font-display: 'Space Grotesk', 'Geist', system-ui, sans-serif;
    --font-body: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    /* Chamfered corners of the orange buttons (top-left, bottom-right). */
    --chamfer: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    color-scheme: dark;
}

html.light {
    --bg: #e7e7e7;
    --bg-sidebar: #f2f2f2;
    --bg-card: #dfdfdf;
    --bg-raised: #f2f2f2;
    --bg-input: #f2f2f2;
    --bg-canvas: #dadada;
    --border: #bdbdbd;
    --border-strong: #9a9a9a;
    --text: #191919;
    --text-dim: #626262;
    --accent: #a13a00;
    --accent-hover: #7f2e00;
    --accent-fill: #ff6b1a;
    --accent-fill-hover: #ff7d36;
    --on-accent: #191919;
    --success: #0f7b4b;
    --error: #c62828;
    --warning: #9a5b00;
    color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; }

/* Layout */
.app {
    display: grid;
    grid-template-columns: 360px 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

header {
    grid-column: 1 / -1;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.settings-wrap {
    position: relative;
}

.settings-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: 18px;
    padding: 4px 8px;
    cursor: pointer;
    line-height: 1;
}

.settings-btn:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

.settings-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    min-width: 180px;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.settings-dropdown.open {
    display: block;
}

.settings-section {
    margin-bottom: 8px;
}

.settings-label {
    display: block;
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.lang-select {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 4px 8px;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
}

.settings-link {
    display: block;
    color: var(--text-dim);
    font-size: 12px;
    text-decoration: none;
    padding: 6px 0;
    border-top: 1px solid var(--border);
}

.settings-link:hover {
    color: var(--accent);
}

header h1 span {
    color: var(--accent);
}

header .tagline {
    color: var(--text-dim);
    font-size: 13px;
}

.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Nest rejection slot: an empty flex child would still claim a 24px gap. */
#nest-error:empty {
    display: none;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 16px;
}

/* Forms */
.form-group {
    margin-bottom: 12px;
}

.form-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 4px;
}

input[type="text"],
input[type="number"],
input[type="email"],
select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 0;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

input:focus, select:focus {
    border-color: var(--accent);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-fill);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--accent-fill-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* .btn sets display, which would otherwise show a [hidden] button. */
.btn[hidden] {
    display: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg-input);
    border-color: var(--accent);
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
}

.btn-danger:hover {
    background: var(--error);
    color: white;
}

/* Upload area */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
}

.upload-zone .icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.upload-zone p {
    color: var(--text-dim);
    font-size: 13px;
}

.upload-zone .formats {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
}

input[type="file"] {
    display: none;
}

/* Part list */
.part-list {
    list-style: none;
}

.part-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.part-item:hover {
    background: rgba(var(--accent-rgb), 0.08);
}

.part-item.part-highlighted {
    background: rgba(var(--accent-rgb), 0.15);
    box-shadow: inset 3px 0 0 var(--accent);
}

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

.part-color {
    width: 12px;
    height: 12px;
    border-radius: 0;
    flex-shrink: 0;
}

.part-preview {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: var(--bg-input);
    border-radius: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.part-preview svg {
    width: 100%;
    height: 100%;
}

.part-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.part-name-input {
    flex: 1;
    min-width: 0;
    padding: 2px 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0;
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: all 0.15s;
    cursor: text;
}

.part-name-input:hover {
    border-color: var(--border);
    background: var(--bg-input);
}

.part-name-input:focus {
    border-color: var(--accent);
    background: var(--bg-input);
}

.part-info {
    color: var(--text-dim);
    font-size: 11px;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.3;
}

.part-qty {
    width: 50px;
}

.part-qty input {
    width: 50px;
    padding: 4px 6px;
    font-size: 12px;
    text-align: center;
}

.part-remove {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 2px;
    font-size: 16px;
    line-height: 1;
}

.part-remove:hover {
    color: var(--error);
}

/* Job result */
.job-result {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
    background: var(--bg-card);
}

.job-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.job-run-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.3px;
}

.job-run-time {
    font-size: 12px;
    color: var(--text-dim);
}

/* Results */
.sheet-preview {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.sheet-preview:last-of-type {
    margin-bottom: 0;
}

.sheet-preview svg {
    width: 100%;
    height: auto;
    max-height: 600px;
}

.download-all-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-value.good { color: var(--success); }
.stat-value.warn { color: var(--warning); }
.stat-value.bad { color: var(--error); }
/* Values with units (e.g. an offcut's size) are longer than a number. */
.stat-value-sm { font-size: 18px; line-height: 1.9; }

.stat-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.export-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Alerts */
.alert {
    padding: 10px 14px;
    border-radius: 0;
    font-size: 13px;
}

.alert-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--error);
}

.alert-success {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: var(--success);
}

.alert-info {
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    color: var(--text);
}

.alert-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: none;
    border: none;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    padding: 2px 4px;
    cursor: pointer;
}

/* Import notes under the upload zone (app.js showUploadNotes) */
#upload-notes .alert {
    position: relative;
    margin-top: 8px;
    padding-right: 28px;
}

#upload-notes ul {
    margin: 4px 0 0 16px;
    padding: 0;
}

/* Directional-material hint under the rotations select (app.js maybeShowRotationHint) */
#rotation-hint {
    position: relative;
    margin-top: 8px;
    padding-right: 28px;
    font-size: 12px;
}

.rotation-hint-apply {
    background: none;
    border: none;
    padding: 0;
    margin-left: 4px;
    color: var(--accent);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-dim);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
}

/* Loading */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

.nest-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nest-btn-loading .spinner {
    border-top-color: #fff;
    border-color: rgba(255,255,255,0.3);
    border-top-color: #fff;
}

.sheet-estimate {
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
    margin-bottom: 6px;
    cursor: help;
}
.sheet-estimate:empty { display: none; }

#nest-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#nest-btn.nest-loading {
    cursor: wait;
}

/* Pressed buttons waiting on the server (busy.js, htmx requests) */
.is-busy,
.btn.htmx-request {
    pointer-events: none;
    opacity: 0.75;
    cursor: progress;
}

.is-busy .spinner {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
}

.btn-primary.is-busy .spinner {
    border-color: rgba(255,255,255,0.3);
    border-top-color: #fff;
}

.upload-zone.uploading {
    opacity: 0.5;
    pointer-events: none;
}

.upload-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    font-size: 13px;
    color: var(--text-dim);
}

.upload-status[hidden] {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress */
.nest-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.progress-content {
    text-align: center;
}

.progress-content h3 {
    margin-top: 20px;
    font-size: 18px;
}

.progress-content p {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 8px;
}

.spinner-large {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

/* Beta engine: badge, fallback note and the live preview (live.js) */
/* "What will you cut these on?" above the results (jobs_area.html). */
.machine-ask {
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.machine-ask-title {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    margin-bottom: 10px;
}
.machine-ask-options { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.machine-ask-skip {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    padding: 4px 6px;
}
.machine-thanks { font-size: 13px; color: var(--text-dim); }

.engine-note {
    font-size: 12px;
    color: var(--text-dim);
    margin: -8px 0 12px;
}

.fill-note {
    font-size: 15px;
    font-weight: 600;
    margin: -4px 0 14px;
}

.nest-progress.live {
    display: block;
    min-height: 0;
}

.live-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 16px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-dim);
}

.live-stats strong {
    color: var(--text);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.live-bar {
    height: 4px;
    border-radius: 0;
    background: var(--border);
    overflow: hidden;
    margin-bottom: 12px;
}

.live-bar > div {
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.5s linear;
}

.live-sheet {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    max-height: 70vh;
}

.live-svg > svg {
    display: block;
    width: 100%;
    max-height: calc(70vh - 16px);
}

/* Paywall */
.sheet-svg-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 0;
}

/* Sheet previews are drawn into the wrap by renderSheets (app.js); the wrap's
   aspect-ratio reserves the space until then. A tall sheet at full width
   would reserve far more height than fits on screen (and the SVG used to be
   capped at 600px inside it, leaving a big empty gap), so the wrap's width
   is capped to keep its height within the viewport. */
.sheet-svg-wrap {
    width: 100%;
    max-width: min(100%, calc(var(--sheet-aspect, 100) * 75vh));
    margin-inline: auto;
}
.sheet-svg-wrap > svg {
    display: block;
    width: 100%;
    height: 100%;
}
.sheet-svg-wrap[style*="--sheet-aspect"] > svg { max-height: none; }

/* SVG part highlight */
.nested-part {
    transition: opacity 0.2s;
}

.nested-part.highlight path {
    stroke-width: 2 !important;
    filter: drop-shadow(0 0 4px currentColor);
    animation: pulse-highlight 0.6s ease-in-out 3;
}

.nested-part.highlight text {
    font-size: 120%;
}

/* Dim non-highlighted parts when any part is highlighted */
.sheet-svg-wrap:has(.nested-part.highlight) .nested-part:not(.highlight) {
    opacity: 0.2;
}

@keyframes pulse-highlight {
    0%, 100% { filter: drop-shadow(0 0 3px currentColor); }
    50% { filter: drop-shadow(0 0 8px currentColor); }
}

/* Part Gallery */
.part-preview {
    cursor: pointer;
}

.gallery-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.gallery-overlay.active {
    display: flex;
}

.gallery-modal {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 90vw;
    max-height: 90vh;
}

.gallery-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    min-width: 300px;
    max-width: 70vw;
}

.gallery-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 65vh;
}

.gallery-svg svg {
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
}

.gallery-label {
    font-size: 16px;
    font-weight: 600;
    margin-top: 12px;
    color: var(--text);
}

.gallery-counter {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}

.gallery-arrow {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 36px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    line-height: 1;
}

.gallery-arrow:hover {
    background: var(--bg-input);
    border-color: var(--accent);
}

.gallery-close {
    position: fixed;
    top: 16px;
    right: 16px;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
    transition: all 0.15s;
}

.gallery-close:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

/* Responsive */
@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
    }
    .main {
        order: 1;
    }
    .sidebar {
        order: 2;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    /* Stacked: the footer goes last, and the upload box is below, not left. */
    .app > footer {
        order: 3;
    }
}

/* Logo (partials/logo.html): inline SVG in the text colour. */
.brand {
    display: flex;
    align-items: center;
    margin: 0;
    line-height: 0;
}

.brand .logo {
    height: 26px;
    width: auto;
    color: var(--text);
}

.brand-link {
    display: flex;
    color: inherit;
    text-decoration: none;
}

.auth-logo {
    display: block;
    padding: 20px 20px 4px;
    color: var(--text);
}

.auth-logo .logo {
    height: 28px;
    width: auto;
}

/* Visually hidden, still read by screen readers and search engines. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.footer-nav a {
    font-size: 12px;
    color: var(--text-dim);
    text-decoration: none;
}

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

/* Page titles on the static pages (one h1 each). */
.page-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

/* Marketing pages: /cnc-nesting-software, /alternatives. */
.mk {
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

.mk h1 {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin-bottom: 14px;
}

.mk h2 {
    font-size: 24px;
    font-weight: 800;
    margin: 56px 0 14px;
}

.mk h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
}

.mk p,
.mk li {
    font-size: 15px;
    color: var(--text-dim);
    line-height: 1.7;
}

.mk p + p {
    margin-top: 10px;
}

.mk ul {
    padding-left: 20px;
}

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

.mk .lead {
    font-size: 18px;
    color: var(--text);
    max-width: 720px;
}

.mk-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 24px 0 8px;
}

.mk-actions .btn,
header .btn {
    width: auto;
}

.mk-actions .btn {
    font-size: 15px;
    padding: 12px 24px;
    text-decoration: none;
}

.mk .mk-actions a.btn-primary {
    color: #fff;
}

.mk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.mk-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 20px;
}

.mk-card p {
    font-size: 14px;
}

.mk-table-wrap {
    overflow-x: auto;
    margin: 8px 0;
    border: 1px solid var(--border);
    border-radius: 0;
}

.mk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mk-table th,
.mk-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    color: var(--text);
}

.mk-table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    background: var(--bg-card);
}

.mk-table tr:last-child td {
    border-bottom: none;
}

.mk-table td.ours {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.mk-src {
    font-size: 11px;
    margin-left: 4px;
    white-space: nowrap;
}

.mk-note {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 8px;
}

.mk-crumbs {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.mk-crumbs a {
    color: var(--text-dim);
}

.mk-faq {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mk-faq details {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 16px 20px;
}

.mk-faq summary {
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
}

.mk-faq details p {
    margin-top: 10px;
}

@media (max-width: 640px) {
    .mk {
        padding: 32px 16px 48px;
    }
    .mk h1 {
        font-size: 28px;
    }
}

/* Shown only while there are parts (parts.js sets body.has-parts). */
body:not(.has-parts) .parts-only {
    display: none !important;
}

.parts-note {
    margin: 8px 16px 12px;
    font-size: 12px;
    color: var(--text-dim);
}

/* Upsell modal (partials/upsell.html, upsell.js) */
.upsell-modal {
    margin: auto;
    width: calc(100% - 32px);
    max-width: 440px;
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: auto;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(var(--accent-rgb), 0.12);
}
.upsell-modal::backdrop {
    background: rgba(8, 10, 16, 0.65);
    backdrop-filter: blur(3px);
}
.upsell-modal[open] {
    animation: upsell-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes upsell-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
.upsell-hero {
    position: relative;
    padding: 18px 16px 6px;
    background:
        radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
        linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--bg-card)), var(--bg-card));
    border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.upsell-art {
    display: block;
    width: 100%;
    max-width: 280px;
    height: auto;
    margin: 0 auto;
}
.upsell-art-sheet {
    fill: color-mix(in srgb, var(--bg) 70%, transparent);
    stroke: color-mix(in srgb, var(--accent) 45%, var(--border));
    stroke-width: 1.5;
}
.upsell-art-parts > * {
    fill: color-mix(in srgb, var(--accent) 22%, transparent);
    stroke: var(--accent);
    stroke-width: 1.5;
    stroke-linejoin: round;
}
.upsell-art-parts > .upsell-art-accent {
    fill: var(--success);
    stroke: var(--success);
}
.upsell-modal[open] .upsell-art-parts > * {
    animation: upsell-part 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.upsell-modal[open] .upsell-art-parts > :nth-child(2) { animation-delay: 0.05s; }
.upsell-modal[open] .upsell-art-parts > :nth-child(3) { animation-delay: 0.1s; }
.upsell-modal[open] .upsell-art-parts > :nth-child(4) { animation-delay: 0.15s; }
.upsell-modal[open] .upsell-art-parts > :nth-child(5) { animation-delay: 0.2s; }
.upsell-modal[open] .upsell-art-parts > :nth-child(6) { animation-delay: 0.25s; }
.upsell-modal[open] .upsell-art-parts > :nth-child(7) { animation-delay: 0.3s; }
.upsell-modal[open] .upsell-art-parts > :nth-child(8) { animation-delay: 0.45s; }
@keyframes upsell-part {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .upsell-modal[open],
    .upsell-modal[open] .upsell-art-parts > * { animation: none; }
}
.upsell-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--bg-card) 70%, transparent);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-dim);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.upsell-close:hover { color: var(--text); border-color: var(--text-dim); }
.upsell-body {
    padding: 20px 24px 18px;
}
.upsell-pill {
    display: inline-block;
    padding: 3px 10px;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-radius: 0;
}
.upsell-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
    text-wrap: balance;
}
.upsell-sub {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 16px;
}
.upsell-compare {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 18px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
}
.upsell-compare th,
.upsell-compare td {
    padding: 8px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.upsell-compare tbody tr:last-child > * { border-bottom: none; }
.upsell-compare thead > tr > * {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    background: var(--bg-input);
}
.upsell-compare tbody th {
    text-align: left;
    font-weight: 500;
    color: var(--text);
}
.upsell-compare tbody td {
    color: var(--text-dim);
    white-space: nowrap;
}
.upsell-compare .is-free {
    color: var(--accent);
    font-weight: 700;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.upsell-compare thead .is-free {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 16%, var(--bg-input));
}
.upsell-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 6px 0 16px;
}
.upsell-price-amount {
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}
.upsell-price-note {
    font-size: 13px;
    color: var(--text-dim);
}
.upsell-grid {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    margin-bottom: 20px;
}
.upsell-grid li {
    position: relative;
    padding-left: 24px;
    font-size: 13px;
    line-height: 1.35;
}
.upsell-grid li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    top: -1px;
    width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 800;
    color: var(--success);
    background: color-mix(in srgb, var(--success) 16%, transparent);
    border-radius: 50%;
}
@media (max-width: 420px) {
    .upsell-grid { grid-template-columns: 1fr; }
    .upsell-body { padding: 18px 18px 16px; }
}
.upsell-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
/* The sign-in forms' "don't email me" opt-out (login.html, upsell.html). */
.optout {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text-dim);
    text-align: left;
    cursor: pointer;
}
.optout input {
    flex: none;
    width: 14px;
    height: 14px;
    margin: 1px 0 0;
    accent-color: var(--accent);
    cursor: pointer;
}
.upsell-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.upsell-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.upsell-cta {
    display: flex;
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    border-radius: 0;
    text-decoration: none;
    box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}
.upsell-cta:hover { transform: translateY(-1px); }
.upsell-cta:focus { outline: none; }
.upsell-cta:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
    outline-offset: 3px;
}
.upsell-trust {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: var(--text-dim);
}
.upsell-trust a { color: inherit; }
.upsell-later {
    display: block;
    margin: 8px auto 0;
    padding: 4px 8px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
}
.upsell-later:hover { color: var(--text); text-decoration: underline; }

/* Example nests (partials/examples.html, examples.js) */
.examples {
    margin: 0 0 32px;
}
/* Outside the hero it heads the empty page, at the hero's width. */
.main > .examples {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 32px 8px;
    animation: fadeIn 0.3s ease;
}
body.has-parts .examples {
    display: none;
}
.examples-head h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}
.examples-head p {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 14px;
}
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.example-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s;
}
.example-card:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    transform: translateY(-2px);
}
.example-preview {
    position: relative;
    padding: 12px 12px 26px;
    background: color-mix(in srgb, var(--bg-input) 55%, var(--bg-card));
    border-bottom: 1px solid var(--border);
}
.example-svg {
    display: block;
    width: 100%;
    height: auto;
}
.example-sheet {
    fill: var(--bg-card);
    stroke: var(--text-dim);
    stroke-width: 1;
    stroke-dasharray: 6 4;
    vector-effect: non-scaling-stroke;
}
.example-preview-label {
    position: absolute;
    left: 12px;
    bottom: 6px;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.example-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 12px 14px 14px;
}
.example-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.example-feature {
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 0;
}
.example-feature {
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.example-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}
.example-desc {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 8px;
}
.example-meta {
    margin-top: auto;
    margin-bottom: 10px;
    font-size: 11px;
    color: var(--text-dim);
}
.example-run {
    width: 100%;
    justify-content: center;
}
.example-run .example-run-busy,
.example-run.is-busy .example-run-label {
    display: none;
}
.example-run.is-busy .example-run-busy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.example-modal-preview {
    display: flex;
    justify-content: center;
}
.example-modal-preview > .nest-svg {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 160px;
    margin: 16px auto 4px;
    border-radius: 0;
}
@media (max-width: 640px) {
    .main > .examples { padding: 20px 16px 4px; }
}

/* Guide hub cards and article links (guides.html, article.html) */
a.mk-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s;
}
a.mk-card-link:hover {
    border-color: var(--accent);
}
.mk .mk-card-title {
    font-size: 15px;
    margin: 0 0 6px;
}
.mk ol {
    margin: 0 0 16px 20px;
}
.mk ol li {
    margin-bottom: 6px;
}
.mk-related li {
    margin-bottom: 4px;
}
.example-title a { color: inherit; text-decoration: none; }
.example-title a:hover { text-decoration: underline; }
a.example-preview { display: block; }
.example-figure {
    margin: 8px 0 24px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
}
.example-figure .example-svg { max-height: 420px; }
.mk .example-title { font-size: 15px; margin: 0 0 4px; }

.mk .lead + .mk-grid { margin-top: 24px; }

/* Blog (blog.html, blog_post.html). Text column is narrower than .mk for
   reading; photos keep their aspect ratio from width/height. */
.blog-post {
    max-width: 760px;
}
.blog-byline {
    font-size: 13px !important;
    color: var(--text-dim);
    margin: 0 0 14px;
}
.blog-fig {
    margin: 20px 0 24px;
}
.blog-fig img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    background: var(--bg-card);
}
.blog-fig-imgs {
    display: grid;
    gap: 10px;
}
.blog-fig-pair .blog-fig-imgs {
    grid-template-columns: 1fr 1fr;
}
/* A single portrait photo would fill the screen; cap it. */
.blog-fig:not(.blog-fig-pair) .blog-fig-img.portrait {
    max-width: 440px;
    margin: 0 auto;
}
.blog-fig-img {
    position: relative;
}
.blog-fig-img time {
    position: absolute;
    left: 8px;
    bottom: 8px;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}
.blog-fig figcaption {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
    margin-top: 8px;
}
.blog-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
    margin: 8px 0 8px;
}
.blog-facts > div {
    background: var(--bg-card);
    padding: 12px 14px;
}
.blog-facts dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 2px;
}
.blog-facts dd {
    font-size: 14px;
    color: var(--text);
    margin: 0;
}
.blog-list {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}
.mk .blog-card {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    align-items: center;
}
.blog-card img {
    width: 100%;
    height: auto;
    border-radius: 0;
}
@media (max-width: 640px) {
    .mk .blog-card {
        grid-template-columns: 1fr;
    }
}

/* Email gate (upsell.js): unlocked-uploads and verify-your-email notices. */
.gate-banner {
    background: rgba(var(--accent-rgb), 0.12);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    padding: 12px 20px;
    font-size: 14px;
    line-height: 1.5;
}

.gate-banner a {
    color: var(--accent);
    margin-left: 6px;
}

/* ==========================================================================
   CutNest theme layer (Figma "Cutnest-design")
   Everything above keeps its structure; this layer restyles it: square
   panels separated by 1px rules, mono uppercase labels, chamfered orange
   primary buttons. Later rules here win over the originals above.
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

::selection { background: rgba(var(--accent-rgb), 0.35); }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

:focus-visible {
    outline: 2px solid var(--accent-fill);
    outline-offset: 2px;
}

/* ---- Offer bar (above the top bar) ------------------------------------- */
.site-top { grid-column: 1 / -1; position: relative; z-index: 21; }
.promo-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 9px 16px;
    background: var(--accent-fill);
    color: var(--on-accent);
    font-size: 14px;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
}
.promo-bar:hover { background: var(--accent-fill-hover); color: var(--on-accent); }
.promo-bar strong { font-weight: 700; }
.promo-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 1px 8px;
}
.promo-sep { margin: 0 8px; }
.promo-cta { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
    .promo-bar { font-size: 13px; padding: 8px 16px; }
    .promo-more, .promo-cta { display: none; }
}
@media (max-width: 420px) {
    .promo-tag { display: none; }
}

/* ---- Top bar ------------------------------------------------------------ */
header,
header.topbar {
    grid-column: 1 / -1;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    height: 80px;
    padding: 0 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    z-index: 20;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    min-width: 0;
}
.topbar-left { gap: 18px; }
.topbar-right { gap: 8px; }

.brand .logo { height: 28px; }

.plan-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 4px 8px;
    line-height: 1.4;
}

.topnav {
    display: flex;
    align-items: stretch;
    gap: 4px;
    margin-left: 34px;
    height: 80px;
}

.topnav a,
.topnav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-dim);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.topnav a:hover,
.topnav-link:hover { color: var(--text); }

.topnav a.is-active { color: var(--text); }
.topnav a.is-active::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 18px;
    height: 2px;
    background: var(--accent);
}

.topnav-link { height: 36px; }
.topnav-strong { color: var(--text); }

header .tagline { display: none; }

header .btn { width: auto; }

.settings-btn {
    border: 1px solid transparent;
    color: var(--text-dim);
    font-size: 16px;
    width: 36px;
    height: 36px;
    padding: 0;
}
.settings-btn:hover { border-color: var(--border); color: var(--text); }

.settings-dropdown {
    top: calc(100% + 18px);
    background: var(--bg-card);
    border-color: var(--border);
    padding: 16px;
    min-width: 240px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.settings-label,
.settings-link { font-family: var(--font-mono); }
.settings-link { font-size: 12px; padding: 8px 0; }

/* ---- App layout --------------------------------------------------------- */
.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 20px 20px 24px;
    gap: 0;
}

.main {
    padding: 32px 40px 40px;
    gap: 24px;
}


/* Sidebar sections: flat, divided by rules, mono headers. */
.sidebar .card {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
    padding: 16px 0;
}
.sidebar .card:first-child { padding-top: 0; }

.card-header {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}
.sidebar .card-header {
    padding: 0 0 12px;
    border-bottom: none;
}
.sidebar .card-header[onclick] { padding-bottom: 0; }
.sidebar .card-header[onclick] + .card-body { padding-top: 14px; }
.card-header-end { display: inline-flex; align-items: center; gap: 12px; }
.card-arrow { font-size: 9px; float: none; }

.sidebar .card-body { padding: 0; }

/* Cards outside the sidebar keep a panel look. */
.main .card,
.mk-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.pro-tag {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

/* ---- Forms -------------------------------------------------------------- */
label {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-dim);
    margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 9px 10px;
    min-height: 36px;
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 30px;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
    background-position: calc(100% - 15px) 50%, calc(100% - 11px) 50%;
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
}

input:focus,
select:focus,
textarea:focus { border-color: var(--accent); }

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    margin: 0;
    border: 1px solid var(--border-strong);
    background: var(--bg-input);
    display: inline-grid;
    place-content: center;
    cursor: inherit;
}
input[type="checkbox"]::before {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--accent-fill);
    transform: scale(0);
    transition: transform 0.1s;
}
input[type="checkbox"]:checked { border-color: var(--accent-fill); }
input[type="checkbox"]:checked::before { transform: scale(1); }
input[type="checkbox"]:disabled { opacity: 0.55; }

.sidebar .form-group label:has(input[type="checkbox"]) {
    color: var(--text);
    font-size: 13px;
    gap: 10px !important;
    margin-bottom: 0;
}
.form-row { gap: 16px; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0;
    padding: 12px 20px;
    min-height: 44px;
    border-radius: 0;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn-sm {
    font-size: 12px;
    padding: 7px 14px;
    min-height: 34px;
}

.btn-primary {
    background: var(--accent-fill);
    color: var(--on-accent);
    clip-path: var(--chamfer);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-fill-hover);
    color: var(--on-accent);
}
.btn-primary:disabled { opacity: 0.4; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover:not(:disabled) {
    background: transparent;
    border-color: var(--text-dim);
    color: var(--text);
}

.btn-danger {
    border-color: color-mix(in srgb, var(--error) 60%, transparent);
}

.sidebar .btn-danger.btn-sm {
    min-height: 0;
    padding: 2px 8px;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#nest-btn {
    margin-top: 24px;
    min-height: 48px;
    font-size: 13px;
}


.spinner { border-color: color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; }
.btn-primary .spinner { border-color: rgba(25, 25, 25, 0.25); border-top-color: var(--on-accent); }

/* ---- Upload zone and part list ----------------------------------------- */
.upload-zone {
    border: 1px dashed var(--border-strong);
    background: transparent;
    padding: 18px 16px;
}
.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
}
.upload-zone p:first-of-type {
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
}
.upload-zone .formats { font-size: 11px; }

.part-item {
    border-radius: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}
.part-qty input {
    font-family: var(--font-mono);
    text-align: center;
    min-height: 26px;
    padding: 2px 4px;
}

.sheet-estimate { font-family: var(--font-mono); font-size: 11px; }

/* ---- Workspace results -------------------------------------------------- */
.job-result {
    background: transparent;
    border: 1px solid var(--border);
    padding: 24px;
}
.job-header { border-bottom-color: var(--border); }
.job-run-label {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.job-run-time { font-family: var(--font-mono); font-size: 11px; }

.sheet-preview {
    background-color: var(--bg-canvas);
    background-image:
        linear-gradient(color-mix(in srgb, var(--border) 35%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--border) 35%, transparent) 1px, transparent 1px);
    background-size: 32px 32px;
    border-color: var(--border);
    padding: 24px;
}

/* One row of stats divided by rules. Flex-wrap so a short last row fills
   the width; each card draws its right and bottom rule, and the frame clips
   the ones on the outer edge. */
.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border: 1px solid var(--border);
    overflow: hidden;
}
.stat-card {
    flex: 1 1 150px;
    background: transparent;
    text-align: left;
    padding: 16px 18px;
    box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border);
}
.stat-value {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 32px;
    letter-spacing: -0.03em;
}
.stat-value.stat-value-sm { font-size: 20px; line-height: 1.6; letter-spacing: -0.01em; }
.stat-label,
.example-preview-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
}

.download-all-bar { background: var(--bg-card); border: 1px solid var(--border); }

/* Status lines: a rule on the left in the accent, like the design's
   "Nest complete" line. */
.alert {
    border-radius: 0;
    border-width: 0 0 0 2px;
    border-style: solid;
    padding: 10px 16px;
}
.alert-error { background: color-mix(in srgb, var(--error) 8%, transparent); border-color: var(--error); }
.alert-success { background: color-mix(in srgb, var(--success) 8%, transparent); border-color: var(--success); }
.alert-info { background: rgba(var(--accent-rgb), 0.06); border-color: var(--accent-fill); }

.gate-banner {
    background: rgba(var(--accent-rgb), 0.08);
    border-bottom: 1px solid var(--border);
    border-left: 2px solid var(--accent-fill);
}

.nest-progress { background: var(--bg-canvas); border: 1px solid var(--border); }
.progress-content h3 { font-family: var(--font-display); font-weight: 500; }
.live-bar { background: var(--border); }
.live-bar > div { background: var(--accent-fill); }
.live-stats { font-family: var(--font-mono); }


.empty-state h3 { font-family: var(--font-display); font-weight: 500; font-size: 28px; }

/* ---- Modals ------------------------------------------------------------- */
.upsell-modal,
.gallery-modal {
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.upsell-modal { box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5); }
.upsell-hero { border-bottom: 1px solid var(--border); }
.upsell-pill {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 10px;
}
.upsell-title { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; }
.upsell-price-amount { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.03em; }
.upsell-cta {
    background: var(--accent-fill);
    color: var(--on-accent);
    clip-path: var(--chamfer);
    box-shadow: none;
}
.upsell-cta:hover { background: var(--accent-fill-hover); color: var(--on-accent); box-shadow: none; }

/* ---- Example nests ------------------------------------------------------ */
.examples-head h2 {
    font-size: 34px;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 8px;
}
.examples-head p { font-size: 15px; margin-bottom: 0; }

.examples-grid {
    gap: 0;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.example-card {
    background: transparent;
    border: none;
    border-left: 1px solid var(--border);
    padding: 0 16px;
}
.example-card:first-child { border-left: none; padding-left: 0; }
.example-card:last-child { padding-right: 0; }
.example-card:hover { border-color: var(--border); }

.example-preview {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 12px 12px 30px;
}
.example-preview-label {
    left: 12px;
    bottom: 8px;
    font-size: 9px;
    color: var(--text-dim);
}
.example-body {
    padding: 14px 0 0;
    margin-top: 14px;
    border-top: 1px solid var(--border);
}
.example-tags { gap: 6px; }
.example-feature {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
}
.example-tags::before {
    content: "";
    width: 7px;
    height: 7px;
    background: var(--accent-fill);
    align-self: center;
    margin-right: 4px;
}
.example-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 22px;
    letter-spacing: -0.02em;
}
.example-desc { font-size: 14px; }
.example-meta { font-size: 12px; }

/* "Run this example →": an orange text link, not a filled button. */
.example-run.btn-primary {
    background: none;
    clip-path: none;
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    padding: 8px 0;
    min-height: 0;
    width: auto;
    justify-content: flex-start;
    margin-top: auto;
}
.example-run.btn-primary:hover:not(:disabled) { background: none; color: var(--accent-hover); }
.example-run .spinner { border-color: rgba(var(--accent-rgb), 0.3); border-top-color: var(--accent); }

.main > .examples { max-width: 1100px; padding: 8px 0; }
.main > .examples .examples-head h2 { font-size: 26px; }
.main > .examples .examples-head { margin-bottom: 16px; }

/* ---- Homepage ----------------------------------------------------------- */
.hero {
    position: relative;
    max-width: 1440px;
    width: 100%;
    padding: 0 0 32px;
    animation: fadeIn 0.3s ease;
}

.hero-close {
    position: absolute;
    top: -16px;
    right: -16px;
    background: none;
    border: 1px solid transparent;
    color: var(--text-dim);
    font-size: 20px;
    line-height: 1;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 2;
}
.hero-close:hover { color: var(--text); border-color: var(--border); }

.hero-welcome {
    position: relative;
    padding: 0 0 32px;
}
.hero-eyebrow {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 16px;
}
.hero-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(40px, 5vw, 72px);
    line-height: 1.02;
    letter-spacing: -0.045em;
    color: var(--text);
}
.hero-welcome-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-top: 28px;
}
.hero-sub {
    font-size: 18px;
    color: var(--text-dim);
    max-width: 60ch;
}
.hero-formats {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
}
.hero-section-head::after {
    position: absolute;
    top: 6px;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--accent-fill);
}

.hero-explore {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-dim);
}
.hero-explore a { margin-left: 10px; font-weight: 500; text-decoration: none; }

.hero-trust {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 32px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.02em;
    color: var(--text-dim);
}
.hero-trust a { color: var(--text-dim); text-decoration: none; }
.hero-trust a:hover { color: var(--text); }
.hero-trust li::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 10px;
    vertical-align: 1px;
    background: var(--accent-fill);
}

/* Video on one side, the Pro Lifetime card on the other. The video fills
   the card's height. */
.hero-showcase {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 32px;
    align-items: stretch;
    margin-top: 40px;
}
.hero-showcase > .hero-video { aspect-ratio: auto; min-height: 340px; }
.hero-showcase-solo { grid-template-columns: 1fr; }
.hero-showcase-solo > .hero-video { aspect-ratio: 16 / 9; }

/* The product-video slot (placeholder until the video is delivered). */
.hero-video {
    position: relative;
    margin: 0;
    aspect-ratio: 16 / 9;
    background: var(--bg-card);
    border: 1px solid var(--border);
    overflow: hidden;
}
.hero-video-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 25% 25%;
    opacity: 0.45;
}
.hero-video-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: var(--text);
    border-style: solid;
    border-width: 0;
}
.hero-video-corner.tl { top: 68px; left: 24px; border-top-width: 2px; border-left-width: 2px; }
.hero-video-corner.tr { top: 68px; right: 24px; border-top-width: 2px; border-right-width: 2px; }
.hero-video-corner.bl { bottom: 68px; left: 24px; border-bottom-width: 2px; border-left-width: 2px; }
.hero-video-corner.br { bottom: 68px; right: 24px; border-bottom-width: 2px; border-right-width: 2px; }
.hero-video-label,
.hero-video-foot {
    position: absolute;
    left: 24px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.hero-video-label { top: 22px; display: flex; align-items: center; gap: 12px; color: var(--text); }
.hero-video-foot { bottom: 22px; font-size: 10px; }
.hero-dot { width: 10px; height: 10px; background: var(--accent-fill); }
.hero-video-media {
    position: absolute;
    inset: 96px 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-video-media > svg,
.hero-video-media > video,
.hero-video-media > img {
    width: 100% !important;
    height: 100% !important;
    max-height: none;
    object-fit: contain;
}

/* Sections below the fold share a heading row with a rule and a marker. */
.hero-section { margin-top: 64px; }
.hero-section-head {
    position: relative;
    padding-bottom: 24px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
}
.hero-section-head::after { content: ""; top: 14px; }
.hero-section-head h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 34px;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--text);
    padding-right: 32px;
}

/* Price comparison */
.hero-compare-cols {
    display: grid;
    grid-template-columns: 416fr 416fr 416fr;
    gap: 0;
}
.hero-compare-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 24px 24px;
    border-left: 1px solid var(--border);
}
.hero-compare-col:first-child { border-left: none; }
.hero-compare-us {
    border-top: 3px solid var(--accent-fill);
    border-bottom: 1px solid var(--border);
    padding-left: 24px;
}
.hero-compare-name { font-size: 15px; font-weight: 500; color: var(--text); }
.hero-compare-us .hero-compare-name { font-size: 18px; }
.hero-compare-price {
    font-family: var(--font-display);
    font-size: 48px;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text);
}
.hero-compare-us .hero-compare-price { color: var(--accent); font-size: 52px; letter-spacing: -0.05em; }
.hero-compare-col small { font-size: 12px; color: var(--text-dim); }
.hero-compare-us small { font-size: 13px; }
.hero-compare-foot {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-dim);
}
.hero-compare-foot a { font-size: 13px; font-weight: 500; text-decoration: none; }

/* Feature row (the design's reassurance strip) */
.hero-features {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.hero-features li { display: flex; flex-direction: column; gap: 4px; }
.hero-features strong { font-size: 14px; font-weight: 500; color: var(--text); }
.hero-features span { font-size: 12px; color: var(--text-dim); }

/* Examples inside the homepage */
.hero .examples { margin: 64px 0 0; }
.hero .examples-head {
    position: relative;
    padding-bottom: 24px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.hero .examples-head::after {
    content: "";
    position: absolute;
    top: 14px;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--accent-fill);
}

/* Plans */
.hero-pricing {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.hero-price-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 28px;
    border-top: 1px solid var(--border);
    background: transparent;
}
.hero-price-card + .hero-price-card { margin-left: 32px; }
.hero-price-featured {
    background: var(--bg-raised);
    border-top: 3px solid var(--accent);
}
.hero-price-name {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}
.hero-price-amount {
    font-family: var(--font-display);
    font-size: 60px;
    line-height: 1.05;
    letter-spacing: -0.05em;
    color: var(--text);
    margin-top: 14px;
}
.hero-price-badge {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-dim);
}
.hero-price-card ul {
    list-style: none;
    margin: 24px 0 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 15px;
    color: var(--text);
}
.hero-price-accent a,
.hero-price-card ul a { color: var(--accent); text-decoration: none; }
.hero-price-cta.btn { width: 100%; margin-top: auto; }
.hero-price-cta.btn-outline:disabled { color: var(--text-dim); cursor: default; opacity: 1; }
.hero-price-sub {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-dim);
}
.hero-price-note { margin-top: 20px; font-size: 12px; color: var(--text-dim); }

/* More about CutNest */
.hero-about-sub {
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text);
    margin: 0 0 20px;
}
.hero-steps {
    list-style: none;
    counter-reset: step;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding-bottom: 32px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
}
.hero-steps li {
    counter-increment: step;
    font-size: 14px;
    color: var(--text-dim);
    padding: 0 16px;
    border-left: 1px solid var(--border);
}
.hero-steps li:first-child { padding-left: 0; border-left: none; }
.hero-steps li::before {
    content: counter(step, decimal-leading-zero);
    display: inline-block;
    width: 32px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
}
.hero-steps li::before { float: left; line-height: 24px; }
.hero-steps strong {
    display: block;
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}
.hero-machines {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 40px;
}
.hero-machines a { text-decoration: none; }
.hero-about-q {
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}
.hero-faq { border-bottom: 1px solid var(--border); }
.hero-faq summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 15px 0;
    font-family: var(--font-display);
    font-size: 17px;
    color: var(--text);
    cursor: pointer;
}
.hero-faq summary::-webkit-details-marker { display: none; }
.hero-faq summary::after {
    content: "+";
    font-family: var(--font-body);
    font-size: 18px;
    color: var(--text-dim);
}
.hero-faq[open] summary::after { content: "\2212"; }
.hero-faq p {
    padding: 0 0 18px;
    max-width: 80ch;
    font-size: 14px;
    color: var(--text-dim);
}

/* ---- Footer ------------------------------------------------------------- */
.app > footer {
    border-top: 1px solid var(--border) !important;
    padding: 24px 64px !important;
}
.app > footer > span {
    font-family: var(--font-mono);
    font-size: 11px !important;
}
.footer-nav a {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
}
.footer-nav a:hover { color: var(--accent); }

/* ---- Content pages (.mk, .page-wrap, auth) ----------------------------- */
.page-title,
.mk h1 {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.035em;
}
.mk h2,
.mk h3 { font-family: var(--font-display); font-weight: 500; }
.mk-card {
    background: var(--bg-card);
    border-color: var(--border);
}
a.mk-card-link:hover { border-color: var(--accent); }
.mk-table th {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.mk-table td.ours { background: rgba(var(--accent-rgb), 0.06); }
.mk-faq summary { font-family: var(--font-display); }
.mk-crumbs { font-family: var(--font-mono); font-size: 11px; }

/* ---- Small screens ------------------------------------------------------ */
@media (max-width: 1180px) {
    header, header.topbar { padding: 0 24px; }
    .topnav { margin-left: 8px; }
    .topnav a { padding: 0 10px; }
    .topnav a.is-active::after { left: 10px; right: 10px; }
    .app > footer { padding: 20px 24px !important; }
}

@media (max-width: 1180px) {
    .hero-showcase { grid-template-columns: 1fr; }
    .hero-showcase > .hero-video { aspect-ratio: 16 / 9; min-height: 0; }
}

@media (max-width: 960px) {
    .topnav { display: none; }
    .hero-compare-cols { grid-template-columns: 1fr; }
    .hero-compare-col { border-left: none; border-top: 1px solid var(--border); padding-left: 0; }
    .hero-compare-us { padding-left: 16px; }
    .hero-features { grid-template-columns: 1fr 1fr; }
    .hero-pricing { grid-template-columns: 1fr; }
    .hero-price-card + .hero-price-card { margin: 24px 0 0; }
    .hero-steps { grid-template-columns: 1fr; gap: 20px; }
    .hero-steps li { padding: 0; border-left: none; }
    .example-card,
    .example-card:first-child { border-left: none; padding: 0 0 24px; }
}

@media (max-width: 900px) {
    .main { padding: 24px 16px; }
    .sidebar { padding: 16px; }
}

@media (max-width: 600px) {
    header, header.topbar { height: 64px; padding: 0 16px; gap: 12px; }
    .plan-badge { display: none; }
    .brand .logo { height: 22px; }
    .topbar-right { gap: 2px; }
    .topnav-link { padding: 0 8px; font-size: 12px; }
    .hero-welcome-foot { flex-direction: column; align-items: flex-start; }
    .hero-showcase > .hero-video { aspect-ratio: 4 / 3; }
    .hero-video-media { inset: 72px 32px; }
    .hero-video-corner.tl, .hero-video-corner.tr { top: 52px; }
    .hero-video-corner.bl, .hero-video-corner.br { bottom: 52px; }
    .hero-section-head h2, .examples-head h2 { font-size: 26px; }
    .hero-features { grid-template-columns: 1fr; }
    .hero-compare-price { font-size: 40px; }
    .hero-price-amount { font-size: 48px; }
    .app > footer { padding: 20px 16px !important; }
}

@media (prefers-reduced-motion: reduce) {
    .hero, .main > .examples { animation: none; }
}

/* ---- Toast (Figma "Toast / Trial confirmation") ------------------------ */
.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 200;
    width: min(592px, calc(100vw - 32px));
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-fill);
    padding: 24px 24px 24px 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
    animation: fadeIn 0.25s ease;
    font-size: 13px;
    color: var(--text);
}
.toast p + p { margin-top: 8px; }
.toast-title {
    font-size: 20px;
    font-weight: 500;
    margin: 0 32px 16px 0;
}
.toast-meta { color: var(--text-dim); font-size: 12px; margin-top: 14px !important; }
.toast-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.toast-close:hover { color: var(--text); }
.toast-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.toast-actions .btn { width: auto; min-width: 96px; min-height: 40px; }
.toast-actions .btn-primary { min-width: 200px; }
.hero-eyebrow { padding-right: 40px; }

/* A .form-row's groups are each a :last-child, so the row carries the gap. */
.sidebar .form-row { margin-bottom: 12px; }
.sidebar .form-row:last-child { margin-bottom: 0; }
.sidebar .form-row > .form-group { margin-bottom: 0; }

@media (max-width: 480px) {
    header, header.topbar { padding: 0 12px; gap: 8px; }
    .brand .logo { height: 20px; }
    .topnav-link { padding: 0 6px; font-size: 11px; }
    .topbar-right .btn-sm { padding: 6px 10px; font-size: 11px; min-height: 30px; }
}
