/* Preset workspace uses the shared Vorkath theme; exported images use a game-style frame. */
.preset-page [hidden] { display: none !important; }
.preset-page textarea { font: inherit; color: inherit; resize: vertical; }
.preset-page .btn-primary { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.preset-page .btn { min-height: 38px; }
.preset-page button:disabled { opacity: .4; cursor: not-allowed; }
.preset-page input:focus-visible, .preset-page textarea:focus-visible, .preset-page select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.preset-shell { max-width: 1120px; margin: auto; padding: 16px 20px 28px; }
.preset-shell > .app-header { padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.preset-shell .brand-title, .preset-shell .brand-sub { display: block; }
.preset-muted { color: var(--text-2); font-size: 13px; }
.preset-eyebrow { color: var(--accent); font-size: 11px; letter-spacing: .14em; font-weight: 700; }
.preset-login { max-width: 480px; margin: 9vh auto; background: var(--surface); border: 1px solid var(--line-2); padding: 36px; border-radius: var(--r); }
.preset-login h1 { margin: 12px 0; font-size: 30px; line-height: 1.2; letter-spacing: -.04em; }
.preset-login > p { margin: 14px 0; color: var(--text-2); }
.preset-login form { display: grid; gap: 10px; margin: 28px 0 18px; }
.preset-login form .btn { margin-top: 12px; }
#preset-login-status { color: var(--warn); font-size: 13px; }
.preset-intro { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 18px 0 16px; }
.preset-intro h1 { font-size: 27px; letter-spacing: -.04em; margin: 4px 0; }
.preset-admin-chip { border: 1px solid rgba(var(--accent-rgb), .25); background: rgba(var(--accent-rgb), .08); color: var(--accent); border-radius: 20px; padding: 6px 14px; font-size: 12px; }
.preset-toolbar { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.preset-title-field { display: grid; gap: 6px; min-width: 260px; flex: 1; max-width: 460px; font-size: 12px; color: var(--text-2); }
.preset-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-preview-panel { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px; }
.preset-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.preset-preview-scroll { overflow-x: auto; border-radius: 6px; background: #171713; }
.preset-preview { position: relative; width: 100%; min-width: 760px; container-type: inline-size; }
#preset-canvas { width: 100%; height: auto; display: block; }
#preset-hitboxes { position: absolute; inset: 0; }
.preset-hitbox { position: absolute; border: 2px solid transparent; border-radius: 3px; }
.preset-hitbox:hover, .preset-hitbox:focus-visible { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); outline-offset: 0; }
#preset-status { font-size: 12px; color: var(--text-2); padding-top: 12px; min-height: 30px; overflow-wrap: anywhere; }
.preset-edit-panels { margin-top: 20px; }
.preset-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 20px; min-width: 0; }
.preset-section-heading { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.preset-section-heading h2 { font-size: 16px; margin-bottom: 4px; }
.preset-toggle { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12px; color: var(--text-2); }
.preset-toggle input { accent-color: var(--accent); width: 15px; height: 15px; }
.preset-row-editor { position: absolute; display: grid; grid-template-columns: var(--left-icons-width, 5cqw) minmax(0, 1fr) var(--right-icons-width, 5cqw); gap: 0; align-items: center; padding: 0 .277778cqw 0 .416667cqw; background: #22211c url('/src/preset-assets/background.png') repeat; border-bottom: 1px solid #49402c; pointer-events: auto; }
.preset-row-editor textarea { margin: 0 1.805556cqw 0 .972222cqw; height: 85%; min-height: 0; padding: .8cqw 0; align-content: center; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #eee6cf; font: 1.6667cqw/1.22 Georgia, serif; resize: none; box-shadow: none; }
.preset-row-editor textarea:hover { border-color: #756442; }
.preset-row-editor textarea::placeholder { color: #8c8879; font: clamp(11px, 1.05cqw, 15px)/1.4 var(--font); }
.preset-item-button { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-2); font-size: 22px; color: var(--text-3); }
.preset-item-button:hover { border-color: var(--accent); }
.preset-item-button img { max-width: 38px; max-height: 38px; image-rendering: pixelated; }
.preset-row-actions { position: absolute; right: 0; top: 0; display: flex; opacity: 0; background: #22211c; border-radius: 4px; }
.preset-row-editor:hover .preset-row-actions, .preset-row-editor:focus-within .preset-row-actions { opacity: 1; }
.preset-row-actions .btn { min-height: 20px; padding: 0 6px; font-size: 12px; }
.preset-row-icon-group > .preset-item-button { width: 100%; height: 5cqw; background: transparent; border-color: transparent; }
.preset-row-icon-group > .preset-item-button:hover { border-color: var(--accent); }
.preset-row-editor .preset-item-button img { width: auto; height: auto; max-width: 4.3cqw; max-height: 4.3cqw; }
#preset-inline-rows { position: absolute; inset: 0; pointer-events: none; }
#preset-row-drop-area { position: absolute; pointer-events: auto; }
.preset-drop-active { outline: 2px dashed var(--accent) !important; outline-offset: -3px; background-color: rgba(var(--accent-rgb), .12) !important; }
#preset-row-drop-area.preset-drop-active::after { content: 'Drop on the left or right to add an item'; position: absolute; bottom: 18px; left: 12px; right: 12px; text-align: center; color: var(--accent); font-size: 12px; }
.preset-row-suggestions { position: fixed; z-index: 100; max-height: 280px; overflow-y: auto; padding: 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); }
.preset-row-suggestions > p { margin: 0 0 8px; font-size: 12px; }
.preset-row-suggestion { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 7px; align-items: center; padding: 5px 0; border-top: 1px solid var(--line); }
.preset-row-suggestion > span { font-size: 12px; overflow-wrap: anywhere; }
.preset-row-suggestion .preset-item-button { width: 36px; height: 36px; }
.preset-row-suggestion .preset-item-button img { max-width: 30px; max-height: 30px; }
.preset-row-suggestion .btn { padding: 5px 8px; font-size: 12px; }
.preset-notes-suggestions .preset-search-item { width: 100%; margin-top: 5px; min-height: 48px; }
#preset-add-row { position: absolute; pointer-events: auto; border: 1px dashed #625940; border-radius: 7px; min-height: 0; padding: 0; color: #aca593; font-size: clamp(11px, 1.1cqw, 16px); background: rgba(20, 19, 16, .4); }
#preset-add-row:hover { color: #eee6cf; border-color: #af945e; background: rgba(117, 100, 66, .15); }
.preset-extra-add { color: #777363; font-size: 2.4cqw; }
@media (hover: none) { .preset-row-actions { opacity: 1; } }
.preset-section-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; }
.preset-notes { width: 100%; min-height: 210px; margin-bottom: 12px; line-height: 1.65; }
.preset-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--text-3); font-size: 11px; padding-top: 22px; }
.preset-footer a { color: var(--text-2); text-decoration: underline; }
.preset-picker { margin: auto; width: min(760px, calc(100vw - 32px)); max-height: 88vh; padding: 24px; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); }
.preset-picker::backdrop { background: rgba(0, 0, 0, .78); backdrop-filter: blur(4px); }
.preset-picker > label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-2); }
.preset-picker > .input { width: 100%; }
.preset-search-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; margin: 14px 0; }
.preset-search-filters > label:first-child { display: grid; gap: 4px; font-size: 12px; flex: 1; }
.preset-search-filters select { min-width: 180px; max-width: 100%; }
.preset-search-results { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 46vh; overflow: auto; }
.preset-search-item { display: flex; align-items: center; gap: 12px; min-height: 64px; min-width: 0; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: left; }
.preset-search-item:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.preset-search-item > img { width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; }
.preset-search-item > span { min-width: 0; }
.preset-search-item strong, .preset-search-item small { display: block; overflow-wrap: anywhere; }
.preset-search-item strong { font-size: 12px; line-height: 1.4; }
.preset-search-item small { font-size: 11px; margin-top: 4px; }
.preset-picker-footer { display: flex; justify-content: space-between; margin-top: 16px; }
.preset-image-importer { width: min(820px, calc(100vw - 32px)); overflow-y: auto; }
.preset-image-importer p { margin: 12px 0; line-height: 1.5; }
.preset-image-importer input[type="file"] { display: block; margin: 10px 0 18px; max-width: 100%; }
.preset-image-setup > label { display: grid; gap: 6px; }
.preset-image-setup > canvas { display: block; max-width: 100%; max-height: 440px; width: auto; height: auto; margin: 14px auto; cursor: crosshair; touch-action: none; }
.preset-image-crop { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.preset-image-crop label { display: grid; gap: 4px; width: 90px; font-size: 12px; }
.preset-image-crop input { width: 100%; }
.preset-image-match { display: grid; grid-template-columns: 40px minmax(0, 1fr) 32px auto; column-gap: 12px; row-gap: 8px; align-items: center; padding: 12px 0; }
.preset-image-review-group > h4 { display: flex; align-items: center; gap: 12px; margin: 18px 0 8px; font-size: 13px; color: var(--text-2); }
.preset-image-review-group > h4::after { content: ''; height: 1px; flex: 1; background: var(--line-2); }
#preset-image-checking { color: var(--warn); }
.preset-image-review-group + .preset-image-review-group { margin-top: 18px; }
.preset-image-original { grid-column: 1; grid-row: 1; width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.preset-image-selected { grid-column: 3; grid-row: 1; width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }
.preset-image-choice { grid-column: 2; grid-row: 1; display: grid; gap: 4px; min-width: 0; }
.preset-image-choice label { color: var(--text-2); font-size: 11px; }
.preset-image-choice select { min-width: 0; width: 100%; font-size: 13px; }
.preset-image-search-toggle { grid-column: 4; grid-row: 1; min-width: 70px; padding: 8px; color: var(--accent); }
.preset-image-search { grid-column: 1 / -1; min-width: 0; }
.preset-image-search > input { width: 100%; }
.preset-image-search-results { max-height: min(280px, 35vh); overflow-y: auto; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-2); margin-top: 4px; }
.preset-image-search-results .preset-search-item { border: 0; border-radius: 0; min-height: 42px; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.preset-image-search-results .preset-search-item > img { width: 28px; height: 28px; }
.preset-image-search-results [aria-selected="true"], .preset-image-search-results .preset-search-item:hover { background: rgba(var(--accent-rgb), .16); }
.preset-image-search-results > p { padding: 0 12px; }
.preset-image-contribute { grid-column: 1 / -1; justify-self: start; min-height: 0; padding: 4px 0; border: 0; background: none; color: var(--accent); font-size: 11px; }
.preset-image-importer > .preset-picker-footer { position: sticky; bottom: -24px; background: var(--surface); padding: 14px 0; border-top: 1px solid var(--line-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 850px) { .preset-shell { padding: 16px; } .preset-edit-panels { grid-template-columns: 1fr; } .preset-toolbar-actions { width: 100%; } .preset-intro h1 { font-size: 27px; } }
@media (max-width: 520px) { .preset-shell { padding: 12px; } .preset-login { padding: 24px; } .preset-intro { align-items: start; flex-direction: column; } .preset-card { padding: 14px; } .preset-preview-panel { padding: 10px; } .preset-preview-head { align-items: start; flex-direction: column; } .preset-search-results { grid-template-columns: 1fr; } .preset-item-button { width: 40px; height: 40px; } .preset-picker { padding: 16px; } }

.preset-row-icon-group { position: relative; display: grid; grid-template-columns: repeat(var(--icon-columns, 1), minmax(0, 1fr)); align-items: center; }
.preset-row-add-icon { position: absolute; bottom: -1cqw; right: 0; width: 1.8cqw; height: 1.4cqw; min-width: 22px; min-height: 18px; border: 1px solid #756442; border-radius: 4px; background: #22211c; color: #c9ac71; font-size: 14px; line-height: 1; }
.preset-row-add-icon:hover, .preset-row-add-icon:focus-visible { border-color: var(--accent); color: var(--accent); }

.preset-image-manual { margin-top: 14px; }
.preset-image-manual [data-step][aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.preset-image-manual [data-arrangement-label]:not([hidden]) { display: grid; gap: 6px; margin: 12px 0; }
.preset-image-manual [data-grid] { margin-top: 12px; }
.preset-item-contribution form { display: grid; gap: 14px; }
.preset-item-contribution label { display: grid; gap: 6px; }
.preset-contribution-icons { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-contribution-icons img { image-rendering: pixelated; }
.preset-contribution-icons [aria-pressed="true"] { outline: 2px solid var(--accent, #7995ff); }

@media (max-width: 520px) { .preset-image-match { column-gap: 7px; grid-template-columns: 32px minmax(0, 1fr) 28px auto; } .preset-image-original { width: 32px; height: 32px; } .preset-image-selected { width: 28px; height: 28px; } .preset-image-search-toggle { min-width: 52px; padding: 6px 2px; font-size: 12px; } .preset-image-importer > .preset-picker-footer { bottom: -16px; } }
