* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  padding: 1rem;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  color: #202020;
  background: #fff;
  font-family: system-ui, sans-serif;
}
header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
h1 { margin: 0; font-size: 1.3rem; }
h2 { margin: 0; font-size: 1rem; }
button { font: inherit; color: inherit; background: #fff; border: 1px solid #777; padding: .55rem .8rem; cursor: pointer; }
button:disabled { color: #666; background: #eee; cursor: not-allowed; }
:focus-visible { outline: 3px solid #185abc; outline-offset: 2px; }
#status { margin: .8rem 0; }
main { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); flex: 1; min-height: 0; }
.editors, .output { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.editors { padding-right: 1rem; }
.output { padding-left: 1rem; border-left: 1px solid #bbb; }
[role="tablist"] { display: flex; flex-wrap: wrap; gap: .25rem; padding: 3px; }
[role="tab"][aria-selected="true"] { background: #e8e8e8; font-weight: 700; border-bottom: 3px solid #333; }
[role="tabpanel"] { display: flex; flex-direction: column; flex: 1; min-height: 0; }
label { display: block; margin: .65rem 0; }
textarea, pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9rem; line-height: 1.6; tab-size: 2; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
textarea { flex: 1; min-height: 0; width: 100%; padding: .75rem; border: 1px solid #888; border-radius: 0; resize: none; color: #202020; background: #fff; }
textarea:disabled { background: #f5f5f5; }
textarea[aria-invalid="true"] { border: 2px solid #a12020; }
.lookup-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.lookup-toolbar label { margin: .5rem 0; }
.lookup-toolbar input, .lookup-toolbar select { flex: 1; min-width: 0; max-width: 100%; padding: .55rem; font: inherit; }
#lookup-choices { max-height: 9rem; overflow: auto; }
#lookup-status, #input-source { margin: .4rem 0 0; font-size: .9rem; overflow-wrap: anywhere; }
#lookup-number[aria-invalid="true"] { border: 2px solid #a12020; }
pre { flex: 1; min-height: 0; margin: .65rem 0 0; padding: .75rem; border: 1px solid #bbb; }
@media (max-width: 700px) {
  body { height: auto; min-height: 100vh; }
  main { grid-template-columns: minmax(0, 1fr); gap: 1rem; flex: none; }
  .editors { padding-right: 0; height: 65vh; min-height: 22rem; }
  .output { padding-left: 0; border-left: 0; height: 55vh; min-height: 16rem; }
}
