:root {
    color-scheme: light;
    --ink: #15161a;
    --muted: #58606c;
    --paper: #f3f8fb;
    --surface: #ffffff;
    --soft: #eef6f4;
    --line: #cbd7df;
    --blue: #0078d4;
    --cyan: #00a8c6;
    --green: #008f68;
    --coral: #e5484d;
    --yellow: #f5c542;
    --lime: #8cc63f;
    --shadow: 0 20px 50px rgba(21, 22, 26, 0.14);
    --panel-shadow: 0 12px 30px rgba(21, 22, 26, 0.1);
    --chroma-shadow: 6px 6px 0 rgba(229, 72, 77, 0.94), 11px 11px 0 rgba(0, 168, 198, 0.8), var(--shadow);
    --chroma-shadow-small: 4px 4px 0 rgba(245, 197, 66, 0.96), 8px 8px 0 rgba(0, 168, 198, 0.74), var(--panel-shadow);
    --retro-grid: repeating-linear-gradient(90deg, rgba(0, 168, 198, 0.09) 0 1px, transparent 1px 34px),
        repeating-linear-gradient(0deg, rgba(229, 72, 77, 0.07) 0 1px, transparent 1px 34px);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    background:
        linear-gradient(135deg, rgba(0, 168, 198, 0.22) 0 14%, transparent 14% 100%),
        linear-gradient(315deg, rgba(229, 72, 77, 0.18) 0 13%, transparent 13% 100%),
        linear-gradient(42deg, transparent 0 58%, rgba(245, 197, 66, 0.18) 58% 61%, transparent 61% 100%),
        linear-gradient(132deg, transparent 0 66%, rgba(0, 143, 104, 0.14) 66% 69%, transparent 69% 100%),
        var(--retro-grid),
        var(--paper);
    background-size: auto, auto, auto, auto, 34px 34px, 34px 34px, auto;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    font: inherit;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0 auto;
    padding: 16px;
}

.topbar {
    position: sticky;
    top: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 14px 14px 16px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, var(--yellow) 0 18%, var(--green) 18% 35%, var(--cyan) 35% 56%, var(--coral) 56% 78%, var(--blue) 78% 100%) left bottom / 100% 5px no-repeat,
        rgba(255, 255, 255, 0.9);
    /*box-shadow: var(--chroma-shadow-small);*/
    backdrop-filter: blur(16px);
}

.home-page .topbar {
    margin-bottom: 26px;
    padding: 16px 26px 28px 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, var(--yellow) 0 24%, var(--green) 24% 44%, var(--cyan) 44% 64%, var(--coral) 64% 82%, var(--blue) 82% 100%) left bottom / 100% 8px no-repeat,
        #ffffff;
    font-weight: 900;
    text-shadow:
        1px 0 0 rgba(0, 168, 198, 0.48),
        -1px 0 0 rgba(229, 72, 77, 0.48),
        0 1px 0 rgba(255, 255, 255, 0.42);
}

.brand-copy {
    display: grid;
    gap: 1px;
    line-height: 1;
}

.brand-copy strong {
    font-size: 0.94rem;
    letter-spacing: 0.075em;
}

.brand-copy small {
    color: var(--muted);
    font-size: 0.48rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 28px;
    min-width: 28px;
    height: 28px;
    border: 2px solid var(--ink);
    border-radius: 6px;
    background:
        linear-gradient(135deg, var(--ink) 0 56%, var(--coral) 56% 70%, var(--cyan) 70% 100%);
    color: #ffffff;
    font-size: 0.78rem;
    line-height: 1;
}

.home-page .brand {
    min-height: 52px;
    padding: 0 18px;
    background:
        linear-gradient(90deg, var(--yellow) 0 20%, var(--green) 20% 42%, var(--cyan) 42% 64%, var(--coral) 64% 84%, var(--blue) 84% 100%) left bottom / 100% 10px no-repeat,
        #ffffff;
    font-size: 1.24rem;
    box-shadow: var(--chroma-shadow);
}

.home-page .brand-copy strong {
    font-size: 1.08rem;
}

.home-page .brand-copy small {
    font-size: 0.54rem;
}

.home-page .brand-mark {
    width: 34px;
    min-width: 34px;
    height: 34px;
    font-size: 0.9rem;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-weight: 700;
}

.topbar nav a {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, color 140ms ease;
}

.topbar nav a:hover {
    border-color: var(--ink);
    background: var(--ink);
    color: #ffffff;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--cyan);
}

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

.account-nav span,
.account-nav a,
.account-nav button {
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-weight: 900;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, color 140ms ease;
}

.account-nav .kofi-link {
    min-height: 42px;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
}

.account-nav .kofi-link img {
    display: block;
    width: auto;
    height: 42px;
    border: 0;
}

.account-nav .kofi-link img[hidden],
.home-support-note img[hidden] {
    display: none;
}

.kofi-fallback {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font-weight: 900;
}

.kofi-fallback[hidden] {
    display: none;
}

.account-nav span {
    background: #fff3cf;
}

.account-tier-chip {
    border-width: 2px !important;
    background: #ffffff !important;
    color: var(--ink) !important;
    box-shadow: 3px 3px 0 var(--ink);
}

.account-tier-chip-0 {
    border-color: var(--line) !important;
    background: #f4f6f8 !important;
    color: var(--muted) !important;
    box-shadow: none;
}

.account-tier-chip-1 {
    border-color: rgba(0, 143, 104, 0.34) !important;
    background:
        linear-gradient(90deg, rgba(140, 198, 63, 0.22), rgba(0, 168, 198, 0.12)),
        #ffffff !important;
    color: var(--green) !important;
    box-shadow: 3px 3px 0 var(--lime), 6px 6px 0 var(--ink);
}

.account-tier-chip-2 {
    border-color: rgba(229, 72, 77, 0.34) !important;
    background:
        linear-gradient(90deg, rgba(229, 72, 77, 0.18), rgba(0, 168, 198, 0.16), rgba(245, 197, 66, 0.16)),
        #ffffff !important;
    color: var(--coral) !important;
    box-shadow: 3px 3px 0 var(--coral), 6px 6px 0 var(--cyan), 9px 9px 0 var(--ink);
}

.account-tier-chip-3 {
    border-color: rgba(245, 197, 66, 0.48) !important;
    background:
        radial-gradient(circle at top right, rgba(245, 197, 66, 0.38), transparent 35%),
        linear-gradient(90deg, rgba(245, 197, 66, 0.16), rgba(0, 168, 198, 0.16), rgba(0, 143, 104, 0.16)),
        #fffef6 !important;
    color: #8e5c00 !important;
    box-shadow: 3px 3px 0 var(--yellow), 6px 6px 0 var(--cyan), 9px 9px 0 var(--ink);
}

.account-nav button {
    cursor: pointer;
}

.account-nav a:hover,
.account-nav button:hover {
    border-color: var(--ink);
    background: var(--ink);
    color: #ffffff;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--yellow);
}

.account-nav .kofi-link:hover,
.account-nav .kofi-link:focus-visible {
    background: transparent;
    box-shadow: 4px 4px 0 var(--yellow);
}

.account-nav form {
    margin: 0;
}

.flash-stack {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.flash-stack p {
    margin: 0;
    padding: 12px 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.34), rgba(0, 168, 198, 0.18)),
        #ffffff;
    color: var(--ink);
    font-weight: 900;
    box-shadow: var(--panel-shadow);
}

.site-footer {
    display: grid;
    grid-template-columns: minmax(180px, auto) minmax(0, 1fr);
    align-items: start;
    justify-content: space-between;
    gap: 18px;
    margin-top: 28px;
    padding: 18px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--chroma-shadow-small);
}

.footer-brand {
    display: grid;
    gap: 5px;
}

.footer-brand strong {
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 900;
}

.footer-brand p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
    line-height: 1.4;
}

.footer-link-groups {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.footer-primary-links a {
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, color 140ms ease;
}

.footer-primary-links a:hover {
    border-color: var(--ink);
    background: var(--ink);
    color: #ffffff;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--coral);
}

.footer-utility-links {
    align-items: center;
}

.footer-utility-links a,
.footer-utility-links button {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 3px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.footer-utility-links a:hover,
.footer-utility-links button:hover,
.footer-utility-links a:focus-visible,
.footer-utility-links button:focus-visible {
    color: var(--ink);
    background: transparent;
    outline: 2px solid var(--yellow);
    outline-offset: 3px;
}

.cookie-consent {
    position: fixed;
    right: clamp(12px, 3vw, 28px);
    bottom: clamp(12px, 3vw, 28px);
    z-index: 1000;
    display: grid;
    width: min(620px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: auto;
    gap: 14px;
    padding: 18px;
    border: 3px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.24), rgba(0, 168, 198, 0.18)),
        #ffffff;
    box-shadow: 8px 8px 0 var(--coral), 14px 14px 0 var(--ink);
}

.cookie-consent-open {
    padding-bottom: min(260px, 30vh);
}

.cookie-consent[hidden] {
    display: none;
}

.cookie-consent-copy {
    display: grid;
    gap: 8px;
}

.cookie-consent h2,
.cookie-consent p {
    margin: 0;
}

.cookie-consent h2 {
    font-size: 1.25rem;
}

.cookie-consent-copy p:not(.eyebrow) {
    color: var(--ink);
    font-weight: 800;
    line-height: 1.45;
}

.cookie-consent-preferences {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.cookie-consent-preferences[hidden],
.cookie-consent-actions button[hidden] {
    display: none;
}

.cookie-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cookie-consent-actions button {
    min-height: 40px;
    padding: 8px 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, color 140ms ease;
}

.cookie-consent-actions button:first-child {
    background: var(--green);
    color: #ffffff;
}

.cookie-consent-actions button:nth-child(2) {
    background: var(--coral);
    color: #ffffff;
}

.cookie-consent-actions button:hover,
.cookie-consent-actions button:focus-visible {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--yellow);
}

.auth-page {
    display: grid;
    place-items: start center;
    min-height: 62vh;
}

.auth-panel {
    display: grid;
    width: min(620px, 100%);
    gap: 22px;
    padding: clamp(22px, 4vw, 42px);
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(245, 197, 66, 0.28), transparent 46%),
        linear-gradient(315deg, rgba(0, 168, 198, 0.2), transparent 48%),
        #ffffff;
    box-shadow: var(--chroma-shadow);
}

.auth-panel h1 {
    margin: 0;
    font-size: clamp(2.2rem, 6vw, 4rem);
    line-height: 0.95;
}

.auth-panel p {
    margin: 10px 0 0;
    color: var(--muted);
    font-weight: 800;
    line-height: 1.45;
}

.auth-form {
    display: grid;
    gap: 10px;
}

.auth-form label {
    color: var(--ink);
    font-weight: 900;
}

.auth-form input,
.auth-form select {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-weight: 800;
}

.auth-form select {
    appearance: none;
    background:
        linear-gradient(45deg, transparent 50%, var(--ink) 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
        linear-gradient(135deg, var(--ink) 50%, transparent 50%) calc(100% - 12px) 50% / 7px 7px no-repeat,
        #ffffff;
}

.auth-form button {
    min-height: 52px;
    margin-top: 8px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--green);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    box-shadow: 5px 5px 0 var(--yellow), 9px 9px 0 var(--ink);
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.auth-form button:hover {
    background: var(--blue);
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--coral), 12px 12px 0 var(--ink);
}

.auth-form button[aria-busy="true"],
.download-button[aria-busy="true"] {
    cursor: wait;
    opacity: 0.92;
}

