/* Keep the editor alongside the simple blue VCMC product pages. */
* { box-sizing: border-box; }
.texture-page { margin: 0; min-height: 100vh; display: flex; flex-direction: column; color-scheme: light; }
.texture-page :is(h1, h2, h3, p) { margin: 0; }
.texture-page button, .texture-page input { font: inherit; }
.texture-page button { cursor: pointer; }
.texture-page button:disabled { cursor: default; opacity: .45; }
.texture-page :is(button, input, summary, canvas):focus-visible { outline: 3px solid #2581ef; outline-offset: 3px; }
.texture-page .vcmc-topbar { position: static; }
.texture-page .vcmc-nav-inner { min-height: 62px; }
.texture-page .vcmc-nav-links a[aria-current="page"] { color: white; text-decoration: underline; text-underline-offset: 6px; }
.texture-page .vcmc-brand span { font-weight: 500; }
.texture-main { width: min(1120px, calc(100% - 48px)); margin: 24px auto 48px; }
.breadcrumb { display: flex; gap: 10px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.page-heading h1 { color: #103b77; font-size: clamp(28px, 4vw, 38px); line-height: 1.2; letter-spacing: -.7px; font-weight: 750; margin-bottom: 10px; }
.page-heading p { color: var(--muted); font-size: 15px; max-width: 680px; }
.help-link { flex: none; color: var(--primary); font-size: 14px; }
.editor-status { position: sticky; top: 0; z-index: 5; background: var(--background); min-height: 24px; padding-block: 8px; margin: 14px 0 !important; font-size: 14px; color: var(--muted); }
.editor-status[data-error="true"], .editor-status.error, .editor-status.is-error { color: #a12929; }
.workspace { min-width: 0; padding: 0; margin: 0; border: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr) 250px; align-items: start; gap: 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.texture-sidebar, .editor-panel, .download-panel { border: 1px solid var(--border); border-radius: 4px; background: white; min-width: 0; }
.texture-page h2 { font-size: 16px; line-height: 1.4; font-weight: 650; }
.panel-heading { padding: 16px; border-bottom: 1px solid var(--border); }
.panel-heading #change-count { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.texture-list { display: flex; flex-direction: column; padding: 6px; gap: 2px; }
.texture-list button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px; min-height: 54px; background: transparent; border: 1px solid transparent; border-radius: 3px; color: var(--ink); text-align: start; font-size: 14px; }
.texture-list button:hover { background: #f0f5fc; }
.texture-list button[aria-pressed="true"], .texture-list button[aria-selected="true"], .texture-list button.active { border-color: #bad0ec; background: var(--primary-soft); color: #1257b2; }
.texture-list :is(canvas, img) { width: 32px; height: 32px; object-fit: contain; flex: none; image-rendering: pixelated; }
.texture-list button > span { min-width: 0; }
.texture-list small { display: block; color: var(--muted); font-size: 11px; }
.texture-list strong { display: block; font-weight: 600; }
.texture-list .modified-dot, .texture-list .texture-changed { margin-inline-start: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex: none; font-size: 0; }
.editor-panel { padding: 18px; }
.editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
#texture-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.texture-page .text-button { background: transparent; padding: 3px 0; border: 0; color: var(--primary); font-size: 13px; line-height: 1.6; }
.text-button:hover { text-decoration: underline; }
.editor-toolbar { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.tool-buttons, .history-buttons { display: flex; gap: 4px; }
.tool-buttons button, .history-buttons button { min-height: 34px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 3px; color: var(--ink); background: white; font-size: 12px; }
.tool-buttons button[aria-pressed="true"] { border-color: var(--primary); color: #1257b2; background: var(--primary-soft); }
.tool-buttons button:hover, .history-buttons button:hover { background: #f0f5fc; }
.history-buttons button { width: 30px; font-size: 21px; line-height: 1; padding: 4px; }
.canvas-stage { padding: 15px; background: #edf1f6; border: 1px solid var(--border); display: flex; justify-content: center; }
#editor-canvas { display: block; width: auto; height: auto; max-width: 100%; aspect-ratio: auto; image-rendering: pixelated; cursor: crosshair; touch-action: none; background: white; box-shadow: 0 0 0 1px #b8c3d2; }
.canvas-options { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.checkbox-label { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; cursor: pointer; }
.checkbox-label input { accent-color: var(--primary); }
.canvas-help { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 10px !important; }
.color-controls { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.color-adjustments { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.adjustment-row + .adjustment-row { margin-top: 10px; }
.adjustment-row .color-heading { margin-bottom: 2px; }
.adjustment-row output { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.adjustment-slider { appearance: none; display: block; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; }
/* Reading direction must not reverse drawing coordinates or color gradients. */
.adjustment-slider, .adjustment-row output, #editor-canvas, .history-buttons { direction: ltr; }
#hue-shift { --range-colors: linear-gradient(to right, #f66868, #eddf55, #60c76b, #50d4de, #626bdd, #d962d0, #f66868); }
#saturation-shift { --range-colors: linear-gradient(to right, #b3b3b3, #769bc9, #086de8); }
#lightness-shift { --range-colors: linear-gradient(to right, #17243b, #8994a6, #fff); }
#grayscale-shift { --range-colors: linear-gradient(to right, #1769d2, #999); }
.adjustment-slider::-webkit-slider-runnable-track { height: 10px; border: 1px solid #7c8796; border-radius: 3px; background: var(--range-colors); }
.adjustment-slider::-moz-range-track { height: 8px; border: 1px solid #7c8796; border-radius: 3px; background: var(--range-colors); }
.adjustment-slider::-webkit-slider-thumb { appearance: none; width: 16px; height: 24px; margin-top: -8px; border: 2px solid #17243b; border-radius: 3px; background: white; }
.adjustment-slider::-moz-range-thumb { width: 12px; height: 20px; border: 2px solid #17243b; border-radius: 3px; background: white; }
.adjustment-slider:disabled { cursor: default; opacity: .45; }
.color-heading { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; margin-bottom: 8px; }
.color-heading > label { font-size: 14px; font-weight: 600; }
.selected-color { color: var(--muted); font-size: 11px; }
.color-inputs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
#color { width: 38px; height: 36px; padding: 2px; border: 1px solid #bdc9d9; background: white; border-radius: 3px; cursor: pointer; }
#color-hex { width: 88px; min-width: 0; height: 36px; border: 1px solid #bdc9d9; border-radius: 3px; padding: 6px 8px; color: var(--ink); font-size: 13px; }
#replace-color { min-height: 36px; padding: 6px 9px; background: white; border: 1px solid #bdc9d9; border-radius: 3px; color: var(--ink); font-size: 12px; }
#replace-color:hover { background: #edf4ff; }
.palette { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.palette button { width: 25px; height: 25px; padding: 0; border: 1px solid #9baabd; border-radius: 2px; box-shadow: inset 0 0 0 2px #fff5; }
.palette button[aria-pressed="true"], .palette button.active { outline: 2px solid var(--primary); outline-offset: 2px; }
.import-row { display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 18px; }
.texture-page .secondary-button { min-height: 38px; padding: 7px 13px; border: 1px solid #bdc9d9; background: white; color: var(--primary); font-size: 13px; font-weight: 600; white-space: nowrap; }
.secondary-button:hover { background: #edf4ff; }
.import-row p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.download-sidebar { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.download-panel { padding: 16px; }
#import-pack-button { width: 100%; margin-top: 14px; }
.small-note { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 10px !important; }
.download-panel label { display: block; margin: 14px 0 6px; font-size: 12px; }
#pack-name { width: 100%; min-width: 0; height: 38px; border: 1px solid #bdc9d9; border-radius: 3px; padding: 8px; font-size: 13px; color: var(--ink); }
.texture-page .primary-button { width: 100%; min-height: 40px; border: 1px solid var(--primary); padding: 8px 12px; margin-top: 12px; font-size: 14px; font-weight: 600; }
.local-note { font-size: 12px; line-height: 1.5; color: var(--muted); padding: 0 2px; }
.usage-help { margin-top: 28px; padding: 18px 0 0; border-top: 1px solid var(--border); }
.usage-help summary { color: var(--primary); font-size: 14px; cursor: pointer; width: fit-content; }
.help-content { max-width: 790px; margin-top: 16px; color: #45556b; font-size: 14px; }
.help-content ol { padding-inline-start: 22px; }
.help-content li { padding-inline-start: 4px; margin: 8px 0; }
.help-content p { margin-top: 12px; }
.texture-page .vcmc-footer { padding-top: 25px; }
.texture-page .vcmc-footer-inner { width: min(1120px, 100%); }
.texture-page .vcmc-footer-main { gap: 20px; padding-bottom: 16px; }
.texture-page .vcmc-footer-brand { font-size: 15px; font-weight: 600; }
.texture-page .vcmc-footer-brand img { width: 26px; height: 26px; border-radius: 4px; }
.texture-page .vcmc-footer-links a { font-size: 13px; font-weight: 400; }
.texture-page .vcmc-footer-legal { padding-top: 16px; font-size: 12px; }
.no-script { border: 1px solid #bdc9d9; padding: 16px; margin-bottom: 20px !important; }
@media (max-width: 1050px) {
    .workspace { grid-template-columns: 190px minmax(0, 1fr) 220px; gap: 14px; }
    .editor-panel { padding: 14px; }
    .canvas-stage { padding: 10px; }
    .help-link { display: none; }
    .texture-page .vcmc-brand span { display: none; }
}
@media (max-width: 900px) {
    .workspace { grid-template-columns: 190px minmax(0, 1fr); }
    .download-sidebar { grid-column: 1 / -1; }
    .local-note { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
    .texture-main { width: calc(100% - 32px); margin-top: 18px; }
    .texture-page .vcmc-nav-inner { width: calc(100% - 32px); gap: 14px; }
    .texture-page .vcmc-nav-links { gap: 14px; }
    .texture-page .vcmc-nav-links a { font-size: 12px; }
    .texture-page .vcmc-nav-links a[aria-current="page"] { display: inline; }
    .texture-page .vcmc-nav-links a:nth-child(2) { display: none; }
    .texture-page .vcmc-brand { font-size: 18px; }
    .page-heading { padding-bottom: 18px; }
    .page-heading p { font-size: 14px; }
    .workspace { display: flex; flex-direction: column; gap: 16px; }
    .texture-sidebar, .editor-panel, .download-sidebar { width: 100%; }
    .panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px; }
    .panel-heading #change-count { margin-top: 0; }
    .texture-list { display: grid; grid-template-columns: 1fr 1fr; padding: 5px; }
    .texture-list button { min-height: 48px; gap: 8px; padding: 7px; font-size: 12px; }
    .texture-list :is(canvas, img) { width: 28px; height: 28px; }
    .editor-panel { padding: 14px; }
    .editor-toolbar { gap: 6px; }
    .tool-buttons button { padding-inline: 8px; }
    .texture-page .vcmc-footer-links { gap: 14px; }
}
