/* Containment repairs for the existing GlyphKite design. */
/* Anchor the existing menu to the header, not to its narrower trigger. */
.tools-menu { position: static; }
.tools-panel { right: 20px; left: auto; width: min(780px, calc(100% - 40px)); top: calc(100% + 8px); }
.row, .row-copy, .page-main, .page-cols, .examples, .fantasy-tool { min-width: 0; }
.row-copy { overflow: hidden; }
.row-copy .meta { max-width: 34%; overflow-wrap: anywhere; }
.glyph-frame {
  --glyph-top: 4px; --glyph-bottom: 4px; --glyph-left: 4px; --glyph-right: 4px;
  display: block; min-width: 0; max-width: 100%;
  padding: var(--glyph-top) var(--glyph-right) var(--glyph-bottom) var(--glyph-left);
  overflow: auto; max-height: 340px; scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.row-copy > .glyph-frame { flex: 1 1 0; }
.glyph-frame > .out { display: block; width: 100%; max-width: 100%; }
.out { overflow-wrap: anywhere; word-break: normal; }
.grid > li { min-width: 0; max-width: 100%; }
.grid button { min-width: 0; max-width: 100%; overflow: hidden; line-height: 1.5; }
.grid button > .glyph-frame { flex: 0 1 auto; max-height: 280px; }
.glyph-grid-text { display: block; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
.ex-grid button > .glyph-frame { width: 100%; }
.ex-grid small { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.grid button.is-copied::after {
  content: var(--copy-feedback, 'Copied'); top: 4px; right: 4px; left: auto;
  transform: none; max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis;
  z-index: 2;
}
html[lang='es'], html[lang='pt-BR'] { --copy-feedback: 'Copiado'; }
.fantasy-copy { max-width: 100%; overflow: hidden; }
.fantasy-copy > .glyph-frame { width: 100%; }
.fantasy-copy strong { display: block; min-width: 0; }
.fantasy-copy small { max-width: 100%; overflow-wrap: anywhere; }
.word-controls, .ascii-controls, .fantasy-controls, .stringbar { min-width: 0; max-width: 100%; }
.word-controls label, .ascii-controls label, .fantasy-controls label { min-width: 0; max-width: 100%; }
.word-controls select, .ascii-controls select { max-width: 100%; }
.ascii-out, .prose .ex { max-width: 100%; overflow: auto; }
@media (max-width: 680px) {
  .tools-panel { left: 16px; right: 16px; width: auto; max-width: none; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); }
}
@media (max-width: 560px) {
  .row-copy > .glyph-frame { flex: 0 1 auto; width: 100%; }
  .row-copy .meta { max-width: 100%; width: 100%; flex-wrap: wrap; align-items: flex-start; }
  .field, .field textarea { min-width: 0; max-width: 100%; }
  .toolbar, .style-filter { min-width: 0; }
  .style-filter select { min-width: 0; max-width: 100%; }
}