.bulk-uploader-cancel-button {
    min-height: 52px;
    padding: 0 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--coral);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    box-shadow: 5px 5px 0 rgba(21, 22, 26, 0.18), 9px 9px 0 var(--ink);
    transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.bulk-uploader-recover-button {
    min-height: 52px;
    padding: 0 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #fff3cf;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    box-shadow: 5px 5px 0 rgba(21, 22, 26, 0.12), 9px 9px 0 var(--ink);
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.bulk-uploader-skip-button,
.bulk-uploader-retry-button,
.bulk-uploader-retry-pbr-button {
    min-height: 34px;
    padding: 0 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 900;
}

.bulk-uploader-skip-button {
    background: #ffffff;
    color: var(--coral);
}

.bulk-uploader-retry-button,
.bulk-uploader-retry-pbr-button {
    min-height: 34px;
    box-shadow: none !important;
}

.bulk-uploader-skip-button:disabled,
.bulk-uploader-retry-button:disabled,
.bulk-uploader-retry-pbr-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.bulk-uploader-cancel-button:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 rgba(21, 22, 26, 0.18), 12px 12px 0 var(--ink);
}

.bulk-uploader-recover-button:hover,
.bulk-uploader-recover-button:focus-visible {
    background: #ffe29e;
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 rgba(21, 22, 26, 0.16), 12px 12px 0 var(--ink);
}

.bulk-uploader-cancel-button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
    box-shadow: none;
}

.auth-switch a {
    color: var(--blue);
    font-weight: 900;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.content-page {
    display: grid;
    gap: 22px;
}

.content-hero h1 {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 5rem);
    line-height: 0.95;
}

.content-panel {
    display: grid;
    gap: 16px;
    padding: clamp(18px, 3vw, 30px);
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--panel-shadow);
}

.content-panel h2,
.content-panel p {
    margin: 0;
}

.content-panel h2 {
    font-size: 1.35rem;
}

.content-panel p {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.55;
}

.content-panel a {
    color: var(--blue);
    font-weight: 900;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.bulk-uploader-page {
    display: grid;
    gap: 22px;
}

.bulk-uploader-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.8fr);
    gap: 20px;
    align-items: stretch;
    background:
        linear-gradient(135deg, rgba(0, 168, 198, 0.16), transparent 42%),
        linear-gradient(315deg, rgba(245, 197, 66, 0.18), transparent 56%),
        #ffffff;
}

.bulk-uploader-hero-copy {
    display: grid;
    gap: 10px;
}

.bulk-uploader-status {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 18px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 5px 5px 0 var(--ink);
}

.bulk-uploader-status span,
.bulk-uploader-capability-grid span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bulk-uploader-status strong,
.bulk-uploader-capability-grid strong {
    color: var(--ink);
    font-size: 1.35rem;
    line-height: 1.05;
}

.bulk-uploader-status p,
.bulk-uploader-capability-grid p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.bulk-uploader-status-tier-0 {
    background:
        linear-gradient(135deg, rgba(203, 215, 223, 0.46), transparent 50%),
        linear-gradient(315deg, rgba(245, 197, 66, 0.2), transparent 62%),
        #ffffff;
}

.bulk-uploader-status-tier-0 strong {
    color: var(--muted);
}

.bulk-uploader-status-tier-1 {
    background:
        linear-gradient(135deg, rgba(140, 198, 63, 0.24), transparent 46%),
        linear-gradient(315deg, rgba(0, 168, 198, 0.16), transparent 58%),
        #ffffff;
    box-shadow: 5px 5px 0 var(--lime), 10px 10px 0 var(--ink);
}

.bulk-uploader-status-tier-1 strong,
.bulk-uploader-status-tier-1 span {
    color: var(--green);
}

.bulk-uploader-status-tier-2 {
    background:
        linear-gradient(135deg, rgba(229, 72, 77, 0.18), transparent 40%),
        linear-gradient(315deg, rgba(0, 168, 198, 0.16), transparent 54%),
        linear-gradient(90deg, rgba(245, 197, 66, 0.16), transparent 100%),
        #ffffff;
    box-shadow: 5px 5px 0 var(--coral), 10px 10px 0 var(--cyan), 14px 14px 0 var(--ink);
}

.bulk-uploader-status-tier-2 strong,
.bulk-uploader-status-tier-2 span {
    color: var(--coral);
}

.bulk-uploader-status-tier-3 {
    background:
        radial-gradient(circle at top right, rgba(245, 197, 66, 0.34), transparent 34%),
        linear-gradient(135deg, rgba(0, 143, 104, 0.18), transparent 42%),
        linear-gradient(315deg, rgba(0, 168, 198, 0.16), transparent 54%),
        #fffef6;
    box-shadow: 5px 5px 0 var(--yellow), 10px 10px 0 var(--cyan), 14px 14px 0 var(--ink);
}

.bulk-uploader-status-tier-3 strong,
.bulk-uploader-status-tier-3 span {
    color: #8e5c00;
}

.bulk-uploader-capability-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.bulk-uploader-capability-grid article {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(237, 248, 246, 0.98));
    box-shadow: var(--chroma-shadow-small);
}

.bulk-uploader-shell,
.bulk-uploader-staged {
    gap: 18px;
}

.bulk-uploader-shell-heading {
    align-items: start;
}

.bulk-uploader-form {
    gap: 16px;
}

.bulk-uploader-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 14px;
}

.bulk-uploader-form-grid-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bulk-uploader-form .control-row {
    display: grid;
    gap: 8px;
}

.bulk-uploader-form .control-row small,
.bulk-uploader-gated p {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.45;
}

.bulk-uploader-pipeline-panel,
.bulk-uploader-plan-panel {
    gap: 12px;
}

.bulk-uploader-review-panel,
.bulk-uploader-review-form {
    display: grid;
    gap: 14px;
}

.bulk-uploader-review-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.bulk-uploader-review-heading h3,
.bulk-uploader-review-heading p {
    margin: 0;
}

.bulk-uploader-review-summary {
    margin-top: 4px;
}

.bulk-uploader-review-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.bulk-uploader-review-toggle,
.bulk-uploader-result-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 900;
}

.bulk-uploader-result-select {
    justify-self: start;
}

.bulk-uploader-review-badge {
    border: 2px solid var(--ink);
    border-radius: 999px;
    padding: 4px 10px;
    background: #f4fff1;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bulk-uploader-review-badge-pending {
    background: #fff8d8;
    color: #8e5c00;
}

.bulk-uploader-review-badge-deleted {
    background: #ffe4e5;
    color: #a81d22;
}

.bulk-uploader-result-row-deleted {
    opacity: 0.74;
}

.bulk-uploader-live-status {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(0, 168, 198, 0.16), rgba(245, 197, 66, 0.16)),
        #ffffff;
}

.bulk-uploader-live-status[hidden] {
    display: none;
}

.bulk-uploader-file-preview {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.18), rgba(0, 168, 198, 0.12)),
        #ffffff;
}

.bulk-uploader-file-count {
    margin: 0;
    color: var(--ink);
    font-weight: 900;
}

.bulk-uploader-file-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    font-weight: 800;
}

.bulk-uploader-action-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bulk-uploader-progress-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.bulk-uploader-progress-meta strong,
.bulk-uploader-item-progress strong {
    color: var(--ink);
    font-size: 0.96rem;
    font-weight: 900;
}

.bulk-uploader-progress-meta span,
.bulk-uploader-item-progress small {
    color: var(--muted);
    font-weight: 800;
}

.bulk-uploader-progress-track {
    position: relative;
    overflow: hidden;
    height: 12px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: #edf2f6;
}

.bulk-uploader-progress-fill {
    display: block;
    height: 100%;
    width: 0;
    background:
        linear-gradient(90deg, var(--yellow), var(--cyan));
    transition: width 220ms ease;
}

.bulk-uploader-progress-fill[data-status="running"] {
    background:
        linear-gradient(90deg, var(--yellow), var(--cyan));
}

.bulk-uploader-progress-fill[data-status="completed"] {
    background:
        linear-gradient(90deg, var(--lime), var(--green));
}

.bulk-uploader-progress-fill[data-status="failed"] {
    background:
        linear-gradient(90deg, var(--coral), #a81d22);
}

.bulk-uploader-progress-fill[data-status="timeout"] {
    background:
        linear-gradient(90deg, #ff9155, var(--yellow));
}

.bulk-uploader-progress-fill[data-status="canceled"] {
    background:
        linear-gradient(90deg, #7b6cff, #4f95ff);
}

.bulk-uploader-progress-fill[data-status="queued"],
.bulk-uploader-progress-fill[data-status="idle"] {
    background:
        linear-gradient(90deg, #d3d9df, #adb8c4);
}

.bulk-uploader-item-progress {
    display: grid;
    gap: 6px;
    min-width: 210px;
}

.bulk-uploader-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bulk-uploader-item-actions form[hidden] {
    display: none;
}

.bulk-uploader-timeout-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 4px 8px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: #fff0d9;
    color: #9a4d00;
    font-size: 0.78rem;
    font-weight: 900;
}

.bulk-uploader-action-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 900;
}

.bulk-uploader-action-tags-inline {
    min-width: 220px;
}

.bulk-uploader-run-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bulk-uploader-run-actions form {
    margin: 0;
}

.bulk-uploader-manifest-button {
    width: fit-content;
    min-width: 260px;
}

.bulk-uploader-staged-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.bulk-uploader-staged-summary article {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
}

.bulk-uploader-staged-summary span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bulk-uploader-staged-summary strong {
    color: var(--ink);
    line-height: 1.2;
}

.bulk-uploader-run-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.bulk-uploader-result-card > strong {
    font-size: 1.15rem;
    line-height: 1.1;
}

.bulk-uploader-result-list {
    display: grid;
    gap: 10px;
}

.bulk-uploader-result-row {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
}

.bulk-uploader-result-row strong {
    color: var(--ink);
    line-height: 1.1;
}

.bulk-uploader-result-row a {
    color: var(--blue);
    font-weight: 900;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.bulk-uploader-result-row small {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.4;
}

.bulk-uploader-result-row-ok {
    background:
        linear-gradient(90deg, rgba(140, 198, 63, 0.18), rgba(0, 168, 198, 0.08)),
        #ffffff;
}

.bulk-uploader-result-row-error {
    background:
        linear-gradient(90deg, rgba(229, 72, 77, 0.18), rgba(245, 197, 66, 0.12)),
        #ffffff;
}

.bulk-uploader-result-row-timeout {
    background:
        linear-gradient(90deg, rgba(255, 145, 85, 0.18), rgba(245, 197, 66, 0.16)),
        #ffffff;
}

.bulk-uploader-roadmap-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    font-weight: 800;
    line-height: 1.55;
}

.contact-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.75fr);
    align-items: start;
}

.contact-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.auth-form textarea {
    width: 100%;
    min-height: 160px;
    padding: 12px 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-weight: 800;
    resize: vertical;
}

.contact-aside {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.24), rgba(0, 168, 198, 0.16)),
        #ffffff;
}

.contact-aside h2,
.contact-aside p {
    margin: 0;
}

.account-settings-panel {
    width: min(760px, 100%);
}

.account-settings-section {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
}

.account-settings-section h2 {
    margin: 0;
    font-size: 1.3rem;
}

.account-settings-section p {
    margin: 0;
}

.account-subscription {
    position: relative;
    overflow: hidden;
    gap: 18px;
    padding: 18px;
    background:
        linear-gradient(135deg, rgba(245, 197, 66, 0.22), transparent 46%),
        linear-gradient(315deg, rgba(0, 168, 198, 0.16), transparent 50%),
        #ffffff;
    box-shadow: var(--panel-shadow);
}

.account-subscription::after {
    content: "";
    position: absolute;
    right: -18px;
    bottom: -28px;
    width: 150px;
    height: 150px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.28);
    transform: rotate(18deg);
    pointer-events: none;
}

.account-subscription-head {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(180px, 0.7fr);
    gap: 16px;
    align-items: start;
}

.account-subscription-copy {
    display: grid;
    gap: 8px;
}

.account-subscription-copy p {
    max-width: 52ch;
}

.account-subscription-badge {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 6px;
    justify-items: start;
    padding: 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 4px 4px 0 var(--ink);
}

.account-subscription-tier-label,
.account-subscription-metrics span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.account-subscription-badge strong {
    font-size: 1.5rem;
    line-height: 1;
}

