:root { color-scheme: light; font: 17px/1.5 Georgia, serif; color: #222; background: #fbfaf7; }
* { box-sizing: border-box; }
body { max-width: 72rem; margin: auto; padding: 1.5rem 1.25rem 4rem; }
header, nav, .row { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
header { justify-content: space-between; padding-bottom: 1rem; border-bottom: 1px solid #d4d0c8; }
button, a { color: inherit; }
button { padding: 0.25rem 0; border: 0; background: none; text-decoration: underline; text-underline-offset: 0.15em; font: inherit; cursor: pointer; text-align: left; min-height: 36px; }
button:hover, a:hover { color: #666; }
button:disabled { opacity: 0.4; cursor: default; }
:focus-visible { outline: 1px solid #222; outline-offset: 3px; }
#status { font: 0.8rem/1.5 system-ui, sans-serif; color: #666; margin: 0.65rem 0 1.6rem; }
#status.error { color: #942f26; }
main { display: grid; grid-template-columns: minmax(13rem, 0.85fr) minmax(0, 2fr); gap: 3rem; }
h1, h2 { font-size: 1rem; font-weight: normal; margin: 0 0 1rem; }
h2 { font-weight: bold; margin-top: 1.75rem; }
aside { min-width: 0; max-height: 80vh; overflow: auto; }
#tree { overflow-wrap: anywhere; }
#tree ul { list-style: none; padding: 0 0 0 0.85rem; border-left: 1px solid #d4d0c8; margin: 0.4rem 0 0.6rem 0.25rem; }
#tree > ul { padding-left: 0; border-left: 0; margin-left: 0; }
#tree li { margin: 0.25rem 0; }
#tree button { text-decoration: none; line-height: 1.3; padding: 0.15rem 0.3rem; margin-left: -0.3rem; }
#tree button[aria-current="true"] { background: #ebe7df; }
#tree .edge { display: block; font-size: 0.78rem; color: #777; margin: 0.4rem 0 0.15rem; }
#tree .reference { color: #666; }
#tree .group { margin-top: 1.5rem; font-size: 0.8rem; color: #666; }
label { display: block; margin-bottom: 0.45rem; font-size: 0.85rem; color: #555; }
input, textarea, select { display: block; width: 100%; font: inherit; color: #222; background: transparent; border: 1px solid #c9c4ba; border-radius: 0; padding: 0.55rem 0.65rem; }
input[hidden] { display: none; }
textarea { resize: vertical; min-height: 6rem; line-height: 1.55; }
input:focus, textarea:focus, select:focus { outline: 1px solid #555; outline-offset: 1px; }
input[type="checkbox"] { display: inline; width: auto; margin: 0 0.5rem 0 0; }
.field { margin-bottom: 1rem; }
.title-input { font-size: 1.45rem; border-width: 0 0 1px; padding: 0.2rem 0 0.5rem; }
.choice { margin-bottom: 1rem; }
.choice .row { justify-content: flex-end; gap: 0.8rem; font-size: 0.78rem; margin: 0.2rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.writing { min-height: 12rem; }
.choice { padding: 1rem 0; border-top: 1px solid #d4d0c8; }
.choice-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.choice-fields .field { margin-bottom: 0.25rem; }
.choice > button { font-size: 0.8rem; }
.choice .field:last-of-type { margin-bottom: 0; }
details { margin: 0.7rem 0; }
summary { font-size: 0.8rem; color: #666; cursor: pointer; }
details .field { margin-top: 0.7rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.helper { font-size: 0.8rem; color: #666; }
.passage-tools { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #d4d0c8; }
.passage-tools button, .passage-tools a { font-size: 0.85rem; }
dialog { max-width: min(30rem, 90vw); padding: 1.5rem; color: inherit; background: #fbfaf7; border: 1px solid #aaa; }
dialog h2 { margin-top: 0; }
dialog::backdrop { background: #0003; }
@media (max-width: 650px) {
  main { grid-template-columns: 1fr; gap: 1.5rem; }
  aside { max-height: 15rem; overflow: auto; border-bottom: 1px solid #d4d0c8; }
  .split { grid-template-columns: 1fr; gap: 0; }
  .choice-fields { grid-template-columns: 1fr; gap: 0.3rem; }
  header, nav { gap: 0.75rem; }
}
