/* Oficina de craft: materials, the 10×5 bag and the inspected item (simulator.js renders the inside). */

.oficina-page .page-head { margin-bottom: 28px; }
#help-open { margin-top: 22px; }
#help-open span { display: inline-grid; place-items: center; width: 20px; height: 20px; font: 500 12px var(--f-data); border: 1px solid currentColor; border-radius: 50%; }

.workshop { display: grid; grid-template-columns: 290px minmax(490px, 1fr) 320px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 20px 16px; }
.section-head h2 { font-size: 26px; }
.section-head .eyebrow { margin-bottom: 4px; }
.count { font: 500 12.5px var(--f-data); white-space: nowrap; color: var(--ink-3); }

/* materials */
.materials-panel { align-self: stretch; background: linear-gradient(145deg, rgba(38, 34, 25, .6), transparent 40%); border-right: 1px solid var(--line); }
.material-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 0 14px; }
.material-tabs button { padding: 6px 0; font: 500 12px/1 var(--f-data); color: var(--ink-2); background: transparent; border-radius: 999px; }
.material-tabs button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1a160d; }
.search { display: block; margin: 14px 16px; }
.search input { width: 100%; }
.materials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 700px; padding: 0 13px; overflow: auto; align-content: start; scrollbar-width: thin; }
.material { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 6px 2px 8px; background: transparent; border: 1px solid transparent; }
.material-art { display: block; width: 66px; height: 66px; background: radial-gradient(ellipse, rgba(57, 48, 33, .5), transparent 72%); }
.material svg, .material img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 2px #000); }
.material-name { min-height: 30px; font-size: 13px; line-height: 1.3; color: var(--ink-2); overflow-wrap: anywhere; }
.material[aria-pressed="true"] { background: rgba(215, 180, 106, .14); border-color: var(--gold); }
.material.ineligible { opacity: .5; }
.material:hover { opacity: 1; }
.material-note { margin: 18px; }
.small { font-size: 14px; line-height: 1.5; color: var(--ink-3); }