.account-subscription-badge small,
.account-subscription-metrics small {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.4;
}

.account-subscription-metrics {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.account-subscription-metrics article {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
}

.account-subscription-metrics strong {
    font-size: 1.08rem;
    line-height: 1.1;
}

.account-subscription-feature-list {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.account-subscription-feature-list li {
    min-height: 100%;
    padding: 12px 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    font-weight: 800;
    line-height: 1.45;
    box-shadow: 3px 3px 0 rgba(21, 22, 26, 0.14);
}

.account-capability-matrix {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
}

.account-capability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.account-capability-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 4px 4px 0 rgba(21, 22, 26, 0.12);
}

.account-capability-card strong,
.account-capability-card p,
.account-capability-card small {
    margin: 0;
}

.account-capability-tier {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.account-capability-mono {
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    font-weight: 900;
}

.account-capability-card-active {
    box-shadow: 5px 5px 0 var(--yellow), 10px 10px 0 var(--ink);
    transform: translate(-2px, -2px);
}

.account-capability-card-tier-0 {
    background:
        linear-gradient(135deg, rgba(203, 215, 223, 0.42), transparent 44%),
        #ffffff;
}

.account-capability-card-tier-1 {
    background:
        linear-gradient(135deg, rgba(140, 198, 63, 0.22), transparent 42%),
        linear-gradient(315deg, rgba(0, 168, 198, 0.14), transparent 54%),
        #ffffff;
}

.account-capability-card-tier-2 {
    background:
        linear-gradient(135deg, rgba(229, 72, 77, 0.18), transparent 40%),
        linear-gradient(315deg, rgba(0, 168, 198, 0.14), transparent 50%),
        #ffffff;
}

.account-capability-card-tier-3 {
    background:
        radial-gradient(circle at top right, rgba(245, 197, 66, 0.34), transparent 30%),
        linear-gradient(135deg, rgba(0, 143, 104, 0.16), transparent 42%),
        #fffdf4;
}

.account-subscription-tier-0 {
    background:
        linear-gradient(135deg, rgba(203, 215, 223, 0.5), transparent 44%),
        linear-gradient(315deg, rgba(245, 197, 66, 0.2), transparent 54%),
        #ffffff;
}

.account-subscription-tier-0 .eyebrow,
.account-subscription-tier-0 .account-subscription-badge strong {
    color: var(--muted);
}

.account-subscription-tier-1 {
    background:
        linear-gradient(135deg, rgba(140, 198, 63, 0.24), transparent 42%),
        linear-gradient(315deg, rgba(0, 168, 198, 0.22), transparent 54%),
        #ffffff;
    box-shadow: 6px 6px 0 rgba(140, 198, 63, 0.32), var(--panel-shadow);
}

.account-subscription-tier-1 .account-subscription-badge {
    box-shadow: 4px 4px 0 var(--lime), 8px 8px 0 var(--ink);
}

.account-subscription-tier-1 .account-subscription-badge strong,
.account-subscription-tier-1 .eyebrow {
    color: var(--green);
}

.account-subscription-tier-2 {
    background:
        linear-gradient(135deg, rgba(229, 72, 77, 0.22), transparent 38%),
        linear-gradient(315deg, rgba(0, 168, 198, 0.24), transparent 48%),
        linear-gradient(90deg, rgba(245, 197, 66, 0.16), transparent 72%),
        #ffffff;
    box-shadow: 6px 6px 0 rgba(229, 72, 77, 0.42), 12px 12px 0 rgba(0, 168, 198, 0.24), var(--panel-shadow);
}

.account-subscription-tier-2 .account-subscription-badge {
    box-shadow: 5px 5px 0 var(--coral), 10px 10px 0 var(--cyan), 14px 14px 0 var(--ink);
}

.account-subscription-tier-2 .account-subscription-badge strong,
.account-subscription-tier-2 .eyebrow {
    color: var(--coral);
}

.account-subscription-tier-3 {
    background:
        radial-gradient(circle at top right, rgba(245, 197, 66, 0.42), transparent 30%),
        linear-gradient(135deg, rgba(0, 143, 104, 0.22), transparent 36%),
        linear-gradient(315deg, rgba(0, 168, 198, 0.24), transparent 50%),
        linear-gradient(90deg, rgba(229, 72, 77, 0.18), transparent 74%),
        #fffdf4;
    box-shadow: 6px 6px 0 var(--yellow), 12px 12px 0 var(--cyan), 18px 18px 0 var(--ink);
}

.account-subscription-tier-3::before {
    content: "";
    position: absolute;
    top: 14px;
    right: 18px;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 197, 66, 0.4) 0, rgba(245, 197, 66, 0) 68%);
    pointer-events: none;
}

.account-subscription-tier-3 .account-subscription-badge {
    box-shadow: 6px 6px 0 var(--yellow), 12px 12px 0 var(--cyan), 16px 16px 0 var(--ink);
}

.account-subscription-tier-3 .account-subscription-badge strong,
.account-subscription-tier-3 .eyebrow {
    color: #8e5c00;
}

.account-danger-zone {
    background:
        linear-gradient(90deg, rgba(229, 72, 77, 0.16), rgba(245, 197, 66, 0.18)),
        #ffffff;
}

.account-danger-zone .auth-form button {
    background: var(--coral);
}

.account-danger-zone .auth-form button:hover {
    background: var(--ink);
}

.admin-page {
    display: grid;
    gap: 22px;
}

.admin-hero {
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.28), transparent 36%),
        linear-gradient(135deg, rgba(0, 168, 198, 0.2), transparent 58%),
        #ffffff;
}

.admin-stat-grid,
.admin-tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.admin-stat-grid article,
.admin-tool-grid a,
.admin-table-panel {
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--chroma-shadow-small);
}

.admin-stat-grid article {
    display: grid;
    gap: 10px;
    padding: 20px;
}

.admin-stat-grid span,
.admin-tool-grid span {
    color: var(--coral);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-stat-grid strong {
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 0.9;
}

.admin-stat-grid small,
.admin-tool-grid small {
    color: var(--muted);
    font-weight: 800;
}

.admin-tool-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.admin-tool-grid a {
    display: grid;
    gap: 10px;
    padding: 22px;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.admin-tool-grid a:hover,
.admin-tool-grid a:focus-visible {
    background: #fff9e8;
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 var(--coral), 14px 14px 0 var(--cyan), var(--shadow);
}

.admin-tool-grid strong {
    font-size: 1.4rem;
}

.admin-section-heading,
.admin-panel-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.admin-section-heading h2,
.admin-panel-header h2 {
    margin: 0;
}

.admin-note {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.admin-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-subnav a {
    min-height: 40px;
    padding: 8px 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font-weight: 900;
}

.admin-subnav a[aria-current="page"],
.admin-subnav a:hover,
.admin-subnav a:focus-visible {
    background: var(--green);
    color: #ffffff;
    box-shadow: 4px 4px 0 var(--yellow);
}

.admin-table-panel {
    overflow: hidden;
    padding: 0;
}

.admin-panel-header {
    padding: 18px 20px 0;
}

.admin-analytics-overview {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.admin-analytics-overview article {
    min-height: 164px;
}

.admin-analytics-overview .admin-metric-text {
    font-size: clamp(1.5rem, 2.6vw, 2.2rem);
    line-height: 1.05;
    word-break: break-word;
}

.admin-analytics-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-table-scroll {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    background: #fff3cf;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-table td {
    color: var(--muted);
    font-weight: 800;
}

.admin-table td strong {
    color: var(--ink);
}

.admin-mono {
    font-family: "Courier New", Courier, monospace;
}

.admin-empty-cell {
    color: var(--muted);
    font-style: italic;
}

.admin-table tr:last-child td {
    border-bottom: 0;
}

.admin-table form {
    margin: 0;
}

.admin-table button {
    min-height: 38px;
    padding: 8px 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--green);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.admin-table button:hover,
.admin-table button:focus-visible {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--yellow);
}

.admin-danger-button {
    background: var(--coral) !important;
}

.admin-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin-left: 6px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
}

.admin-pill-green {
    border-color: rgba(0, 143, 104, 0.3);
    background: #e2f5f2;
    color: var(--green);
}

.admin-subscription-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 9px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 900;
}

.admin-subscription-pill-0 {
    border-color: var(--line);
    background: #f4f6f8;
    color: var(--muted);
}

.admin-subscription-pill-1 {
    background:
        linear-gradient(90deg, rgba(140, 198, 63, 0.18), rgba(0, 168, 198, 0.1)),
        #ffffff;
    color: var(--green);
    box-shadow: 3px 3px 0 rgba(140, 198, 63, 0.34);
}

.admin-subscription-pill-2 {
    background:
        linear-gradient(90deg, rgba(229, 72, 77, 0.16), rgba(0, 168, 198, 0.14), rgba(245, 197, 66, 0.14)),
        #ffffff;
    color: var(--coral);
    box-shadow: 3px 3px 0 rgba(0, 168, 198, 0.28);
}

.admin-subscription-pill-3 {
    background:
        radial-gradient(circle at top right, rgba(245, 197, 66, 0.34), transparent 40%),
        linear-gradient(90deg, rgba(245, 197, 66, 0.16), rgba(0, 168, 198, 0.14)),
        #fffef6;
    color: #8e5c00;
    box-shadow: 3px 3px 0 rgba(245, 197, 66, 0.52), 6px 6px 0 rgba(0, 168, 198, 0.22);
}

.admin-muted-action {
    color: var(--muted);
    font-weight: 900;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(360px, 0.72fr) minmax(360px, 1fr);
    grid-template-areas:
        "controls preview"
        "stage stage";
    gap: 22px;
}

.palette-page {
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    grid-template-areas:
        "controls stage"
        "preview stage";
    align-items: stretch;
}

.tool-directory,
.single-tool {
    display: grid;
    gap: 22px;
}

.directory-intro {
    max-width: none;
    padding: 34px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(0, 168, 198, 0.16), transparent 44%),
        var(--surface);
    box-shadow: var(--chroma-shadow);
}

.home-hero {
    position: relative;
    display: grid;
    align-content: end;
    min-height: clamp(430px, 52vh, 620px);
    overflow: hidden;
    padding: clamp(26px, 5vw, 64px);
    background:
        linear-gradient(90deg, rgba(243, 248, 251, 0.98) 0 30%, rgba(243, 248, 251, 0.78) 52%, rgba(243, 248, 251, 0.24) 100%),
        #f3f8fb;
}

.home-hero > div,
.home-material-generator {
    position: relative;
    z-index: 2;
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(90deg, rgba(243, 248, 251, 0.95) 0 28%, rgba(243, 248, 251, 0.62) 42%, rgba(243, 248, 251, 0.16) 100%),
        linear-gradient(118deg, transparent 0 45%, rgba(245, 197, 66, 0.94) 45% 54%, transparent 54% 100%),
        linear-gradient(100deg, transparent 0 56%, rgba(229, 72, 77, 0.94) 56% 66%, transparent 66% 100%),
        linear-gradient(146deg, transparent 0 60%, rgba(0, 143, 104, 0.92) 60% 72%, transparent 72% 100%),
        linear-gradient(78deg, transparent 0 64%, rgba(0, 168, 198, 0.94) 64% 76%, transparent 76% 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(245, 197, 66, 0.22)),
        url("../img/workbench-preview.png") center / cover no-repeat;
    background-blend-mode: normal, multiply, multiply, multiply, multiply, color, normal;
}

.home-hero::after {
    content: "";
    position: absolute;
    right: clamp(18px, 4vw, 60px);
    bottom: clamp(18px, 4vw, 52px);
    z-index: 1;
    width: min(42vw, 620px);
    height: 18px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background:
        linear-gradient(90deg, var(--yellow) 0 18%, var(--green) 18% 38%, var(--cyan) 38% 58%, var(--coral) 58% 78%, var(--blue) 78% 100%);
    box-shadow: 8px 8px 0 var(--ink);
}

.home-hero .eyebrow {
    width: fit-content;
    padding: 7px 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
}

