/* Artifact Builder controls only; page shell is shared with the checklist. */
.artifact-builder input[type="checkbox"], .artifact-builder input[type="radio"] { width: 18px; height: 18px; flex-shrink: 0; }
.artifact-builder .primary { color: #111710; background: var(--sage); border-color: var(--sage); font-weight: 600; }
.artifact-builder .primary:hover:enabled { color: #111710; background: #bfd3b9; }
.artifact-builder .text-button { background: transparent; border-color: transparent; color: var(--blue); padding-left: 0; padding-right: 0; text-decoration: underline; text-underline-offset: 4px; }
.section-heading, .dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#data-version { color: var(--sage); }
.work-section.setup-section { border-top: 0; padding-top: 0; }
.work-section { padding: 24px 0; border-top: 1px solid var(--faint); min-width: 0; }
.work-section h2 { font-size: 16px; font-weight: 500; letter-spacing: -.02em; margin: 0 0 20px; }
.work-section h2 > span:first-child { color: var(--soft); font-size: 12px; }
.section-heading { align-items: baseline; margin-bottom: 20px; flex-wrap: wrap; gap: 4px 12px; }
.section-heading h2 { margin: 0; }
.hint { color: var(--soft); font-size: 12px; line-height: 1.65; }
.setup-fields { display: flex; align-items: start; flex-wrap: wrap; gap: 20px 32px; }
.field { display: flex; flex-direction: column; gap: 8px; color: var(--soft); font-size: 14px; min-width: 0; }
.field select { width: 100%; }
.setup-fields .field { min-width: 130px; }
.pool-field { padding: 0; margin: 0; border: 0; }
.pool-field legend { color: var(--soft); font-size: 14px; margin-bottom: 8px; }
.pool-options { display: flex; gap: 16px; min-height: 44px; align-items: center; flex-wrap: wrap; }
.pool-options label, .check-field { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.setup-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-top: 20px; }
.setup-actions .hint { margin-left: auto; }
.action-status { color: var(--sand); font-size: 12px; margin: 12px 0 0; }
.action-status:empty { display: none; }
.notice { color: var(--sand); padding: 12px 0; }
.workbench { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 28px; }
.loadout-section { grid-column: 1; grid-row: 1; }
.result-section { grid-column: 2; grid-row: 1 / span 2; }
.optimize-section { grid-column: 1; grid-row: 2; }
.loadout-slots { list-style: none; padding: 0; margin: 0; }
.loadout-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 44px; gap: 5px 10px; padding: 12px 0; border-bottom: 1px solid #292f26; align-items: center; }
.slot-number { color: var(--soft); font-size: 12px; align-self: start; padding-top: 11px; }
.artifact-builder .slot-select { background: transparent; border: none; padding: 8px 4px; text-align: left; min-width: 0; }
.slot-select strong { display: block; font-weight: 500; color: var(--sage); overflow-wrap: anywhere; }
.slot-select .effect-summary { display: block; color: var(--soft); margin-top: 4px; font-size: 12px; }
.slot-select.empty { color: var(--soft); border: 1px dashed #485043; padding: 12px; }
.artifact-builder .remove-slot { background: transparent; border-color: transparent; font-size: 22px; color: var(--soft); padding: 5px; }
.slot-shield { grid-column: 2 / 4; font-size: 12px; color: var(--soft); min-height: 32px; }
.radiation-result { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 12px 0 0; }
.radiation-result strong { font-size: 32px; font-weight: 500; letter-spacing: -.04em; }
.radiation-result span { font-size: 13px; letter-spacing: .04em; }
.safe { color: var(--sage); }
.unsafe { color: #d7a29b; }
.stat-results { margin: 22px 0 12px; }
.stat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding: 11px 0; border-top: 1px solid #292f26; }
.stat-row dt { color: var(--soft); font-size: 14px; }
.stat-row dd { margin: 0; color: var(--sand); font-variant-numeric: tabular-nums; text-align: right; }
.stat-row small { grid-column: 1 / -1; text-align: right; color: var(--soft); font-size: 12px; }
.special-warning { font-size: 12px; color: var(--sand); }
.special-warning p { margin: 8px 0; }
.constraint { margin-top: 18px; font-size: 14px; min-height: 36px; }
.optimize-section .primary { width: 100%; margin-top: 12px; }
.artifact-filters { display: grid; grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(100px, 1fr)); gap: 12px; margin: 20px 0; }
.artifact-filters input[type="search"] { width: 100%; min-width: 0; }
.artifact-filters .check-field { grid-column: 1 / -1; color: var(--soft); font-size: 12px; min-height: 36px; }
.artifact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
.library-artifact { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; gap: 8px 16px; padding: 20px 0; border-top: 1px solid var(--faint); min-width: 0; }
.artifact-info { min-width: 0; }
.artifact-info h3 { font-size: 14px; font-weight: 500; margin: 0; color: var(--sage); overflow-wrap: anywhere; }
.artifact-info .artifact-meta { display: block; color: var(--soft); font-size: 12px; margin: 3px 0 8px; }
.effect-summary { color: var(--soft); font-size: 12px; line-height: 1.7; margin: 0; }
.artifact-special { display: block; color: var(--sand); font-size: 12px; margin-top: 6px; }
.inventory-control { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.inventory-control label { color: var(--soft); font-size: 12px; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 38px; padding: 4px; }
.stepper output { min-width: 20px; text-align: center; color: var(--sand); font-size: 13px; }
.library-artifact .add-artifact { grid-column: 1 / -1; justify-self: start; color: var(--blue); font-size: 12px; min-height: 44px; background: transparent; border: none; padding: 5px 0; }
#supported-objectives { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 28px; padding-left: 18px; }
.artifact-builder dialog { color: var(--text); background: var(--bg); border: 1px solid #485043; border-radius: 8px; padding: 24px; width: min(900px, calc(100% - 32px)); max-height: 85dvh; overscroll-behavior: contain; }
.artifact-builder dialog::backdrop { background: rgba(0, 0, 0, .75); }
.artifact-builder:has(dialog[open]) { overflow: hidden; }
.dialog-heading { position: sticky; top: -24px; padding: 16px 0; margin-top: -16px; background: var(--bg); z-index: 1; }
.dialog-heading h2, #reset-dialog h2 { font-size: 16px; font-weight: 500; margin: 0; }
.picker-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.artifact-builder .picker-artifact { border: none; border-top: 1px solid var(--faint); background: transparent; border-radius: 0; padding: 18px 4px; text-align: left; }
.picker-artifact strong { color: var(--sage); display: block; font-weight: 500; font-size: 14px; }
.picker-artifact .artifact-meta { color: var(--soft); font-size: 12px; display: block; margin: 4px 0; }
#reset-dialog { max-width: 480px; }
#reset-dialog p { color: var(--soft); font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.mobile-find { display: none; }
@media (max-width: 840px) {
  .setup-fields { gap: 16px; }
  .setup-fields .field { flex: 1; min-width: 110px; }
  .pool-field { width: 100%; }
  .pool-options { gap: 18px; font-size: 13px; }
  .setup-actions .hint { margin-left: 0; width: 100%; }
  .workbench { display: flex; flex-direction: column; }
  .work-section h2 { font-size: 15px; }
  .artifact-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .artifact-filters .search-field { grid-column: 1 / -1; }
  .artifact-filters .content-field { grid-column: 1 / -1; }
  .artifact-list, .picker-list { grid-template-columns: 1fr; }
  .stepper button { width: 44px; }
  .mobile-find { display: block; position: fixed; bottom: 0; left: 0; right: 0; z-index: 21; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); background: rgba(17, 19, 16, .97); border-top: 1px solid var(--faint); }
  .mobile-find .primary { width: 100%; }
  .artifact-builder .tool-footer { padding-bottom: 100px; }
  .artifact-builder dialog { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 92dvh; border-radius: 12px 12px 0 0; padding: 16px; }
  .dialog-heading { top: -16px; }
  #reset-dialog { margin: auto; width: calc(100% - 32px); border-radius: 8px; }
  #supported-objectives { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html:has(.artifact-builder) { scroll-behavior: auto; } }
