.kit-skip { position: fixed; top: -60px; left: 12px; z-index: 100; padding: 8px 12px; background: var(--panel); }
.kit-skip:focus { top: 8px; }
.file-button { display: inline-flex; align-items: center; cursor: pointer; }
.file-button:hover { background: var(--panel-2); color: var(--text); border-radius: 6px; }
.file-button:active { background: var(--panel-3); }
.file-button:focus-within { outline: 2px solid var(--accent-strong); }
.kit-workspace { display: grid; grid-template-columns: minmax(300px,.85fr) minmax(610px,1.5fr); gap: 24px; height: calc(100dvh - 198px); min-height: 580px; }
.kit-source { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.kit-preview-column { --preview-gap: 22px; display: grid; grid-template-columns: minmax(0,1fr) clamp(220px,28%,360px); grid-template-rows: minmax(0,1fr); gap: var(--preview-gap); min-width: 0; min-height: 0; }
.kit-preview-top { display: flex; flex-direction: column; gap: 16px; min-width: 0; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; }
.kit-preview-top > * { flex-shrink: 0; width: 100%; }
.kit-inventory-panel { min-width: 0; }
.kit-inventory-heading, .item-browser-heading { display: flex; align-items: center; gap: 12px; min-height: 30px; margin: 0 0 8px; }
.kit-inventory-heading { justify-content: space-between; }
.kit-inventory-heading span, .item-browser-heading > span { color: var(--muted); font-size: calc(11px + var(--reading-increase)); }
#inventory { width: 100%; max-width: 352px; margin: 0 auto; }
.inventory-selection { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 8px; }
.inventory-selection button { padding: 3px 5px; min-height: 26px; font-size: calc(11px + var(--reading-increase)); }
#select-slots[aria-pressed=true] { color: var(--accent-strong); background: var(--panel-2); }
#selection-count { color: var(--accent-strong); font-size: calc(11px + var(--reading-increase)); }
#selection-count:empty { display: none; }
#delete-selected, #clear-inventory { color: #dba5a5; }
.inventory-instructions { margin: 8px 0 0; font-size: calc(11px + var(--reading-increase)); }
.slot-inspector { min-width: 0; padding: 12px 2px 4px; border-top: 1px solid var(--line-soft); }
.slot-heading { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 0 8px; }
.slot-heading > div:nth-child(2) { min-width: 0; }
.slot-heading h2 { font-size: 14px; }
#selected-name { display: block; color: var(--muted); font-size: calc(12px + var(--reading-increase)); overflow-wrap: anywhere; }
#selected-icon { width: 32px; min-width: 32px; height: 32px; }
#clear-slot { margin-left: auto; padding: 4px 6px; color: var(--muted); }
.slot-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 7px; font: calc(11px + var(--reading-increase)) Monocraft,monospace; }
.slot-controls label { display: flex; align-items: center; gap: 6px; }
.slot-controls input { width: 54px; padding: 4px; }
.slot-controls button { padding: 4px 6px; min-height: 28px; font-size: calc(11px + var(--reading-increase)); }
#set-start[aria-pressed=true] { color: var(--accent-strong); }
.slot-copy-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 8px; }
.slot-copy-actions button { min-height: 28px; padding: 4px 6px; font-size: calc(12px + var(--reading-increase)); }
#slot-clipboard { font-size: calc(11px + var(--reading-increase)); color: var(--muted); overflow-wrap: anywhere; }
.item-id-control { margin-bottom: 5px; font-size: calc(12px + var(--reading-increase)); }
.item-id-control input { width: 100%; min-width: 0; padding: 7px; }
.item-id-control input, #components { font: 11px/1.7 Monocraft,monospace; }
.item-id-actions { display: flex; gap: 8px; }
.item-id-actions button, #apply-components { padding: 4px 6px; min-height: 28px; font-size: calc(12px + var(--reading-increase)); }
#carried-stack { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; color: var(--text); font: 11px/1.6 Monocraft,monospace; }
#carried-stack button { padding: 3px 6px; min-height: 26px; font-size: calc(11px + var(--reading-increase)); }
#carried-label { flex: 1 1 160px; }
#delete-item-dialog { width: min(420px,calc(100vw - 32px)); padding: 22px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
#delete-item-dialog::backdrop { background: rgba(0,0,0,.65); }
#delete-item-heading { font-size: 18px; margin-bottom: 12px; }
#delete-item-message { font-size: calc(13px + var(--reading-increase)); line-height: 1.7; overflow-wrap: anywhere; }
.delete-item-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
#confirm-delete { color: #f2a2a2; }
#lore-editor { border-top: 1px solid var(--line-soft); padding-top: 10px; margin-top: 9px; }
#lore-heading { margin: 0 0 8px; font-size: calc(12px + var(--reading-increase)); font-weight: 400; }
.lore-line { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px; margin-bottom: 12px; }
.lore-line textarea { min-width: 0; resize: vertical; font: calc(12px + var(--reading-increase))/1.7 Monocraft,monospace; }
.lore-format { grid-column: 1/-1; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.lore-format select { width: 130px; min-width: 0; padding: 4px; font-size: calc(12px + var(--reading-increase)); }
.lore-format input[type=color] { width: 30px; height: 28px; padding: 2px; }
.lore-line button, #add-lore-line { padding: 4px 6px; min-height: 28px; font-size: calc(12px + var(--reading-increase)); }
#lore-editor .hint { margin: 6px 0 0; }
#lore-status:empty { display: none; }
#component-details { border-top: 1px solid var(--line-soft); padding-top: 6px; margin-top: 9px; font-size: calc(12px + var(--reading-increase)); }
#component-details summary { cursor: pointer; padding: 3px 0; }
#component-state { color: var(--warn); font-size: calc(11px + var(--reading-increase)); margin-left: 8px; }
#components { font-size: var(--json-font-size); margin: 8px 0 4px; min-height: 110px; white-space: pre-wrap; overflow-wrap: anywhere; }
.kit-library { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.item-browser-frame { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 72px; }
.mod-drop-overlay { position: absolute; inset: 0; z-index: 1; display: none; place-items: center; padding: 16px; pointer-events: none; border: 2px dashed var(--accent-strong); background: color-mix(in srgb,var(--panel) 92%,transparent); color: var(--text); font-size: calc(16px + var(--reading-increase)); text-align: center; }
.kit-library:is(.mod-drag-over,.mod-importing) .mod-drop-overlay { display: grid; }
.mod-drop-progress, .mod-importing .mod-drop-prompt { display: none; }
.mod-importing .mod-drop-overlay { border-style: solid; }
.mod-importing .mod-drop-progress { display: grid; justify-items: center; gap: 12px; }
.mod-drop-spinner { width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--accent-strong); border-radius: 50%; animation: mod-drop-spin .8s linear infinite; }
@keyframes mod-drop-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .mod-drop-spinner { animation: none; } }
.mod-import { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 8px 0 0; }
.mod-import button { padding: 3px 8px; min-height: 28px; font-size: calc(12px + var(--reading-increase)); }
#mod-import-status { color: var(--muted); font-size: calc(12px + var(--reading-increase)); overflow-wrap: anywhere; }
.item-browser-heading { margin: 0; gap: 6px; flex-wrap: wrap; }
.kit-help { position: relative; margin-left: auto; font-size: calc(12px + var(--reading-increase)); }
.kit-help summary { color: var(--muted); cursor: pointer; }
.kit-help > div { position: absolute; z-index: 5; right: 0; top: 28px; width: 290px; max-width: 80vw; background: var(--panel-2); border: 1px solid var(--line); padding: 14px; color: var(--text); font-size: calc(12px + var(--reading-increase)); line-height: 1.65; }
.item-search { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; margin: 8px 0 10px; }
.item-search input { min-width: 0; flex: 1; }
.item-search input, .item-search select { font: calc(11px + var(--reading-increase)) Monocraft,monospace; }
.item-search select { grid-column: 1/-1; width: 100%; max-width: none; }
.item-search button { padding: 4px 8px; font-size: calc(12px + var(--reading-increase)); }
#item-browser { display: grid; grid-template-columns: repeat(auto-fill,minmax(38px,1fr)); align-content: start; gap: 4px; flex: 1; min-height: 0; overflow-y: hidden; padding: 2px 4px 2px 2px; }
.item-choice { cursor: grab; height: 40px; min-width: 0; padding: 0; border: 1px solid var(--line-soft); border-radius: 0; background: var(--code); }
.item-choice:hover, .item-choice:focus-visible { background: var(--panel-2); border-color: var(--line); }
.item-choice[aria-pressed=true] { border-color: var(--accent-strong); background: var(--panel-3); }
.item-empty { grid-column: 1/-1; padding: 12px 0; color: var(--muted); font-size: calc(13px + var(--reading-increase)); }
.item-empty button { padding-left: 0; }
.browser-pages { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; color: var(--muted); font-size: calc(11px + var(--reading-increase)); }
.browser-pages button { padding: 3px 8px; min-height: 28px; font-size: calc(12px + var(--reading-increase)); }
.kit-feedback { max-height: 150px; overflow: auto; }
#warnings, #pending-edits { color: var(--warn); }
#status { color: var(--accent-strong); }
#pending-edits { padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: calc(11px + var(--reading-increase)); }
#pending-edits button { padding: 2px 6px; min-height: 25px; font-size: calc(11px + var(--reading-increase)); }
#restore { font-size: calc(12px + var(--reading-increase)); }
#details-panel { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
#details-panel input, #details-panel select, #details-panel textarea { font-family: Monocraft,monospace; font-size: 12px; }
#details-panel input:not([type=checkbox]), #details-panel select { height: 34px; min-width: 0; line-height: 1.5; }
.kit-setting-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: end; gap: 12px; }
.kit-setting-row .stack { min-width: 0; }
#details-panel #order { width: 100%; }
.kit-stat-section { padding: 16px 0; border-top: 1px solid var(--line-soft); }
.kit-stat-section h3 { margin: 0 0 12px; font-size: 15px; }
.kit-stat-section .hint { margin: 8px 0 0; }
.kit-stat-fields { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px 16px; }
.kit-stat-fields > .stack { flex: 1 1 150px; min-width: 0; margin: 0; }
#kit-stat-coins { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,128px),1fr)); }
.kit-stat-label { display: flex; align-items: center; gap: 8px; }
.kit-stat-label img { width: 18px; height: 18px; image-rendering: pixelated; }
.kit-stat-label img[src*="/numismatic/"] { width: 16px; height: 16px; }
.kit-stat-modifier { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
.kit-stat-modifier > .stack { flex: 1 1 120px; min-width: 0; margin: 0; }
#kit-stat-builtins { margin-top: 12px; }
#kit-stat-builtins > .kit-stat-modifier { flex: 1 1 240px; }
#kit-stat-builtins .stack { flex-basis: 88px; }
.kit-stat-modifier .kit-stat-id { flex-basis: 100%; overflow-wrap: anywhere; }
#kit-stat-attributes .kit-stat-modifier { padding-bottom: 12px; }
#kit-stat-add-form { margin-top: 8px; }
.kit-stat-modifier button, .kit-coin-stepper button { min-height: 34px; }
.kit-purse-icon {
  width: 22px;
  height: 26px;
  background: url("assets/numismatic/purse_widget.png") -124px 0 / 256px 128px no-repeat;
  image-rendering: pixelated;
}
.kit-coin-stepper { display: grid; grid-template-columns: 32px minmax(0,1fr) 32px; gap: 4px; margin-top: 6px; }
.kit-coin-stepper button { padding: 0; }
.kit-coin-stepper input { width: 100%; appearance: textfield; text-align: right; }
.kit-coin-stepper input::-webkit-inner-spin-button { appearance: none; }
#equipment { margin: 14px 0; }
.equipment-entry { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 55px; gap: 6px; border-top: 1px solid var(--line-soft); padding: 12px 0; }
.equipment-entry label { font-size: calc(11px + var(--reading-increase)); color: var(--muted); min-width: 0; }
#details-panel .equipment-entry input:not([type=checkbox]), #details-panel .equipment-entry select { width: 100%; height: 30px; padding: 5px; }
.equipment-entry .equipment-id { grid-column: 1/3; }
.equipment-entry .check { grid-column: 1/3; margin: 0; }
.equipment-entry button { padding: 4px; font-size: calc(11px + var(--reading-increase)); }
.equipment-entry input[type=checkbox] { width: 15px; }
@media(min-width:1100px) { .kit-workspace { grid-template-columns: minmax(250px,.85fr) minmax(786px,1.5fr); gap: 20px; } }
@media(max-width:960px) {
  .kit-workspace { grid-template-columns: minmax(0,1fr); height: auto; min-height: 0; }
  .kit-preview-column { grid-row: 1; height: calc(100dvh - 158px); min-height: 650px; }
  .kit-source { min-height: 600px; }
}
@media(min-width:801px) { .kit-editor .kit-preview-top { margin-inline-end: calc(var(--preview-gap) / -2); padding-inline-end: calc(var(--preview-gap) / 2); } }
@media(max-width:800px) {
  .kit-preview-column { grid-template-columns: minmax(0,1fr); grid-template-rows: auto 360px; height: auto; min-height: 0; }
  .kit-preview-top { overflow: visible; padding-right: 0; }
}
@media(max-width:620px) {
  .kit-preview-top { gap: 18px; }
  .slot-inspector { max-height: none; overflow: visible; }
  .slot-heading { min-height: 36px; }
  .slot-copy-actions { margin-bottom: 6px; }
  .item-search { gap: 6px; }
  .kit-preview-column { grid-template-rows: auto 300px; }
  .kit-workspace { gap: 20px; }
}

.stack-limit-option { margin: 8px 0; }

#shop-panel { min-width: 0; container: shop-panel / inline-size; }
.shop-heading, .shop-add-form, .shop-page-nav { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px 16px; }
.shop-heading { justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.shop-heading h2 { margin: 0 0 6px; }
.shop-heading-actions { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px 12px; }
.shop-heading p, .shop-heading .stack, .shop-add-form .stack { margin: 0; }
.shop-budget { width: 144px; }
.shop-columns { width: 76px; }
.shop-heading input, .shop-add-form input { width: 100%; }
.shop-add-form { margin-bottom: 16px; }
.shop-sections { margin-bottom: 16px; }
#author-workspace #shop-section-list { display: grid; gap: 8px; list-style: none; padding: 0; }
.shop-section-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.shop-section-row .stack { flex: 1 1 140px; margin: 0; min-width: 0; }
.shop-section-row input { width: 100%; }
.shop-offer-section, .shop-offer-slot { grid-column: 1 / -1; }
.shop-offer-section select { width: 100%; min-width: 0; }
.shop-add-form .stack { flex: 1 1 180px; min-width: 0; max-width: 360px; }
#shop-status[data-error=true] { color: var(--danger, #e6a3a3); }
.shop-page-nav { align-items: center; margin: 0 0 12px; }
.shop-page-nav span { color: var(--muted); }
.shop-workspace { display: grid; grid-template-columns: minmax(0,1fr); align-items: start; }
.shop-pages { display: contents; }
#author-workspace .shop-offers { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; min-width: 0; container: shop-offer-list / inline-size; }
.shop-offer { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.shop-offer[data-selected=true] { border-bottom-color: var(--accent-strong); }
.shop-offer-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.shop-offer-number { font-size: calc(11px + var(--reading-increase)); color: var(--muted); }
.shop-offer-name { overflow-wrap: anywhere; }
.shop-offer-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.shop-offer-fields label { display: grid; min-width: 0; gap: 4px; color: var(--muted); font-size: calc(12px + var(--reading-increase)); }
.shop-offer-fields input { width: 100%; min-width: 0; padding: 4px; }
#author-workspace .shop-budget-hint { grid-column: 2 / -1; margin: 0; }
#author-workspace .shop-budget-hint[data-field=cost] { color: var(--danger, #e6a3a3); }
.shop-offer-actions { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.shop-offer-actions button, .shop-page-nav button { padding: 4px 8px; min-height: 28px; font-size: calc(12px + var(--reading-increase)); }
.shop-preview { --shop-scale: 1.5; --shop-slot-size: calc(36px * var(--shop-scale)); }
.shop-preview-wide { --shop-scale: 1; }
.shop-preview h2 { margin: 0 0 16px; }
.shop-preview-stock { display: flex; width: max-content; max-width: 100%; margin-inline: auto; overflow-x: auto; }
.shop-inline-tabs { flex: 0 0 calc(64px * var(--shop-scale)); max-height: calc(332px * var(--shop-scale)); overflow: hidden auto; scrollbar-width: thin; }
#author-workspace #shop-inline-tabs .shop-inline-tab {
  position: relative; display: grid; place-items: center; width: calc(56px * var(--shop-scale)); height: calc(52px * var(--shop-scale)); min-height: 0;
  margin: 0 0 calc(2px * var(--shop-scale)); padding: 0; border: 0; border-radius: 0; background: none;
}
.shop-inline-tab::before {
  position: absolute; inset: 0 auto auto 0; width: calc(52px * var(--shop-scale)); height: calc(64px * var(--shop-scale)); content: '';
  background: url('../pack/assets/tab_top_unselected_1.png') center / 100% 100%; image-rendering: pixelated;
  transform-origin: 0 0; transform: rotate(-90deg) scaleX(-1);
}
.shop-inline-tab[aria-pressed=true] { z-index: 2; }
.shop-inline-tab[aria-pressed=true]::before { background-image: url('../pack/assets/tab_top_selected_2.png'); }
.shop-inline-tab:first-child[aria-pressed=true]::before { background-image: url('../pack/assets/tab_top_selected_1.png'); }
.shop-inline-tabs:not([hidden]) + .shop-tray { position: relative; z-index: 1; margin-left: calc(-8px * var(--shop-scale)); }
.shop-inline-tab-icon { position: relative; left: calc(4px * var(--shop-scale)); }
.shop-preview-stock .mc-item { transform: scale(var(--shop-scale)); }
#author-workspace #shop-inline-tabs .shop-inline-tab[aria-pressed=true]:focus-visible { outline: none; }
.shop-tray { position: relative; box-sizing: border-box; flex: 0 0 auto; display: grid; grid-template-columns: repeat(var(--shop-columns,4),var(--shop-slot-size)); grid-template-rows: repeat(8,var(--shop-slot-size)); padding: calc(22px * var(--shop-scale)) calc(14px * var(--shop-scale)); }
#shop-tray-panel { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
.shop-tray .shop-cell { position: relative; display: grid; place-items: center; width: 100%; min-width: 0; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.shop-tray .shop-cell:is(:focus-visible,[aria-pressed=true]) { outline: 2px solid #ffe2a0; outline-offset: -2px; }
.shop-tray .shop-cell:hover { background: #ffffff36; }
.shop-tray[data-editable=true] button.shop-cell, .shop-offers[data-editable=true] .shop-offer-item { cursor: grab; touch-action: none; }
.mc-dragging :is(.shop-tray[data-editable=true] button.shop-cell,.shop-offers[data-editable=true] .shop-offer-item) { cursor: grabbing; }
.shop-offer.mc-drop-target { border-bottom-color: var(--accent-strong); outline: 1px solid var(--accent-strong); }
.shop-tray .shop-cell.mc-drop-target { background: #ffffff80; outline: 1px solid #fff; outline-offset: -1px; }
.shop-cell-count, .shop-cell-cost { position: absolute; pointer-events: none; font: 12px/1 Monocraft,monospace; text-shadow: 1px 1px #292929; }
.shop-cell-count { right: 2px; bottom: 2px; color: #fff; }
.shop-cell-cost { top: 2px; left: 2px; color: #ffc45b; }
#author-workspace .shop-narrow-jump { display: none !important; }
@media(max-width:800px) {
  .kit-editor[data-author-stage=shop] #author-workspace .shop-narrow-jump { display: inline-flex !important; }
  .kit-editor[data-author-stage=shop] #author-workspace #shop-edit-offers { align-self: flex-start; margin-top: 8px; }
}
.kit-editor[data-author-stage=shop] .kit-help { visibility: hidden; }
.kit-editor[data-author-stage=shop] .item-choice { cursor: pointer; }
@container shop-offer-list (min-width: 340px) {
  .shop-offer-fields { grid-template-columns: repeat(6,minmax(0,1fr)); }
  .shop-offer-fields > label { grid-column: span 2; }
  .shop-offer-fields :is(.shop-offer-section,.shop-offer-slot) { grid-column: span 3; }
  #author-workspace .shop-budget-hint { grid-column: 1 / -1; }
}
@container shop-offer-list (min-width: 570px) {
  .shop-offer { grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px 12px; }
  .shop-offer-item { grid-column: 1 / -1; }
  #author-workspace .shop-offer-actions button { padding-inline: 8px; }
}
@container shop-panel (max-width: 660px) {
  .shop-preview { --shop-scale: 1; }
}
@container shop-panel (width > 520px) {
  .shop-workspace:has(.shop-preview:not(.shop-preview-wide)) { grid-template-columns: minmax(0,1fr) max-content; grid-template-rows: auto auto 1fr; }
  .shop-setup, .shop-page-nav, .shop-offers { grid-column: 1; }
  .shop-preview:not(.shop-preview-wide) { grid-area: 1 / 2 / span 3; margin-inline-start: 24px; position: sticky; top: 0; }
}
@container shop-panel (width > 740px) {
  .shop-workspace:has(.shop-preview-wide) { grid-template-columns: minmax(0,1fr) max-content; grid-template-rows: auto auto 1fr; }
  .shop-preview-wide { grid-area: 1 / 2 / span 3; margin-inline-start: 24px; position: sticky; top: 0; }
}