.home-hero::before,
.home-hero::after {
    pointer-events: none;
}

.home-hero::selection {
    background: var(--yellow);
}

.home-hero h1::after {
    content: "";
    display: block;
    width: min(560px, 54vw);
    height: 12px;
    margin-top: 12px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background:
        linear-gradient(90deg, var(--coral) 0 22%, var(--yellow) 22% 42%, var(--green) 42% 62%, var(--cyan) 62% 82%, var(--blue) 82% 100%);
}

.home-hero h1 {
    max-width: none;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.035em;
    text-transform: none;
    text-shadow:
        3px 0 0 rgba(0, 168, 198, 0.52),
        -3px 0 0 rgba(229, 72, 77, 0.46),
        0 6px 0 rgba(245, 197, 66, 0.34);
    overflow-wrap: normal;
}

.home-hero p:not(.eyebrow) {
    max-width: 680px;
    margin: 18px 0 0;
    color: var(--ink);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.45;
}
.home-hero .home-system-descriptor {
    width: fit-content;
    margin-top: 12px;
    padding: 7px 10px;
    border: 2px solid var(--ink);
    border-radius: 4px;
    background: var(--yellow);
    font-size: clamp(0.72rem, 1.4vw, 0.95rem);
    letter-spacing: 0.13em;
    line-height: 1.1;
    text-transform: uppercase;
}

.home-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.home-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 18px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--ink);
    color: #ffffff;
    font-weight: 900;
    box-shadow: 5px 5px 0 var(--yellow);
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.home-actions a:nth-child(2) {
    background: #ffffff;
    color: var(--ink);
    box-shadow: 5px 5px 0 var(--cyan);
}

.home-actions a:hover,
.home-actions a:focus-visible {
    transform: translate(-2px, -2px);
    background: var(--green);
    color: #ffffff;
    box-shadow: 8px 8px 0 var(--coral), 14px 14px 0 var(--cyan), var(--shadow);
}

.home-actions a:nth-child(2):hover,
.home-actions a:nth-child(2):focus-visible {
    background: var(--blue);
    color: #ffffff;
    box-shadow: 8px 8px 0 var(--yellow), 14px 14px 0 var(--coral), var(--shadow);
}

.home-support-note {
    position: relative;
    z-index: 2;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    margin-top: 18px;
    padding: 8px 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 4px 4px 0 var(--yellow), 8px 8px 0 var(--ink);
}

.home-support-note span {
    color: var(--ink);
    font-weight: 900;
}

.home-support-note a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.home-support-note a:hover,
.home-support-note a:focus-visible {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--cyan);
}

.home-support-note img {
    display: block;
    width: auto;
    height: 36px;
    border: 0;
}

.home-support-note .kofi-fallback {
    border: 2px solid var(--ink);
}

.home-material-generator {
    display: grid;
    width: min(780px, 100%);
    gap: 14px;
    margin-top: 28px;
    padding: clamp(16px, 2vw, 22px);
    border: 3px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(245, 197, 66, 0.96), rgba(255, 255, 255, 0.94) 42%, rgba(0, 168, 198, 0.2)),
        #ffffff;
    box-shadow: 8px 8px 0 var(--coral), 14px 14px 0 var(--cyan), var(--shadow);
}

.home-material-generator label {
    display: block;
    margin-top: 8px;
    color: var(--ink);
    font-size: clamp(1.45rem, 2.2vw, 2.35rem);
    font-weight: 900;
    line-height: 1;
}

.home-hero .home-material-generator p:not(.eyebrow) {
    max-width: 660px;
    margin: 10px 0 0;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.45;
}

.home-material-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.32fr) minmax(96px, auto);
    gap: 10px;
}

.home-material-row input[type="text"],
.home-material-row select {
    min-height: 58px;
    min-width: 0;
    width: 100%;
    padding: 0 16px;
    border: 3px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 1.15rem;
    font-weight: 900;
}

.home-material-row select {
    appearance: none;
    background:
        linear-gradient(45deg, transparent 50%, var(--ink) 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
        linear-gradient(135deg, var(--ink) 50%, transparent 50%) calc(100% - 12px) 50% / 7px 7px no-repeat,
        #ffffff;
}

.home-material-row button {
    min-height: 58px;
    padding: 0 24px;
    border: 3px solid var(--ink);
    border-radius: 8px;
    background: var(--green);
    color: #ffffff;
    font: inherit;
    font-size: 1.35rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 5px 5px 0 var(--yellow), 9px 9px 0 var(--ink);
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.home-material-row button:hover,
.home-material-row button:focus-visible {
    background: var(--coral);
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--cyan), 12px 12px 0 var(--ink);
}

.extra-options-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.24), rgba(0, 168, 198, 0.18)),
        #ffffff !important;
    color: var(--ink) !important;
    cursor: pointer;
    font: inherit;
    font-weight: 900 !important;
    box-shadow: 4px 4px 0 var(--yellow), 8px 8px 0 var(--ink);
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.extra-options-toggle::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 28px;
    min-width: 28px;
    height: 28px;
    border: 2px solid var(--ink);
    border-radius: 6px;
    background: var(--ink);
    color: #ffffff;
    font-size: 1.1rem;
    line-height: 1;
}

.extra-options-toggle[aria-expanded="true"] {
    background: var(--green) !important;
    color: #ffffff !important;
    box-shadow: 4px 4px 0 var(--cyan), 8px 8px 0 var(--ink);
}

.extra-options-toggle[aria-expanded="true"]::after {
    content: "-";
    background: #ffffff;
    color: var(--ink);
}

.extra-options-toggle:hover,
.extra-options-toggle:focus-visible {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--coral), 10px 10px 0 var(--ink);
}

.extra-options-shell {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 240ms ease, opacity 180ms ease;
}

.extra-options-shell.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
}

.extra-options-inner {
    display: grid;
    min-height: 0;
    overflow: hidden;
    padding: 0 4px;
}

.extra-options-shell.is-open .extra-options-inner {
    padding: 4px 4px 12px;
}

.home-material-options,
.texture-prompt-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.home-material-options label {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.home-material-options select {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(45deg, transparent 50%, var(--ink) 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
        linear-gradient(135deg, var(--ink) 50%, transparent 50%) calc(100% - 12px) 50% / 7px 7px no-repeat,
        #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 900;
    appearance: none;
}

.home-material-prompts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 900;
}

.home-material-prompts button {
    min-height: 34px;
    padding: 0 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 900;
    cursor: pointer;
}

.home-material-prompts button:hover,
.home-material-prompts button:focus-visible {
    background: var(--cyan);
}

.home-material-generator small {
    color: var(--ink);
    font-weight: 900;
}

.ai-policy-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.45;
}

.home-material-generator .ai-policy-note {
    color: var(--ink);
}

.ai-policy-note a {
    color: var(--blue);
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.home-material-loader {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
}

.home-material-loader[hidden] {
    display: none;
}

.home-loader-track {
    height: 14px;
    overflow: hidden;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: #ffffff;
}

.home-loader-track span {
    display: block;
    width: var(--home-loader-progress, 12%);
    height: 100%;
    border-right: 2px solid var(--ink);
    background:
        linear-gradient(90deg, var(--yellow) 0 20%, var(--green) 20% 40%, var(--cyan) 40% 60%, var(--coral) 60% 80%, var(--blue) 80% 100%);
    transition: width 260ms ease;
}

.home-material-generator.is-waiting-texture .home-loader-track span {
    width: 38%;
    animation: home-loader-wait 1100ms ease-in-out infinite;
}

@keyframes home-loader-wait {
    0% {
        transform: translateX(-110%);
    }

    50% {
        transform: translateX(82%);
    }

    100% {
        transform: translateX(265%);
    }
}

.home-material-loader p {
    margin: 0;
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 900;
}

.home-material-loader ol {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-material-loader li {
    min-height: 38px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f3f8fb;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
}

.home-material-loader li.is-active {
    border-color: var(--ink);
    background: var(--yellow);
    color: var(--ink);
}

.home-material-loader li.is-complete {
    border-color: rgba(0, 136, 95, 0.42);
    background: #e2f5f2;
    color: var(--ink);
}

.home-material-generator.is-loading .home-material-row input,
.home-material-generator.is-loading .home-material-row select,
.home-material-generator.is-loading .home-material-row button {
    opacity: 0.72;
}

.home-flow,
.home-feature-grid {
    display: grid;
    gap: 18px;
    padding: 26px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--chroma-shadow-small);
}

.home-flow {
    grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.2), transparent 38%),
        linear-gradient(315deg, rgba(0, 168, 198, 0.14), transparent 42%),
        var(--surface);
}

.home-flow > div {
    display: grid;
    align-content: start;
    gap: 12px;
}

.home-flow h2 {
    font-size: clamp(2rem, 3.2rem, 3.2rem);
}

.home-flow p,
.home-feature-grid p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.home-flow ol {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-flow li,
.home-feature-grid > div {
    min-width: 0;
    min-height: 190px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
}

.home-flow li a,
.home-feature-grid > div {
    display: grid;
    gap: 12px;
}

.home-flow li a {
    min-height: 100%;
    padding: 18px;
    border-radius: 6px;
}

.home-flow li:hover,
.home-flow li:focus-within {
    transform: translate(-3px, -3px);
    box-shadow: 5px 5px 0 var(--yellow), 10px 10px 0 var(--coral), 14px 14px 0 var(--ink);
}

.home-flow li a:focus-visible {
    outline: 3px solid var(--cyan);
    outline-offset: -6px;
}

.home-feature-grid > div {
    padding: 18px;
    border: 2px solid var(--ink);
    border-radius: 8px;
}

.home-flow li:nth-child(1),
.home-feature-grid > div:nth-child(1) {
    background: linear-gradient(180deg, #ffffff 0 68%, #fff3cf 68% 100%);
}

.home-flow li:nth-child(2),
.home-feature-grid > div:nth-child(2) {
    background: linear-gradient(180deg, #ffffff 0 68%, #e2f5f2 68% 100%);
}

.home-flow li:nth-child(3),
.home-feature-grid > div:nth-child(3) {
    background: linear-gradient(180deg, #ffffff 0 68%, #ffe8e9 68% 100%);
}

.home-flow li span,
.home-feature-grid span {
    color: var(--coral);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.home-flow li strong,
.home-feature-grid strong {
    font-size: 1.4rem;
    line-height: 1.05;
}

.home-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background:
        linear-gradient(90deg, rgba(0, 143, 104, 0.14), transparent 40%),
        linear-gradient(315deg, rgba(0, 120, 212, 0.12), transparent 46%),
        var(--surface);
}

.directory-intro p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.65;
}

.home-page .home-hero p:not(.eyebrow) {
    color: var(--ink);
}

.tool-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.tool-card {
    display: grid;
    align-content: space-between;
    min-height: 260px;
    gap: 16px;
    padding: 24px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(180deg, #ffffff 0 72%, #edf8f6 72% 100%);
    box-shadow: var(--chroma-shadow-small);
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.tool-card:nth-child(2) {
    background:
        linear-gradient(180deg, #ffffff 0 72%, #fff3cf 72% 100%);
}

.tool-card:nth-child(3) {
    background:
        linear-gradient(180deg, #ffffff 0 72%, #ffe8e9 72% 100%);
}

.tool-card:nth-child(4) {
    background:
        linear-gradient(180deg, #ffffff 0 72%, #e9f2ff 72% 100%);
}

.tool-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 6px 6px 0 var(--yellow), 12px 12px 0 var(--cyan), 16px 16px 0 var(--ink);
}

.tool-card span {
    color: var(--coral);
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
}

.tool-card strong {
    font-size: 2rem;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.tool-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.control-surface,
.preview-panel,
.palette-stage,
.noise-tool,
.texture-tool,
.normal-tool {
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.control-surface {
    grid-area: controls;
    display: grid;
    align-content: space-between;
    min-height: 470px;
    padding: 34px;
}

.intro {
    max-width: 640px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--green);
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}

h1 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(2.4rem, 4.8rem, 4.8rem);
    line-height: 0.98;
}

h2 {
    margin: 0;
    font-size: 2rem;
    line-height: 1;
}

h3 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.05;
}

.intro p:not(.eyebrow),
.stage-heading p {
    color: var(--muted);
    line-height: 1.65;
}

.tool-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 190px) auto;
    align-items: end;
    gap: 12px;
    margin-top: 38px;
}

.tool-form label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.tool-form input,
.tool-form select,
.tool-form button {
    min-height: 52px;
    border: 2px solid var(--ink);
    border-radius: 8px;
}

.tool-form input,
.tool-form select {
    width: 100%;
    min-width: 0;
    background: #f7fbfd;
    padding: 0 14px;
    color: var(--ink);
}

.tool-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    background: var(--blue);
    color: #ffffff;
    padding: 0 18px;
    font-weight: 800;
    box-shadow: 4px 4px 0 var(--yellow);
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.tool-form button:disabled {
    cursor: wait;
    opacity: 0.86;
}

.tool-form button:not(:disabled):hover,
.tool-form button:not(:disabled):focus-visible {
    background: var(--green);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--coral), 10px 10px 0 var(--ink);
}

.button-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.46);
    border-top-color: #ffffff;
    border-radius: 50%;
    flex: 0 0 auto;
}

.tool-form button.is-loading .button-spinner {
    display: inline-block;
    animation: button-spin 760ms linear infinite;
}

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

.preview-panel {
    grid-area: preview;
    position: relative;
    min-height: 470px;
    overflow: hidden;
}

.preview-panel img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 470px;
    object-fit: cover;
}

