
* { box-sizing: border-box; }
body { margin: 0; background: #eae8e3; color: #171717; font-family: Arial, 'Yu Gothic', sans-serif; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 22px; background: #fff; border-bottom: 1px solid #ccc; }
.toolbar a { color: #303030; text-underline-offset: 3px; }
.toolbar button { padding: 9px 15px; background: #222; color: white; border: 0; border-radius: 5px; font: inherit; cursor: pointer; }
.toolbar label { display: flex; gap: 6px; align-items: center; }
.hint { margin: 0 auto 0 0; font-size: 13px; color: #555; }
.card { width: 7.5in; margin: 26px auto; padding: .25in; background: white; box-shadow: 0 3px 20px #0001; }
.masthead { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
h1 { margin: 0; font-family: Georgia, serif; font-size: 30px; font-weight: normal; }
.subtitle { margin: 5px 0 0; font-size: 12px; color: #555; }
.card-id { font-size: 13px; white-space: nowrap; font-weight: bold; }
.bingo { width: 100%; border-collapse: collapse; table-layout: fixed; border: 2px solid #171717; }
.bingo th { height: .66in; padding: 4px; border: 1px solid #171717; vertical-align: middle; }
.letter { display: block; font-family: Georgia, serif; font-size: 27px; line-height: 1; }
.category { display: block; font-size: 12px; line-height: 1.2; font-weight: bold; }
.category-ja, .category-romaji { display: none; }
.show-japanese .category-ja, .bingo[data-language=ja] .category-ja { display: block; }
.hide-english .bingo[data-language=ja] .category-en { display: none; }
.show-romaji .category-romaji { display: block; font-size: 10px; font-weight: normal; }
.category + .category { margin-top: 3px; }
.bingo td { padding: 0; height: 1.3in; border: 1px solid #171717; vertical-align: top; }
.square { width: 100%; height: 1.3in; padding: 5px 6px; display: flex; flex-direction: column; align-items: center; position: relative; border: 0; background: white; color: inherit; font: inherit; }
.square img { display: block; width: 100%; height: .91in; object-fit: contain; }
.word { display: flex; align-items: center; justify-content: center; height: .28in; width: 100%; font-size: 11px; font-weight: bold; line-height: 1.13; text-align: center; overflow-wrap: normal; }
.number { position: absolute; left: 6px; top: 4px; font-size: 9px; color: #555; background: white; padding: 1px 2px; }
.jp { display: none; font-size: 9px; line-height: 1.1; text-align: center; }
.show-japanese .jp { display: block; }
.show-japanese .square img { height: .77in; }
.hide-english .word { display: none; }
.romaji { display: none; font-size: 9px; line-height: 1.1; text-align: center; }
.show-romaji .romaji { display: block; }
.hide-english .jp { font-size: 12px; font-weight: bold; }
.hide-english .romaji { font-size: 10px; }
.toolbar fieldset { flex-basis: 100%; border: 1px solid #ccc; }
#categories { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 0; }
.toolbar input[type=text] { width: 210px; }
.toolbar input[type=number] { width: 70px; }
.toolbar input, .toolbar select { font: inherit; padding: 4px; }
.toolbar input[type=checkbox] { padding: 0; }
#status { flex-basis: 100%; margin: 0; font-size: 13px; }
.error { color: #a32616; }
.toolbar button:disabled { opacity: .5; cursor: default; }
.square { justify-content: center; }
.square img { flex: 1; min-height: 0; }
.word, .jp, .romaji { flex-shrink: 0; }
#references summary { cursor: pointer; }
#cutout-sheet { display: none; }
.call-sheet-preview #cutout-sheet { display: block; max-width: 7in; margin: 20px auto; background: white; }
.cutout-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); }
.cutout-cell { border: 1px dashed #444; height: 1.4in; padding: 6px; display: flex; flex-direction: column; align-items: center; break-inside: avoid; }
.call-category { width: 100%; min-height: .25in; flex-shrink: 0; font-size: 10px; line-height: 1.1; font-weight: bold; text-align: center; }
.cutout-cell img { width: 100%; flex: 1; min-height: 0; object-fit: contain; }
.cutout-cell .word { height: auto; min-height: .2in; }
@media print {
  #cutout-sheet { display: none; }
  .printing-calls #cards { display: none; }
  .printing-calls #cutout-sheet { display: block; width: 7in; margin: 0 auto; }
  .cutout-grid { display: block; }
  .cutout-cell { display: inline-flex; width: 20%; vertical-align: top; }
}
@media print { #references { display: none; } #cards .card:last-child { break-after: auto; } }
.free { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 1.3in; background: #f4f2ed; }
.free-symbol { font-size: 36px; line-height: 1; }
.free strong { font-size: 18px; letter-spacing: 3px; margin-top: 12px; }
.footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: 11px; color: #555; }
.footer span { overflow-wrap: anywhere; }
.reference { max-width: 1080px; background: white; margin: 26px auto; padding: 28px; }
.reference h2 { font-family: Georgia, serif; font-size: 24px; font-weight: normal; }
.gallery { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.gallery figure { margin: 0; padding: 10px; border: 1px solid #ccc; break-inside: avoid; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.gallery figcaption { font-size: 12px; line-height: 1.5; text-align: center; }
.call-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.call-table th, .call-table td { padding: 8px 10px; border-bottom: 1px solid #ddd; text-align: left; }
.call-table input { width: 17px; height: 17px; }
@media (max-width: 740px) {
  .card { width: calc(100% - 20px); min-height: auto; padding: 14px; margin: 18px auto; }
  .bingo td, .square, .free { height: 25vw; }
  .square img { height: auto; min-height: 0; flex: 1; }
  .word { font-size: 10px; height: 34px; flex: 0 0 34px; }
  .show-japanese .square img { height: auto; }
  .masthead { gap: 8px; } h1 { font-size: 25px; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@page { size: auto; margin: .5in; }
@media print {
  body { background: white; }
  .toolbar { display: none; }
  .card { width: 7in; min-height: 0; margin: 0 auto; padding: 0; box-shadow: none; break-after: page; break-inside: avoid; }
  .card:last-child { break-after: auto; }
  .bingo td, .square, .free { height: 1.3in; }
  .square img { height: .91in; }
  .show-japanese .square img { height: .77in; }
  .word { font-size: 11px; height: .28in; }
  .reference { max-width: none; margin: 0; padding: 0; }
  .reference section { break-inside: avoid; }
  .gallery { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .gallery figcaption { font-size: 10px; }
  .call-table { font-size: 10px; } .call-table th, .call-table td { padding: 5px; }
}

.toolbar .text-options { flex-basis: auto; }
.text-options > div { display: flex; gap: 12px; padding: 8px 0; }
#status[hidden] { display: none; }