/* bag */
.bench-panel { min-width: 0; background: radial-gradient(ellipse at 50% 0, rgba(215, 180, 106, .08), transparent 65%); }
.bag-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 20px; }
.bag-tools .quiet { margin-left: auto; }
.bag-tools .quiet ~ .quiet { margin-left: 0; }
.bag-scroll { padding: 0 18px; overflow: auto; }
.bag { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(5, 1fr); width: 100%; aspect-ratio: 2; background: #080a07; border: 1px solid var(--line-2); box-shadow: 0 0 0 3px var(--bg-deep), 0 0 0 4px var(--line), inset 0 0 35px #000; }
.bag-cell { min-width: 0; min-height: 0; border-right: 1px solid #2d2a20; border-bottom: 1px solid #2d2a20; }
.bag-item { position: absolute; z-index: 1; left: calc(var(--x) * 10%); top: calc(var(--y) * 20%); width: calc(var(--w) * 10%); height: calc(var(--h) * 20%); padding: 3px; overflow: hidden; cursor: grab; touch-action: manipulation; background: radial-gradient(ellipse at 50% 80%, color-mix(in srgb, var(--rarity), transparent 91%), #141510); border: 1px solid color-mix(in srgb, var(--rarity), transparent 50%); }
.bag-item svg, .bag-item img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(2px 4px 3px #000); }
.bag-item:hover, .bag-item.selected { z-index: 2; background-color: #2b2b1e; border-color: var(--gold); box-shadow: inset 0 0 18px rgba(170, 142, 37, .14); }
.bag-item.compatible { cursor: crosshair; border-color: #8dba8c; box-shadow: inset 0 0 15px rgba(90, 158, 65, .2); }
.bag-item.incompatible { cursor: not-allowed; opacity: .53; }
.bag-item.flash { animation: crafted .55s ease-out; }
.bag-item:focus-visible { outline-offset: -3px; }
@keyframes crafted { 0% { filter: brightness(2.4); box-shadow: 0 0 25px var(--gold); } 100% { filter: brightness(1); } }
.bag-sockets { position: absolute; left: 9px; bottom: 9px; display: flex; gap: 3px; }
.socket { width: 16px; height: 16px; border-radius: 50%; background: #050606; border: 2px solid #7d7355; box-shadow: 0 1px 2px #000; }
.socket.filled { background: radial-gradient(circle at 35% 25%, #c6e8b6, #608078 35%, #253c37 65%); }
.empty-bag { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; pointer-events: none; color: var(--ink-3); }
.empty-bag strong { font: 400 26px var(--f-display); color: var(--ink-2); }
.held { display: flex; align-items: center; gap: 15px; min-height: 91px; margin: 20px 19px 0; padding: 13px 0; border-block: 1px solid var(--line); }
.held-symbol { min-width: 48px; text-align: center; font: 400 40px var(--f-display); color: var(--gold-2); }
.held .held-art { flex: 0 0 55px; width: 55px; height: 55px; }
.held .held-art svg { width: 100%; height: 100%; }
.held strong { font-size: 15px; color: var(--ink); }
.held p { margin: 3px 0 0; font-size: 14px; color: var(--ink-3); }
.held button { margin-left: auto; padding: 6px 10px; font-size: 18px; background: transparent; }
.bench-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin: 12px 20px 23px; font: 400 12.5px var(--f-data); color: var(--ink-3); }
.divider { padding: 0 7px; color: var(--line-2); }
.chronicle { border-top: 1px solid var(--line); }
.chronicle h2 { font-size: 22px; }
.spent { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px; }
.spent-chip { display: flex; align-items: center; gap: 4px; padding: 2px 8px; font: 500 12.5px var(--f-data); border: 1px solid var(--line); border-radius: 999px; }
.spent-chip svg { width: 25px; height: 25px; }
.history { max-height: 240px; margin: 15px 20px 20px; padding: 0; overflow: auto; list-style: none; scrollbar-width: thin; }
.history li { padding: 11px 0; font-size: 14px; border-top: 1px solid var(--line); }
.history li > span { color: var(--gold); }
.history li small { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.history .empty-history { color: var(--ink-3); }

/* inspected item */
.inspection-panel { align-self: stretch; background: var(--bg-deep); border-left: 1px solid var(--line); }
.inspector { padding: 0 18px 24px; }
.inspection-empty { margin: 30px 4px; padding: 30px 14px; text-align: center; font-size: 14px; line-height: 1.8; color: var(--ink-3); border: 1px dashed var(--line-2); }
.inspection-empty span { display: block; margin-bottom: 16px; font: 400 50px var(--f-display); color: var(--gold-2); }
.item-preview { display: flex; align-items: center; justify-content: center; height: 180px; margin-bottom: 14px; background: radial-gradient(ellipse, rgba(105, 97, 66, .14), transparent 65%); }
.item-preview svg { width: 80%; height: 100%; filter: drop-shadow(3px 9px 5px rgba(0, 0, 0, .6)); }
.item-sheet { --rarity: #c8c8c8; }
.item-sheet h3 { font-size: 24px; color: var(--rarity); }
.item-type { margin: 5px 0 14px; font-size: 14px; color: var(--ink-3); }
.item-vitals { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0; padding: 11px 0; border-block: 1px solid var(--line); }
.item-vitals span { display: flex; flex-direction: column; font: 500 11px var(--f-data); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.item-vitals strong { font: 500 17px var(--f-data); letter-spacing: 0; text-transform: none; color: var(--ink); }
.mod-section { padding: 11px 0; border-bottom: 1px solid var(--line); }
.mod-section h4 { margin: 0 0 10px; font: 500 11.5px var(--f-data); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.mod-line { margin: 4px 0; font-size: 15px; line-height: 1.6; color: #aaaee0; }
.mod-line b { font-weight: 500; color: var(--ink); }
.mod-line small { display: block; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.mod-line .tier { display: inline-block; float: right; font: 500 12px var(--f-data); color: var(--gold-2); }
.implicit { color: #bdc6a4; }
.item-flags { margin-top: 13px; font-size: 14px; color: #dc9a7c; }
.item-flavor { margin-top: 13px; font: italic 16px/1.55 var(--f-fell); color: var(--ink-2); }
.inspector-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.inspector-actions button { font-size: 14px; }
.inspector-actions .danger { color: #e0a090; background: transparent; }
.tiers-link { display: inline-block; margin-top: 12px; font-size: 14px; }

/* dialogs, tooltip, toast */
.oficina-page ~ dialog { width: min(860px, 92vw); padding: 24px; }
dialog p { font-size: 15px; color: var(--ink-2); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dialog-head h2 { font-size: 28px; }
.dialog-head button { padding: 1px 10px; font-size: 26px; background: transparent; border: 0; }
.picker-filters { display: grid; grid-template-columns: 2fr 1fr 1.3fr 1.3fr .8fr; gap: 12px; }
.picker-filters label, #exchange label { display: block; font-size: 13.5px; color: var(--ink-3); }
.picker-filters input, .picker-filters select { display: block; width: 100%; margin-top: 5px; }
.picker-note { margin: 16px 0; }
.base-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.base-card { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px; text-align: left; background: var(--bg-deep); border-color: var(--line); }
.base-card svg { flex: 0 0 58px; width: 58px; height: 80px; }
.base-card strong { display: block; font-size: 14.5px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.base-card small { display: block; margin-top: 5px; font-size: 13px; color: var(--ink-3); }
.base-card:hover:not(:disabled) { background: var(--panel-2); }
#base-more { display: flex; margin: 18px auto 0; }
#exchange { max-width: 700px; }
#item-json { display: block; width: 100%; height: 280px; resize: vertical; font: 13px/1.5 var(--f-data); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.dialog-actions .button { display: inline-flex; align-items: center; padding: 8px 15px; border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--ink); }
#exchange-error { min-height: 20px; margin: 10px 0 0; color: #ef9d83; }
#affix-picker { max-width: 500px; }
#affix-options button { display: block; width: 100%; margin: 7px 0; padding: 14px; text-align: left; }
.steps { padding-left: 22px; color: var(--ink-2); }
.steps li { margin: 18px 0; padding-left: 9px; }
.steps strong { display: block; color: var(--ink); }
.tooltip { position: fixed; z-index: 90; width: 320px; max-width: calc(100vw - 20px); max-height: calc(100vh - 20px); padding: 18px; overflow: auto; pointer-events: none; background: rgba(16, 14, 10, .97); border: 1px solid var(--gold-line); border-radius: 4px; box-shadow: 0 10px 45px rgba(0, 0, 0, .7); }
.tooltip h3 { font-size: 23px; }
.tooltip .item-preview { height: 84px; margin-bottom: 10px; }
.tooltip p { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
.tooltip .blocked { color: #e6a18a; }
.tooltip .allowed { color: #b2d3a3; }
#cursor-art { position: fixed; z-index: 95; width: 40px; height: 40px; pointer-events: none; filter: drop-shadow(2px 2px 3px #000); }
#cursor-art svg { width: 100%; height: 100%; }
#toast { position: fixed; left: 50%; bottom: 24px; z-index: 120; max-width: min(580px, 90vw); padding: 13px 21px; font-size: 15px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--gold-line); border-radius: 4px; box-shadow: 0 9px 30px rgba(0, 0, 0, .6); transform: translateX(-50%); }
#toast.error { background: #37231e; border-color: #b57761; }
.future-note { grid-column: 1 / -1; padding: 20px 6px; }
.future-note h3 { margin-bottom: 12px; font-size: 24px; }
.future-note article { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.future-note strong { display: block; color: var(--ink); }
.future-note p { margin-top: 6px; font-size: 14px; color: var(--ink-3); }
.future-note small { display: block; font: 500 11.5px var(--f-data); letter-spacing: .1em; color: var(--gold-2); }

@media (min-width: 1700px) {
  .workshop { grid-template-columns: 300px minmax(490px, 1fr) 330px; }
  .materials { gap: 10px; }
  .material-art { width: 74px; height: 74px; }
}
@media (max-width: 1300px) {
  .workshop { grid-template-columns: 270px minmax(0, 1fr); }
  .materials-panel { grid-row: 1 / 3; }
  .inspection-panel { grid-column: 2; border-top: 1px solid var(--line); border-left: 0; }
  .inspector > .item-sheet { display: grid; grid-template-columns: 170px 1fr; gap: 0 24px; }
  .inspector .item-preview { grid-row: 1 / 7; height: 230px; }
  .inspector > .item-sheet > :not(.item-preview) { grid-column: 2; }
  .materials { max-height: 900px; }
  .bag { max-width: 700px; margin: auto; }
}
@media (max-width: 800px) {
  .workshop { grid-template-columns: 1fr; }
  .bench-panel { grid-row: 1; }
  .materials-panel { grid-row: 2; border-right: 0; border-top: 1px solid var(--line); }
  .inspection-panel { grid-column: 1; grid-row: 3; }
  .materials { grid-template-columns: repeat(5, minmax(0, 1fr)); max-height: 320px; }
  .material-art { width: 58px; height: 58px; }
  .material-tabs { max-width: 460px; }
  .section-head { padding: 18px 15px 14px; }
  .bag-tools { padding: 0 14px 18px; }
  .bag-tools button { padding: 7px 10px; font-size: 14px; }
  .bag-scroll { padding: 0 12px; }
  .base-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .picker-filters { grid-template-columns: 1fr 1fr; }
  .inspector > .item-sheet { grid-template-columns: 120px 1fr; }
  .inspector .item-preview { height: 180px; }
  .tooltip { width: 290px; }
  .history { max-height: 150px; }
}
@media (max-width: 480px) {
  .materials { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bag-tools .quiet { margin-left: 0; }
  .bag-sockets { left: 3px; bottom: 4px; gap: 1px; }
  .socket { width: 10px; height: 10px; border-width: 1px; }
  .inspector > .item-sheet { display: block; }
  .inspector .item-preview { height: 150px; }
  .base-list { grid-template-columns: 1fr; }
  .held { gap: 9px; }
  .held .held-art { flex-basis: 40px; width: 40px; height: 40px; }
  .oficina-page ~ dialog { padding: 17px; }
}
.oficina-foot { margin-top: 16px; }
.page-simulator { --art: url("../assets/site/band-oficina.webp"); }