.preview-copy {
    position: absolute;
    right: 18px;
    bottom: 18px;
    left: 18px;
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
}

.preview-copy span {
    color: var(--coral);
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
}

.preview-copy strong {
    line-height: 1.25;
}

.palette-stage {
    grid-area: stage;
    padding: 26px;
}

.palette-page .control-surface {
    min-height: auto;
    align-content: start;
    gap: 28px;
    background:
        linear-gradient(180deg, rgba(245, 197, 66, 0.22), transparent 210px),
        var(--surface);
}

.palette-page .intro {
    max-width: 100%;
}

.palette-page .intro h1 {
    font-size: 3.6rem;
}

.palette-page .tool-form {
    grid-template-columns: 1fr;
    margin-top: 0;
}

.bias-panel {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.tool-form .bias-panel label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
}

.bias-panel label {
    color: var(--ink);
    font-weight: 800;
}

.palette-prompt-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.palette-prompt-list span {
    min-height: 34px;
    cursor: pointer;
    padding: 7px 10px;
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.saved-biomes {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(0, 143, 104, 0.16), transparent 58%),
        linear-gradient(315deg, rgba(229, 72, 77, 0.12), transparent 46%),
        #ffffff;
}

.saved-biomes > div:first-child {
    display: grid;
    gap: 6px;
}

.saved-biomes h2 {
    margin: 0;
    font-size: 1.35rem;
}

.palette-biome-cta p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.saved-biomes a {
    width: fit-content;
    color: var(--blue);
    font-weight: 900;
}

.saved-biome-list {
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
}

.saved-biome-card {
    display: grid;
    gap: 4px;
    width: 100%;
    min-height: 64px;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    padding: 10px 12px;
    text-align: left;
    font: inherit;
}

.saved-biome-card:hover,
.saved-biome-card:focus-visible {
    border-color: var(--ink);
    outline: 2px solid var(--yellow);
    outline-offset: 1px;
}

.saved-biome-card > span:first-child {
    font-weight: 900;
    overflow-wrap: anywhere;
}

.saved-biome-card small {
    color: var(--muted);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.saved-biome-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    min-height: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.saved-biome-strip span {
    min-height: 10px;
}

.biome-library {
    display: grid;
    gap: 22px;
}

.texture-library {
    display: grid;
    gap: 22px;
}

[data-library-card][hidden] {
    display: none;
}

.library-search {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.28), rgba(0, 168, 198, 0.16)),
        #ffffff;
    box-shadow: var(--panel-shadow);
}

.library-search form {
    display: grid;
    gap: 10px;
}

.library-search label {
    color: var(--ink);
    font-size: 1.25rem;
    font-weight: 900;
}

.library-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.library-search input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-weight: 900;
}

.library-search button,
.library-clear-filter {
    min-height: 42px;
    padding: 8px 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--green);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.library-clear-filter {
    justify-self: start;
    background: #ffffff;
    color: var(--ink);
}

.library-search button:hover,
.library-search button:focus-visible,
.library-clear-filter:hover,
.library-clear-filter:focus-visible {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--yellow);
}

.library-search p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.library-popular-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.library-popular-tags span {
    color: var(--ink);
    font-weight: 900;
}

.library-popular-tags button,
.library-popular-tags a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 4px 9px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 900;
}

.library-popular-tags button:hover,
.library-popular-tags button:focus-visible,
.library-popular-tags a:hover,
.library-popular-tags a:focus-visible,
.library-popular-tags a.is-active {
    background: var(--yellow);
}

.library-result-summary {
    margin: 0;
    color: var(--muted);
    font-weight: 900;
}

.account-save-panel {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(0, 143, 104, 0.14), rgba(245, 197, 66, 0.18)),
        #ffffff;
}

.account-save-panel form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.account-save-panel button,
.account-save-panel a {
    min-height: 36px;
    padding: 7px 11px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--green);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.account-save-panel small,
.account-save-panel p {
    margin: 0;
    color: var(--muted);
    font-weight: 900;
}

.account-save-panel-inline {
    margin: 10px 0;
}

.my-creations-section {
    display: grid;
    gap: 14px;
}

.creation-tabs {
    display: grid;
    gap: 0;
}

.creation-tab-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.creation-tab-list {
    display: flex;
    align-items: end;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 10px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.creation-tab-list::-webkit-scrollbar {
    display: none;
}

.creation-tab-label {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 190px;
    min-height: 54px;
    padding: 12px 18px 16px;
    border: 2px solid var(--ink);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: #ffffff;
    color: var(--ink);
    cursor: pointer;
    font-weight: 900;
    box-shadow: 5px -3px 0 rgba(0, 0, 0, 0.08);
    transform: translateY(10px);
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
    white-space: nowrap;
}

.creation-tab-label:hover,
.creation-tab-label:focus-visible {
    transform: translateY(4px);
    box-shadow: 5px -3px 0 rgba(0, 168, 198, 0.24);
}

.creation-tab-label-textures {
    background:
        linear-gradient(90deg, rgba(0, 120, 212, 0.16), rgba(0, 168, 198, 0.12)),
        #ffffff;
}

.creation-tab-label-masks {
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.26), rgba(0, 143, 104, 0.14)),
        #ffffff;
}

.creation-tab-label-colours {
    background:
        linear-gradient(90deg, rgba(229, 72, 77, 0.16), rgba(245, 197, 66, 0.22)),
        #ffffff;
}

.creation-tab-label-batches {
    background:
        linear-gradient(90deg, rgba(0, 168, 198, 0.18), rgba(0, 120, 212, 0.22)),
        #ffffff;
}

.creation-tab-panels {
    position: relative;
    display: grid;
    padding: 18px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(238, 246, 244, 0.9)),
        #ffffff;
    box-shadow: var(--chroma-shadow-small);
}

.creation-tab-panel {
    display: none;
    opacity: 0;
    transform: translateY(8px);
}

#creation-tab-textures:checked ~ .creation-tab-list .creation-tab-label-textures,
#creation-tab-masks:checked ~ .creation-tab-list .creation-tab-label-masks,
#creation-tab-colours:checked ~ .creation-tab-list .creation-tab-label-colours,
#creation-tab-batches:checked ~ .creation-tab-list .creation-tab-label-batches {
    z-index: 3;
    background: #ffffff;
    transform: translateY(2px);
    box-shadow:
        5px -3px 0 rgba(245, 197, 66, 0.84),
        10px -6px 0 rgba(0, 168, 198, 0.32);
}

#creation-tab-textures:checked ~ .creation-tab-panels .creation-tab-panel-textures,
#creation-tab-masks:checked ~ .creation-tab-panels .creation-tab-panel-masks,
#creation-tab-colours:checked ~ .creation-tab-panels .creation-tab-panel-colours,
#creation-tab-batches:checked ~ .creation-tab-panels .creation-tab-panel-batches {
    display: grid;
    animation: creation-tab-fade 180ms ease both;
}

@keyframes creation-tab-fade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.creation-card {
    overflow: hidden;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--panel-shadow);
}

.creation-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-bottom: 2px solid var(--ink);
}

.creation-card > div {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.creation-card h3,
.creation-card p {
    margin: 0;
}

.creation-card dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
}

.creation-card dl div {
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7fbfd;
}

.creation-card dt,
.creation-card dd {
    margin: 0;
}

.creation-card dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.creation-card dd,
.creation-card small {
    font-weight: 900;
}

.creation-card .texture-library-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--green);
    color: #ffffff;
    font-weight: 900;
}

.bulk-history-filter-form {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(0, 168, 198, 0.1), rgba(245, 197, 66, 0.14)),
        #ffffff;
}

.bulk-history-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.bulk-history-filter-grid label {
    display: grid;
    gap: 6px;
}

.bulk-history-filter-grid span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bulk-history-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.bulk-batch-card > div {
    gap: 12px;
}

.bulk-batch-card dl {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bulk-batch-card-completed {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(236, 250, 246, 0.94)),
        #ffffff;
}

.bulk-batch-card-failed {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 240, 235, 0.96)),
        #ffffff;
}

.bulk-batch-card-canceled {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 245, 236, 0.96)),
        #ffffff;
}

.library-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--panel-shadow);
}

.library-pagination a,
.library-pagination span,
.library-pagination strong {
    min-height: 38px;
    padding: 8px 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    font-weight: 900;
}

.library-pagination a {
    background: var(--blue);
    color: #ffffff;
}

.library-pagination a:hover,
.library-pagination a:focus-visible {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--yellow);
}

.library-pagination span {
    background: #eef1f3;
    color: var(--muted);
}

.library-pagination strong {
    background: #fff3cf;
    color: var(--ink);
}

.biome-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.texture-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 340px));
    gap: 16px;
    justify-content: start;
    align-items: start;
}

.biome-library-grid .saved-biome-card {
    min-height: 190px;
    align-content: start;
    border: 2px solid var(--ink);
    box-shadow: var(--panel-shadow);
}

.biome-library-grid .saved-biome-strip {
    min-height: 34px;
    margin-top: 8px;
}

.biome-library-grid .saved-biome-strip span {
    min-height: 34px;
}

.biome-library-card {
    cursor: default;
    overflow: hidden;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.biome-library-card:hover,
.biome-library-card:focus-within {
    transform: translateY(-2px);
}

.biome-variation-tray {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.biome-variation-tray summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    min-height: 38px;
    padding: 8px 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.2), rgba(0, 168, 198, 0.14)),
        #ffffff;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 900;
    list-style: none;
}

.biome-variation-tray summary::-webkit-details-marker {
    display: none;
}

.biome-variation-tray summary::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 24px;
    min-width: 24px;
    height: 24px;
    border: 2px solid var(--ink);
    border-radius: 6px;
    background: var(--ink);
    color: #ffffff;
    line-height: 1;
}

.biome-variation-tray[open] summary {
    background: var(--blue);
    color: #ffffff;
}

.biome-variation-tray[open] summary::after {
    content: "-";
    background: #ffffff;
    color: var(--ink);
}

.biome-variation-tray summary:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 3px;
}

.biome-variation-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 0;
    overflow-y: hidden;
    opacity: 0;
    padding-right: 4px;
    scrollbar-gutter: stable;
    transform: translateY(-8px);
    transition:
        max-height 260ms ease,
        opacity 180ms ease,
        transform 220ms ease;
    pointer-events: none;
}

