.box-page [hidden] { display: none !important; }
.box-page .pagehead { margin-bottom: 1rem; }
.box-layout { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); gap: 1.3rem; align-items: start; }
.box-statusbar,.box-backup { padding: .65rem .8rem; background: #ede9df; margin-bottom: .7rem; }
.box-statusbar,.box-actions,.box-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .65rem; }
.box-statusbar,.box-card-head { justify-content: space-between; }
.box-statusbar p { margin: 0; font-weight: 650; }
.box-page h2,.box-page h3 { margin-top: 0; scroll-margin-top: .7rem; }
.box-page input:not([type=checkbox],[type=file]),.box-page textarea,.box-page select { box-sizing: border-box; display: block; width: 100%; min-width: 0; min-height: 44px; margin-top: .2rem; padding: .45rem .55rem; border: 1px solid #777c76; border-radius: 4px; background: #fffefa; color: #212b29; font: inherit; }
.box-page label { display: block; color: #263d4a; margin-bottom: .55rem; }
.box-page button,.box-page summary,.box-actions a { min-height: 44px; }
.box-actions a { display: inline-flex; align-items: center; }
.box-page summary { padding-block: .5rem; font-weight: 650; cursor: pointer; }
.box-page button { padding: .5rem .7rem; border-radius: 4px; }
.box-page button.secondary { color: #263d4a; background: #fffefa; border: 1px solid #65757c; }
.box-page button:disabled { opacity: .6; cursor: default; }
.box-page :focus-visible { outline: 2px solid #263d4a; outline-offset: 3px; }
.box-page [role=status]:empty { margin: 0; }
.box-editor,.box-result,.box-detail { padding: .75rem .9rem; background: #fffdf7; border: 1px solid #d7cdbd; overflow-wrap: anywhere; min-width: 0; }
.box-editor { border-top: 3px solid #a45236; }
.box-result,.box-detail,.box-backup { margin-top: .65rem; }
.box-result p,.box-detail p,#box-code-preview { margin: .25rem 0 .5rem; }
.box-result h3,.box-detail h3 { margin: 0; }
.box-result strong { color: #263d4a; }
.box-check { display: flex !important; align-items: baseline; gap: .5rem; min-height: 44px; padding-block: .4rem; overflow-wrap: anywhere; }
.box-check input { flex: 0 0 auto; margin: 0; }
.box-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: .65rem; border-top: 1px solid #d7cdbd; padding: .2rem 0; }
.box-detail .box-item .box-check { align-items: center; margin: 0; }
.box-item-actions { max-inline-size: min(11rem,43vw); text-align: end; }
.box-item-actions summary,.box-transfer-items summary { color: #263d4a; font-size: .9rem; }
.box-item-actions .box-actions { justify-content: flex-end; padding-bottom: .4rem; }
.box-search { display: grid; grid-template-columns: minmax(0,1.8fr) minmax(0,1fr); gap: .6rem; }
#box-results { list-style: none; padding: 0; margin: 0; }
#box-add-status:not(:empty),#box-dialog-status:not(:empty) { color: #773a28; font-weight: 650; }
.box-page dialog { width: min(35rem,calc(100% - 1.5rem)); max-height: calc(100% - 1.5rem); padding: 1rem; border: 1px solid #777c76; border-top: 4px solid #a45236; background: #fffdf7; color: #212b29; overflow-wrap: anywhere; }
.box-page dialog::backdrop { background: rgb(26 36 41 / 64%); }
#box-dialog-note:empty { display: none; }
.box-transfer-route { padding: .5rem .7rem; margin: .6rem 0; background: #e8edf0; color: #263d4a; font-weight: 650; }
.box-transfer-hidden { margin: .55rem 0; color: #773a28; font-weight: 650; }
.box-transfer-item,.box-destination-status { margin: .2rem 0 .5rem; }
.box-transfer-item { font-weight: 650; }
.box-transfer-items { border-top: 1px solid #d7cdbd; margin-top: .35rem; }
.box-transfer-items ul { max-block-size: min(9rem,25vh); overflow: auto; overscroll-behavior: contain; margin: .15rem 0 .55rem; padding-inline-start: 1.5rem; }
.box-transfer-items li + li { margin-top: .2rem; }
.box-page input[type=file] { display: block; max-width: 100%; min-height: 44px; }
.box-backup { margin-top: 1rem; }
@media (max-width: 760px) {
  .box-layout { display: flex; flex-direction: column; gap: 1rem; }
  .box-layout > section { width: 100%; }
  .box-layout[data-empty] .box-editor { order: -1; }
  .edition .box-page .pagehead { padding-bottom: .35rem; }
}
@media (max-width: 360px) { .box-search { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: .45rem; } }
@media print {
  body.box-printing > :not(#box-print) { display: none !important; }
  .box-printing #box-print { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5cm; }
  #box-print p { margin: 0; padding: 1.1cm .35cm; border: 1px solid black; color: black; font: bold 24pt/1.2 sans-serif; text-align: center; break-inside: avoid; overflow-wrap: anywhere; }
}

.box-result small { display: block; margin-bottom: .35rem; }

@media (max-width: 760px) {
  html:has(.box-batch[data-active]) { scroll-padding-bottom: 9rem; }
  .box-batch[data-active] { position: fixed; z-index: 2; inset: auto 0 0; padding: .5rem .75rem calc(.5rem + env(safe-area-inset-bottom)); border-top: 2px solid #344c5b; background: #e8edf0; }
  .box-batch[data-active] span { font-weight: 650; }
  .box-page:has(.box-batch[data-active]) { padding-bottom: 9rem; }
}

.box-scope { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; background: #e8edf0; padding: .35rem .6rem; margin-top: .55rem; }
.box-scope p { margin: 0; }
.box-detail input[name=find-in-box] { margin-top: .25rem; }
.box-detail > label:has(input[name=find-in-box]) { margin-top: .65rem; }