.biome-variation-tray[open] .biome-variation-grid {
    max-height: 260px;
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.biome-variation-pick {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 8px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #eef8ff;
    color: var(--ink);
    text-decoration: none;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.biome-variation-pick.is-active {
    background: #fff3cf;
}

.biome-variation-pick:hover,
.biome-variation-pick:focus-visible {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 rgba(10, 15, 31, 0.18);
}

.biome-variation-pick span:first-child {
    font-weight: 900;
    overflow-wrap: anywhere;
}

.biome-variation-pick .saved-biome-strip {
    min-height: 18px;
    margin-top: 2px;
}

.biome-variation-pick .saved-biome-strip span {
    min-height: 18px;
}

.biome-library-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--green);
    color: #ffffff;
    font-weight: 900;
    text-decoration: none;
}

.texture-library-card {
    display: grid;
    width: min(100%, 340px);
    min-width: 0;
    overflow: hidden;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(180deg, #ffffff 0 70%, #fff3cf 70% 100%);
    box-shadow: var(--panel-shadow);
}

.texture-library-preview {
    display: block;
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-bottom: 2px solid var(--ink);
    background:
        linear-gradient(45deg, #d8dbe2 25%, transparent 25%),
        linear-gradient(-45deg, #d8dbe2 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d8dbe2 75%),
        linear-gradient(-45deg, transparent 75%, #d8dbe2 75%),
        #ffffff;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
    background-size: 24px 24px;
}

.texture-library-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease, opacity 180ms ease;
}

.texture-library-card:hover .texture-library-preview img,
.texture-library-card:focus-within .texture-library-preview img {
    transform: scale(1.025);
}

.texture-library-copy {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.texture-library-copy h2 {
    font-size: 1.35rem;
    line-height: 1.05;
}

.texture-maker-pill {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 5px;
    margin: 0;
    min-height: 32px;
    padding: 5px 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.34), rgba(0, 168, 198, 0.18)),
        #ffffff;
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 900;
}

.texture-maker-pill strong {
    color: var(--green);
}

.texture-latest-maker {
    justify-self: start;
    max-width: 100%;
    margin: -6px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.texture-library-copy dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 8px;
    margin: 0;
}

.texture-library-copy dl div {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.texture-library-copy dt,
.texture-library-copy dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.texture-library-copy dt {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.texture-library-copy dd {
    font-weight: 900;
}

.texture-variation-tray {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.texture-variation-tray summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    min-height: 38px;
    padding: 8px 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.2), rgba(0, 168, 198, 0.14)),
        #ffffff;
    color: var(--ink);
    cursor: pointer;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
    list-style: none;
}

.texture-variation-tray summary::-webkit-details-marker {
    display: none;
}

.texture-variation-tray summary::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 24px;
    min-width: 24px;
    height: 24px;
    border: 2px solid var(--ink);
    border-radius: 6px;
    background: var(--ink);
    color: #ffffff;
    line-height: 1;
}

.texture-variation-tray[open] summary {
    background: var(--blue);
    color: #ffffff;
}

.texture-variation-tray[open] summary::after {
    content: "-";
    background: #ffffff;
    color: var(--ink);
}

.texture-variation-tray summary:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 3px;
}

.texture-variation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
    gap: 8px;
    max-height: 0;
    overflow-y: hidden;
    opacity: 0;
    padding-right: 4px;
    scrollbar-gutter: stable;
    transform: translateY(-8px);
    transition:
        max-height 260ms ease,
        opacity 180ms ease,
        transform 220ms ease;
    pointer-events: none;
}

.texture-variation-tray[open] .texture-variation-grid {
    max-height: 224px;
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.texture-variation-pick {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 5px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #eef8ff;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 900;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.texture-variation-pick.is-active {
    background: #fff3cf;
}

.texture-variation-pick:hover,
.texture-variation-pick:focus-visible {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 rgba(10, 15, 31, 0.18);
}

.texture-variation-pick img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
}

.texture-variation-pick span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.texture-variation-loading {
    grid-column: 1 / -1;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff9e8;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
}

.library-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.library-tags span,
.library-tags button {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
}

.library-tags span:hover,
.library-tags span:focus-visible,
.library-tags button:hover,
.library-tags button:focus-visible {
    border-color: var(--ink);
    background: #e2f5f2;
    color: var(--ink);
}

.library-vote-widget {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
    align-items: center;
}

.library-vote-score,
.library-vote-widget a,
.library-vote-widget button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 5px 8px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 900;
    text-decoration: none;
}

.library-vote-score {
    min-width: 48px;
    background: #fff3cf;
}

.library-vote-widget button {
    gap: 5px;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.library-vote-widget button:hover,
.library-vote-widget button:focus-visible {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--yellow);
}

.library-vote-widget button.is-active {
    background: var(--green);
    color: #ffffff;
}

.library-vote-widget button[value="-1"].is-active {
    background: var(--coral);
}

.library-vote-widget a {
    grid-column: span 2;
    background: #e2f5f2;
}

.library-vote-status {
    grid-column: 1 / -1;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 900;
}

.tag-editor-panel {
    display: grid;
    gap: 8px;
}

.tag-edit-details {
    display: grid;
    gap: 8px;
}

.tag-edit-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 8px 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.24), rgba(0, 168, 198, 0.16)),
        #ffffff;
    color: var(--ink);
    cursor: pointer;
    font-weight: 900;
    list-style: none;
}

.tag-edit-details summary::-webkit-details-marker {
    display: none;
}

.tag-edit-details summary::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 24px;
    min-width: 24px;
    height: 24px;
    border: 2px solid var(--ink);
    border-radius: 6px;
    background: var(--ink);
    color: #ffffff;
    line-height: 1;
}

.tag-edit-details[open] summary {
    background: var(--green);
    color: #ffffff;
}

.tag-edit-details[open] summary::after {
    content: "-";
    background: #ffffff;
    color: var(--ink);
}

.tag-edit-details summary:hover,
.tag-edit-details summary:focus-visible {
    box-shadow: 4px 4px 0 var(--yellow);
    transform: translate(-1px, -1px);
}

.tag-edit-form {
    display: grid;
    gap: 8px;
    margin: 8px 0 0;
    padding: 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.2), rgba(0, 168, 198, 0.14)),
        #ffffff;
}

.tag-edit-form label {
    color: var(--ink);
    font-weight: 900;
}

.tag-edit-form textarea {
    width: 100%;
    min-height: 70px;
    min-width: 0;
    resize: vertical;
    padding: 8px 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-weight: 800;
}

.tag-edit-form p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.35;
}

.tag-edit-form button {
    justify-self: start;
    min-height: 38px;
    padding: 8px 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--green);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.tag-edit-form button:hover,
.tag-edit-form button:focus-visible {
    background: var(--blue);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--yellow);
}

.tag-edit-status {
    color: var(--green);
    font-weight: 900;
}

.texture-library-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.texture-library-actions a,
.texture-library-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--blue);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.texture-library-actions a:last-child,
.texture-library-actions button {
    background: var(--green);
}

.texture-library-actions a:first-of-type {
    background: var(--coral);
}

.texture-library-actions .texture-library-download {
    grid-column: 1 / -1;
}

.admin-inline-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

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

.texture-library-actions .admin-inline-form {
    grid-column: span 1;
}

.texture-library-actions .admin-inline-form-danger {
    grid-column: 1 / -1;
}

.admin-inline-form button {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #fff3cf;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

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

.admin-message-summary {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.admin-message-bulk-panel {
    padding: 18px 20px;
}

.admin-message-bulk-actions {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.admin-message-bulk-actions h2,
.admin-message-select span {
    margin: 0;
}

.admin-message-bulk-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-message-bulk-buttons button {
    min-height: 40px;
    padding: 8px 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #fff3cf;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.admin-message-bulk-buttons button:hover,
.admin-message-bulk-buttons button:focus-visible {
    box-shadow: 4px 4px 0 rgba(10, 15, 31, 0.18);
    transform: translateY(-1px);
}

.admin-message-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--panel-shadow);
}

.admin-message-card.is-unread {
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.22), rgba(0, 168, 198, 0.16)),
        #ffffff;
}

.admin-message-card header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.admin-message-card h2,
.admin-message-card p {
    margin: 0;
}

.admin-message-card h2 {
    font-size: 1.25rem;
}

.admin-message-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
}

.admin-message-select input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.admin-message-card time {
    color: var(--muted);
    font-weight: 900;
    white-space: nowrap;
}

.admin-message-body {
    white-space: pre-wrap;
    line-height: 1.5;
}

.admin-message-card dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.admin-message-card dl div {
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff9e8;
}

.admin-message-card dt,
.admin-message-card dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.admin-message-card dt {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-message-card dd {
    font-weight: 800;
}

.admin-inline-form-danger button {
    background: var(--coral);
    color: #ffffff;
}

.admin-inline-form button:hover,
.admin-inline-form button:focus-visible {
    box-shadow: 4px 4px 0 rgba(10, 15, 31, 0.18);
    transform: translateY(-1px);
}

.empty-library {
    display: grid;
    gap: 12px;
    padding: 24px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.empty-library[hidden] {
    display: none;
}

.empty-library p {
    margin: 0;
    color: var(--muted);
}

.rate-limit-notice {
    border-color: var(--coral);
    background: #fff4e5;
}

.rate-limit-notice small {
    color: var(--muted);
    font-weight: 800;
}

.empty-library a {
    width: fit-content;
    min-height: 40px;
    padding: 10px 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--yellow);
    font-weight: 900;
}

.palette-page .preview-panel {
    min-height: 230px;
}

.palette-page .preview-panel img {
    min-height: 230px;
}

.palette-page .palette-stage {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: calc(100vh - 120px);
    background:
        linear-gradient(135deg, rgba(0, 120, 212, 0.1), transparent 34%),
        linear-gradient(315deg, rgba(229, 72, 77, 0.11), transparent 28%),
        var(--surface);
}

.palette-page #palette-board,
.palette-page .palette-group-stack {
    min-height: 0;
}

.palette-source-line {
    margin-bottom: 16px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    font-weight: 800;
}

.palette-group-stack {
    display: grid;
    gap: 18px;
}

.palette-group {
    display: grid;
    gap: 12px;
}

.palette-group-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: end;
}

.biome-pack {
    display: grid;
    align-content: start;
    align-items: start;
    gap: 16px;
    margin-top: 22px;
    padding: 18px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(0, 143, 104, 0.12), transparent 46%),
        #ffffff;
}

.biome-pack-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
}

.biome-pack-heading p:not(.eyebrow) {
    max-width: 520px;
    margin: 0 0 10px;
    color: var(--muted);
    line-height: 1.5;
}

.biome-pack-heading > div:last-child {
    display: grid;
    justify-items: end;
}

.biome-export-button {
    min-height: 42px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--coral) !important;
    color: #ffffff !important;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    padding: 0 12px;
}

.biome-layer-stack {
    display: grid;
    gap: 16px;
}

.biome-layer {
    display: grid;
    gap: 10px;
}

.biome-layer h4 {
    margin: 0;
    color: var(--green);
    font-size: 1rem;
    text-transform: uppercase;
}

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

.biome-material {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.biome-material-swatch {
    min-height: 100%;
    border: 2px solid var(--ink);
    border-radius: 8px;
}

.biome-material-copy {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.biome-material-copy > div:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.biome-material-copy strong {
    overflow-wrap: anywhere;
}

.biome-material-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.material-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
    gap: 6px;
    margin: 0;
}

.material-settings div {
    display: grid;
    gap: 2px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7fbfd;
}

.material-settings dt,
.material-settings dd {
    margin: 0;
}

.material-settings dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.material-settings dd {
    font-weight: 900;
}

.material-send-button {
    min-height: 40px;
    cursor: pointer;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--blue);
    color: #ffffff;
    font: inherit;
    font-weight: 900;
}

.material-send-button-secondary {
    background: var(--green);
}

.material-preset-note {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff9e8;
    color: var(--ink);
    font-weight: 800;
    line-height: 1.35;
}

.pbr-source-summary {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(0, 168, 198, 0.16), rgba(245, 197, 66, 0.22)),
        #ffffff;
    box-shadow: 4px 4px 0 var(--ink);
}

.pbr-source-summary[hidden] {
    display: none;
}

.pbr-source-summary img {
    width: 92px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(45deg, #d8dbe2 25%, transparent 25%),
        linear-gradient(-45deg, #d8dbe2 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d8dbe2 75%),
        linear-gradient(-45deg, transparent 75%, #d8dbe2 75%),
        #ffffff;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-size: 20px 20px;
}

.pbr-source-summary h2 {
    font-size: 1.25rem;
}

.pbr-source-summary dl {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 10px 0 0;
}

.pbr-source-summary dl div {
    min-width: 0;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
}

.pbr-source-summary dt,
.pbr-source-summary dd,
.pbr-source-summary p {
    margin: 0;
}

.pbr-source-summary dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.pbr-source-summary dd {
    color: var(--ink);
    font-weight: 900;
    overflow-wrap: anywhere;
}

.pbr-source-summary div > p:not(.eyebrow) {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.35;
}

.noise-tool,
.texture-tool {
    grid-area: noise;
    padding: 26px;
}

.normal-tool {
    padding: 22px;
}

.single-tool .noise-tool,
.single-tool .texture-tool,
.single-tool .normal-tool {
    grid-area: auto;
}

.single-tool {
    min-height: calc(100vh - 96px);
}

.stage-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
    margin-bottom: 20px;
}

.stage-heading p {
    max-width: 420px;
    margin: 0;
}

.swatch-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.swatch-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.swatch-fill {
    min-height: 190px;
}

.swatch-meta {
    display: grid;
    gap: 8px;
    padding: 14px;
}

.swatch-meta span {
    font-weight: 800;
}

.swatch-meta small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.copy-chip {
    width: fit-content;
    max-width: 100%;
    min-height: 34px;
    cursor: pointer;
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    padding: 6px 10px;
    font-weight: 800;
}

.palette-page .swatch-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    height: auto;
}

.palette-page .swatch-card {
    display: grid;
    grid-template-rows: minmax(190px, 1fr) auto;
    border: 2px solid var(--ink);
    min-height: 360px;
}

.palette-page .swatch-fill {
    min-height: 190px;
}

.palette-page .swatch-meta {
    min-height: 150px;
    align-content: start;
    background: #ffffff;
}

.palette-page .swatch-meta span {
    font-size: 1.25rem;
}

.biome-stage #biome-board {
    display: grid;
    align-content: start;
    align-items: start;
    gap: 20px;
}

.biome-generator-page .biome-pack {
    margin-top: 0;
}

.biome-generator-page .palette-stage {
    min-height: calc(100vh - 120px);
}

.biome-generator-page .swatch-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.biome-generator-page .swatch-card {
    grid-template-rows: minmax(110px, 150px) auto;
    min-height: 250px;
}

.biome-generator-page .swatch-fill {
    min-height: 110px;
}

.biome-generator-page .swatch-meta {
    min-height: 128px;
}

.biome-generator-page .swatch-meta span {
    font-size: 1rem;
}

.noise-workbench {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.normal-workbench {
    display: grid;
    grid-template-columns: minmax(340px, 480px) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}

.texture-workbench {
    display: grid;
    grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.noise-controls,
.texture-controls,
.normal-controls {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 18px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(0, 168, 198, 0.1), transparent 160px),
        #ffffff;
    box-shadow: var(--panel-shadow);
}

.normal-controls {
    max-height: calc(100vh - 152px);
    overflow-x: hidden;
    overflow-y: auto;
}

.texture-controls textarea,
.texture-controls select {
    width: 100%;
    min-width: 0;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
}

.texture-controls textarea {
    min-height: 120px;
    padding: 12px;
    resize: vertical;
}

.texture-controls select {
    min-height: 44px;
    padding: 0 12px;
}

.control-row {
    display: grid;
    gap: 8px;
}

.control-row label,
.check-control {
    color: var(--ink);
    font-weight: 800;
}

.control-row label {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.control-row output {
    color: var(--muted);
    font-weight: 800;
}

.seed-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.seed-row label {
    grid-column: 1 / -1;
}

.seed-row input {
    width: 100%;
    min-width: 0;
}

.noise-controls input[type="text"],
.texture-controls button,
.noise-controls button,
.normal-controls button {
    min-height: 44px;
    border: 2px solid var(--ink);
    border-radius: 8px;
}

.noise-controls input[type="text"] {
    padding: 0 12px;
    background: #ffffff;
    color: var(--ink);
}

.noise-refine-panel {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.ai-refine-panel {
    position: relative;
    display: grid;
    gap: 14px;
    overflow: visible;
    padding: 24px 16px 18px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, var(--yellow) 0 22%, var(--green) 22% 42%, var(--cyan) 42% 62%, var(--coral) 62% 82%, var(--blue) 82% 100%) left top / 100% 7px no-repeat,
        linear-gradient(135deg, rgba(245, 197, 66, 0.28), rgba(255, 255, 255, 0.96) 46%, rgba(0, 168, 198, 0.22)),
        #ffffff;
    box-shadow: 5px 5px 0 var(--coral), 10px 10px 0 var(--cyan), var(--panel-shadow);
}

.ai-refine-panel label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    font-weight: 900;
    line-height: 1.1;
}

.ai-refine-panel label::before {
    content: "AI";
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    min-height: 28px;
    padding: 0 8px;
    border: 2px solid var(--ink);
    border-radius: 6px;
    background: var(--ink);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 900;
    box-shadow: 3px 3px 0 var(--yellow);
}

.ai-refine-panel textarea {
    width: 100%;
    min-height: 118px;
    resize: vertical;
    border: 2px solid var(--ink);
    border-radius: 8px;
    padding: 14px 12px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink);
    font: inherit;
    font-weight: 800;
    box-shadow: inset 4px 4px 0 rgba(0, 168, 198, 0.12);
}

.ai-refine-panel textarea:focus {
    outline: 3px solid var(--yellow);
    outline-offset: 2px;
}

.material-intelligence {
    margin: 0;
    padding: 10px 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #e2f5f2;
    color: var(--ink);
    font-weight: 900;
    line-height: 1.35;
    box-shadow: 4px 4px 0 var(--yellow);
}

.noise-refine-panel label {
    font-weight: 900;
}

.noise-refine-panel textarea {
    width: 100%;
    min-height: 82px;
    resize: vertical;
    border: 2px solid var(--ink);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--ink);
    font: inherit;
}

.noise-refine-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.noise-refine-presets button {
    min-height: 34px;
    border-width: 1px;
    font-size: 0.88rem;
}

.noise-controls input[type="range"] {
    width: 100%;
    accent-color: var(--blue);
}

.normal-controls input[type="range"] {
    width: 100%;
    accent-color: var(--blue);
}

.noise-controls button,
.texture-controls button,
.normal-controls button {
    cursor: pointer;
    padding: 0 12px;
    background: #ffffff;
    color: var(--ink);
    font-weight: 800;
}

.ai-refine-panel button {
    min-height: 50px;
    background: var(--coral) !important;
    color: #ffffff !important;
    font-weight: 900;
    box-shadow: 5px 5px 0 var(--yellow), 9px 9px 0 var(--ink);
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.ai-refine-panel button:hover,
.ai-refine-panel button:focus-visible {
    background: var(--green) !important;
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--cyan), 12px 12px 0 var(--ink);
}

.lighting-dropdown {
    display: grid;
    margin: 2px 0 8px;
}

.lighting-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    cursor: pointer;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.28), rgba(0, 168, 198, 0.18)),
        #ffffff !important;
    color: var(--ink) !important;
    font: inherit;
    font-weight: 900 !important;
    text-align: left;
    box-shadow: 4px 4px 0 var(--cyan), 8px 8px 0 var(--ink);
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.lighting-dropdown-toggle:hover,
.lighting-dropdown-toggle:focus-visible {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--yellow), 10px 10px 0 var(--ink);
}

.lighting-dropdown-toggle::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 30px;
    min-width: 30px;
    height: 30px;
    border: 2px solid var(--ink);
    border-radius: 6px;
    background: var(--ink);
    color: #ffffff;
    font-size: 1.2rem;
    line-height: 1;
}

.lighting-dropdown-toggle[aria-expanded="true"]::after {
    content: "-";
}

.lighting-dropdown-toggle small {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.lighting-dropdown-body {
    display: grid;
    gap: 12px;
    max-height: 560px;
    overflow: hidden;
    opacity: 1;
    margin-top: 10px;
    padding: 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 4px 4px 0 var(--cyan), 8px 8px 0 var(--ink);
    transition:
        max-height 240ms ease,
        opacity 180ms ease,
        margin-top 240ms ease,
        padding 240ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.lighting-dropdown-body[aria-hidden="true"] {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-color: transparent;
    box-shadow: none;
    pointer-events: none;
}

.normal-controls select {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-weight: 800;
}

.texture-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.texture-controls button:disabled {
    cursor: wait;
    opacity: 0.86;
}

.texture-controls button.is-loading .button-spinner {
    display: inline-block;
    animation: button-spin 760ms linear infinite;
}

.texture-action-grid,
.texture-output-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.texture-model-indicator {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.16), rgba(0, 168, 198, 0.12)),
        #ffffff;
}

.texture-model-indicator-copy {
    display: grid;
    gap: 4px;
}

.texture-model-indicator strong {
    color: var(--ink);
    font-size: 1.08rem;
    line-height: 1.1;
}

.texture-model-indicator small {
    color: var(--muted);
    font-weight: 800;
}

.texture-model-indicator-tier-2 {
    background:
        linear-gradient(135deg, rgba(229, 72, 77, 0.12), transparent 46%),
        linear-gradient(315deg, rgba(0, 168, 198, 0.14), transparent 58%),
        #ffffff;
}

.texture-model-indicator-tier-3 {
    background:
        radial-gradient(circle at top right, rgba(245, 197, 66, 0.26), transparent 34%),
        linear-gradient(135deg, rgba(0, 143, 104, 0.14), transparent 44%),
        linear-gradient(315deg, rgba(0, 168, 198, 0.14), transparent 58%),
        #fffef6;
}

.texture-output-actions {
    grid-template-columns: 1fr;
}

.texture-action-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff9e8;
}

.texture-action-panel-pbr {
    background: #e2f5f2;
}

.texture-action-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.4;
}

.texture-action-panel p strong {
    color: var(--ink);
}

.texture-pbr-map-hint {
    padding: 8px 10px;
    border: 1px solid rgba(0, 136, 95, 0.26);
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.92rem;
}

.texture-action-panel > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.texture-action-panel-pbr > div {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
    align-items: stretch;
}

.texture-prompt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.texture-prompt-chips button {
    min-height: 34px;
    border-width: 1px;
    background: #ffffff;
    color: var(--muted);
    font-size: 0.88rem;
}

.texture-prompt-options {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.texture-status,
.texture-prompt-output,
.texture-seed-output {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.texture-prompt-output,
.texture-seed-output {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff9e8;
    color: var(--ink);
    font-weight: 800;
}

.texture-seed-output {
    background: #e2f5f2;
}

.texture-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 12px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    font-weight: 800;
}

.texture-variation-button,
.texture-tileable-button,
.texture-compare-button {
    background: var(--blue) !important;
}

.texture-send-pbr {
    border-color: var(--green) !important;
    background: #ffffff !important;
    color: var(--green) !important;
}

.texture-generate-pbr {
    background: var(--coral) !important;
    min-height: 52px;
    font-size: 1rem;
    box-shadow: 0 4px 0 var(--ink);
}

.file-control {
    display: grid;
    gap: 8px;
}

.file-control label {
    color: var(--ink);
    font-weight: 800;
}

.file-control input {
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
}

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

.advanced-options-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.26), rgba(0, 168, 198, 0.18)),
        #ffffff !important;
    color: var(--ink) !important;
    font-weight: 900 !important;
    box-shadow: 5px 5px 0 var(--yellow), 9px 9px 0 var(--ink);
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.advanced-options-toggle::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 30px;
    min-width: 30px;
    height: 30px;
    border: 2px solid var(--ink);
    border-radius: 6px;
    background: var(--ink);
    color: #ffffff;
    font-size: 1.2rem;
    line-height: 1;
}

.advanced-options-toggle[aria-expanded="true"] {
    background: var(--green) !important;
    color: #ffffff !important;
    box-shadow: 5px 5px 0 var(--cyan), 9px 9px 0 var(--ink);
}

.advanced-options-toggle[aria-expanded="true"]::after {
    content: "-";
    background: #ffffff;
    color: var(--ink);
}

.advanced-options-toggle:hover,
.advanced-options-toggle:focus-visible {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--coral), 12px 12px 0 var(--ink);
}

.advanced-options-shell {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 240ms ease, opacity 180ms ease;
}

.advanced-options-shell.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
}

.advanced-options-inner {
    display: grid;
    gap: 14px;
    min-height: 0;
    overflow: hidden;
    padding: 0 4px;
}

.advanced-options-shell.is-open .advanced-options-inner {
    padding: 4px 4px 12px;
}

.tab-button {
    min-width: 0;
    min-height: 44px;
    cursor: pointer;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font-weight: 800;
    overflow-wrap: anywhere;
    white-space: normal;
}

.tab-button.is-active {
    background: var(--blue);
    color: #ffffff;
}

.tab-panel {
    display: grid;
    gap: 14px;
}

.tab-panel[hidden] {
    display: none;
}

.mask-panel {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.mask-slot {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f3faf8;
}

.mask-helper {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
}

.color-pick-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px 36px;
    gap: 10px;
    align-items: center;
}

.color-pick-row label {
    color: var(--ink);
    font-weight: 800;
}

.color-pick-row span:first-child {
    color: var(--ink);
    font-weight: 800;
}

.color-pick-row input {
    width: 54px;
    height: 38px;
    min-width: 0;
    padding: 2px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
}

.mask-color-chip {
    width: 36px;
    height: 36px;
    border: 2px solid var(--ink);
    border-radius: 8px;
}

.slot-pick-button {
    min-height: 42px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.slot-pick-button:hover {
    background: #e4f1f0;
}

.slot-pick-button.is-active {
    background: #bdeee8;
}

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

.check-control {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.check-control:hover {
    border-color: var(--cyan);
}

.check-control input {
    width: 18px;
    height: 18px;
    accent-color: var(--green);
}

.download-button {
    background: var(--green) !important;
    color: #ffffff !important;
}

.export-all-button {
    background: var(--coral) !important;
}

.export-panel {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff9e8;
}

.export-panel .eyebrow {
    margin-bottom: 6px;
}

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

.packed-button,
.export-packed-button,
.material-pack-button {
    background: var(--blue) !important;
}

.packed-action-grid .packed-button:last-child,
.export-packed-button,
.material-pack-button {
    grid-column: 1 / -1;
}

.noise-preview {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 520px;
    padding: 18px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(45deg, #d8dbe2 25%, transparent 25%),
        linear-gradient(-45deg, #d8dbe2 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d8dbe2 75%),
        linear-gradient(-45deg, transparent 75%, #d8dbe2 75%),
        #ffffff;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
    background-size: 24px 24px;
}

.texture-preview-panel {
    display: grid;
    min-width: 0;
    min-height: 620px;
    padding: 18px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(245, 197, 66, 0.2), transparent 52%),
        linear-gradient(315deg, rgba(0, 168, 198, 0.18), transparent 48%),
        #ffffff;
}

.texture-preview-frame {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(45deg, #d8dbe2 25%, transparent 25%),
        linear-gradient(-45deg, #d8dbe2 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d8dbe2 75%),
        linear-gradient(-45deg, transparent 75%, #d8dbe2 75%),
        #ffffff;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
    background-size: 24px 24px;
}

.texture-preview-frame img {
    display: block;
    width: min(100%, 820px);
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.texture-preview-frame img[hidden] {
    display: none;
}

.texture-preview-frame p {
    max-width: 320px;
    margin: 0;
    padding: 18px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

#noise-canvas {
    display: block;
    width: min(100%, 620px);
    height: auto;
    aspect-ratio: 1 / 1;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #ffffff;
    image-rendering: pixelated;
}

.normal-preview-stack {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.pbr-preview {
    position: relative;
    min-width: 0;
    min-height: min(62vh, 760px);
    overflow: hidden;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #15161a;
}

.pbr-preview canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.preview-hint {
    position: absolute;
    right: 14px;
    bottom: 14px;
    left: 14px;
    z-index: 2;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 8px;
    background: rgba(21, 22, 26, 0.72);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    pointer-events: none;
}

.normal-map-output {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
    padding: 16px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.18), transparent 38%),
        #ffffff;
    box-shadow: var(--panel-shadow);
}

.map-canvas-panel {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.normal-map-output p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.normal-map-output canvas {
    display: block;
    width: min(100%, var(--map-size, 1024px));
    height: auto;
    aspect-ratio: 1 / 1;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #8080ff;
}

#height-canvas {
    cursor: crosshair;
    background: #ffffff;
}

#mask-canvas {
    background: #000000;
}

#surface-canvas {
    background: #808080;
}

#metallic-canvas {
    background: #000000;
}

#ao-canvas {
    background: #ffffff;
}

#height-map-canvas {
    background: #808080;
}

@media (min-width: 901px) {
    .noise-controls,
    .texture-controls,
    .normal-controls {
        position: sticky;
        top: 92px;
    }
}

@media (max-width: 900px) {
    .workspace {
        grid-template-columns: 1fr;
        grid-template-areas:
            "controls"
            "preview"
            "stage";
    }

    .palette-page {
        grid-template-areas:
            "controls"
            "stage"
            "preview";
    }

    .control-surface,
    .preview-panel {
        min-height: auto;
    }

    .normal-controls {
        min-height: auto;
        max-height: none;
        overflow-x: hidden;
        overflow-y: visible;
    }

    .preview-panel img {
        min-height: 340px;
    }

    .tool-form,
    .swatch-grid,
    .noise-workbench,
    .texture-workbench,
    .normal-workbench,
    .home-flow,
    .home-flow ol,
    .home-feature-grid,
    .admin-stat-grid,
    .tool-list {
        grid-template-columns: 1fr;
    }

    .admin-section-heading,
    .admin-panel-header {
        align-items: start;
        flex-direction: column;
    }

    .admin-analytics-split {
        grid-template-columns: 1fr;
    }

    .home-hero {
        min-height: 420px;
    }

    .home-hero h1 {
        font-size: 4.2rem;
    }

    .stage-heading {
        align-items: start;
        flex-direction: column;
    }

    .noise-preview {
        min-height: auto;
    }

    .texture-preview-panel {
        min-height: 480px;
    }

    .bulk-uploader-hero,
    .bulk-uploader-capability-grid,
    .bulk-uploader-form-grid,
    .bulk-uploader-staged-summary {
        grid-template-columns: 1fr;
    }

    .bulk-uploader-form-grid-compact {
        grid-template-columns: 1fr;
    }

    .account-subscription-head,
    .account-subscription-metrics,
    .account-subscription-feature-list {
        grid-template-columns: 1fr;
    }

    .pbr-preview {
        min-height: 440px;
    }

    .normal-map-output {
        grid-template-columns: 1fr;
    }

    .palette-page .palette-stage {
        min-height: auto;
    }

    .palette-page .swatch-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        height: auto;
    }

    .palette-page .swatch-card {
        grid-template-rows: minmax(220px, auto) auto;
        min-height: auto;
    }

    .palette-page .swatch-fill {
        min-height: 220px;
    }

    .palette-page .swatch-card:last-child {
        grid-column: 1 / -1;
    }

    .biome-pack-heading {
        align-items: start;
        flex-direction: column;
    }

    .biome-pack-heading > div:last-child {
        justify-items: start;
    }

    .biome-material-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .page-shell {
        padding: 10px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding-bottom: 18px;
    }

    .site-footer {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .footer-link-groups {
        justify-items: start;
        width: 100%;
    }

    .site-footer nav {
        justify-content: flex-start;
        width: 100%;
    }

    .footer-primary-links a {
        width: 100%;
    }

    .home-page .brand {
        width: 100%;
        min-height: 48px;
        box-shadow: 4px 4px 0 var(--ink);
    }

    .home-hero {
        min-height: 380px;
        padding: 22px;
    }

    .home-hero h1 {
        font-size: 2.8rem;
    }

    .home-hero p:not(.eyebrow) {
        font-size: 1.04rem;
    }

    .home-hero::after {
        right: 22px;
        bottom: 16px;
        width: 180px;
    }

    .account-subscription {
        padding: 16px;
    }

    .account-subscription-badge,
    .account-subscription-metrics article,
    .account-subscription-feature-list li {
        padding: 12px;
    }

    .home-actions a {
        width: 100%;
        justify-content: center;
    }

    .home-material-generator {
        margin-top: 22px;
    }

    .home-material-row {
        grid-template-columns: 1fr;
    }

    .home-material-options {
        grid-template-columns: 1fr;
    }

    .home-material-row button {
        width: 100%;
    }

    .home-material-loader ol {
        grid-template-columns: 1fr;
    }

    .home-flow,
    .home-feature-grid {
        padding: 18px;
    }

    .control-surface,
    .palette-stage,
    .noise-tool,
    .texture-tool,
    .normal-tool {
        padding: 18px;
    }

    .seed-row,
    .library-search-row,
    .toggle-grid,
    .pbr-source-summary,
    .pbr-source-summary dl,
    .texture-action-grid,
    .texture-output-actions,
    .texture-action-panel > div,
    .texture-action-panel-pbr > div,
    .packed-action-grid {
        grid-template-columns: 1fr;
    }

    .tool-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .normal-map-output,
    .color-pick-row,
    .contact-layout,
    .admin-message-card dl,
    .texture-library-copy dl,
    .texture-library-actions,
    .admin-inline-actions,
    .palette-page .swatch-grid {
        grid-template-columns: 1fr;
    }

    .admin-message-bulk-actions {
        align-items: start;
        flex-direction: column;
    }

    .admin-message-card header {
        flex-direction: column;
    }

    .palette-page .intro h1 {
        font-size: 1.9rem;
        line-height: 1;
    }

    .palette-page {
        gap: 8px;
    }

    .palette-page .control-surface {
        gap: 16px;
        padding: 14px;
    }

    .palette-page .intro p:not(.eyebrow) {
        display: none;
    }

    .palette-page .tool-form {
        gap: 10px;
    }

    .palette-page .tool-form input,
    .palette-page .tool-form select,
    .palette-page .tool-form button {
        min-height: 44px;
    }

    .palette-page .bias-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 10px;
    }

    .palette-page .bias-panel .control-row {
        gap: 4px;
    }

    .palette-page .bias-panel label {
        display: grid;
        gap: 2px;
        font-size: 0.82rem;
        line-height: 1.15;
    }

    .palette-prompt-list {
        display: none;
    }

    .palette-page .palette-stage {
        padding: 14px;
    }

    .palette-page .stage-heading {
        gap: 8px;
        margin-bottom: 12px;
    }

    .palette-page .stage-heading > p {
        display: none;
    }

    .palette-page .swatch-card:last-child {
        grid-column: auto;
    }

    .palette-page .swatch-card {
        grid-template-rows: minmax(180px, auto) auto;
    }

    .palette-page .swatch-fill {
        min-height: 180px;
    }

    .biome-pack {
        padding: 12px;
    }

    .biome-material {
        grid-template-columns: 42px minmax(0, 1fr);
        padding: 10px;
    }

    .material-settings {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pbr-preview {
        min-height: 360px;
    }

    h1 {
        font-size: 2.45rem;
    }

    h2 {
        font-size: 1.6rem;
    }
}
