:root {
  --desktop: #dce3df;
  --canvas: #dce3df;
  --accent: #2458c5;
  --yellow: #f5d777;
  --keyboard-inset: 0px;
  --paper: #fffef9;
  --chrome: #edf0e9;
  --ink: #283930;
  --muted: #59665f;
  --line: #c6cec4;
  --blue: #2458c5;
  --wash: #edf2ff;
  --amber: #f2bc53;
  --sans: "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --composer-height: 150px;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--desktop);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
}
button,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
::selection {
  background: #fbe5aa;
}
button {
  touch-action: manipulation;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 20px;
  z-index: 20;
  background: var(--paper);
  padding: 10px;
}
.skip-link:focus {
  top: 8px;
}
.quiet {
  border: 0;
  background: none;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 12px;
  border-radius: 4px;
}
.quiet:hover {
  background: #00000007;
  color: var(--ink);
}
.masthead {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  gap: 24px;
}
.wordmark {
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -1px;
}
.wordmark svg {
  width: 21px;
  height: 25px;
}
.header-actions {
  gap: 16px;
}
.edition {
  font: 11px var(--mono);
  padding-left: 12px;
}
.edition span {
  color: var(--muted);
}
.document-window {
  position: absolute;
  top: 80px;
  bottom: calc(var(--composer-height) + 65px);
  left: max(48px, calc((100vw - 1184px) / 2));
  right: max(48px, calc((100vw - 1184px) / 2));
  min-height: 200px;
  border: 1px solid #aebbad;
  border-radius: 9px;
  background: var(--paper);
  box-shadow:
    0 12px 35px #354c3c13,
    0 2px 4px #354c3c12;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    top 0.18s ease,
    left 0.18s ease,
    right 0.18s ease;
  animation: appear 0.24s ease-out;
}
.document-window.maximized {
  top: 57px;
  left: 20px;
  right: 20px;
}
.window-bar {
  height: 42px;
  flex-shrink: 0;
  background: var(--chrome);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 0 15px;
  gap: 20px;
  box-shadow: inset 0 1px #fff;
}
.window-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.window-title svg {
  width: 16px;
  height: 19px;
  flex-shrink: 0;
  color: #71806f;
}
.window-title h1 {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.window-controls {
  display: flex;
  gap: 5px;
}
.window-button {
  border: 1px solid transparent;
  background: none;
  width: 29px;
  height: 27px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  padding: 4px;
  color: #52614f;
}
.window-button:hover {
  border-color: var(--line);
  background: #fff8;
}
.window-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
}
.window-body {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
}
.document-window.history-hidden .window-body {
  grid-template-columns: minmax(0, 1fr);
}
.document-window.history-hidden #desktop-margin-slot {
  display: none;
}
.reader {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 30px 42px 24px;
  outline-offset: -4px !important;
}
.reader > * {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.passage-header {
  margin-bottom: 28px;
}
.passage-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -.35px;
  text-wrap: pretty;
}
.passage-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  margin: 9px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.passage-heading {
  margin: 20px 0 0;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 500;
  text-wrap: pretty;
}
.passage {
  white-space: pre-wrap;
  font-size: 20px;
  line-height: 1.8;
  font-weight: 400;
  margin-top: 0;
  margin-bottom: 28px;
}
.end-line {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  font: 10px var(--mono);
  color: var(--muted);
}
.question-margin {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  min-width: 0;
  border-left: 1px solid var(--line);
  background: #fafbf6;
  display: block;
}
.margin-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fafbf6;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.margin-heading h2 {
  font-size: 12px;
  font-weight: 500;
  margin: 0;
}
.margin-heading h2 span {
  font: 10px var(--mono);
  margin-left: 7px;
  color: var(--muted);
}
.margin-order {
  font: 9px var(--mono);
  color: var(--muted);
}
.history {
  list-style: none;
  margin: 0;
  padding: 0 16px 12px;
}
.history > li {
  border-bottom: 1px solid var(--line);
}
.question-toggle {
  border: 0;
  background: none;
  text-align: left;
  width: 100%;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 9px;
  gap: 7px;
  padding: 14px 0;
  color: var(--ink);
}
.question-toggle:hover .question-preview {
  color: var(--blue);
}
.question-number {
  font: 10px/1.9 var(--mono);
  color: var(--muted);
}
.question-preview {
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chevron {
  align-self: start;
  font-size: 17px;
  line-height: 1.2;
  transition: transform 0.15s;
}
.compact-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 7px;
  color: var(--muted);
  font: 10px/1.6 var(--mono);
}
.compact-scores strong {
  color: var(--blue);
  font-weight: 500;
}
.history-entry[open] .compact-scores {
  display: none;
}
.history-entry[open] .question-preview {
  display: block;
  font-weight: 500;
  color: var(--blue);
}
.history-entry[open] .chevron {
  transform: rotate(90deg);
  color: var(--blue);
}
.response-details {
  padding: 0 0 16px;
  animation: reveal 0.18s ease-out;
}
.response-details p {
  font-size: 13px;
  line-height: 1.65;
  margin: 10px 0 14px;
}
.expanded-scores {
  display: flex;
  gap: 12px;
  font: 10px var(--mono);
  color: var(--muted);
}
.expanded-scores strong {
  color: var(--blue);
  font-weight: 500;
}
.amplifier {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.amplifier-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  gap: 12px;
}
.amplifier-heading strong {
  color: var(--blue);
  font: 11px var(--mono);
}
.amplifier p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  margin: 8px 0 12px;
}
.entry-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.entry-actions time {
  font: 9px var(--mono);
  color: var(--muted);
}
.edit-button {
  border: 0;
  background: none;
  padding: 5px 0;
  color: var(--blue);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.history-empty {
  padding: 10px 20px;
  color: var(--muted);
  font-size: 12px;
}
.composer-position {
  position: fixed;
  width: min(760px, calc(100vw - 240px));
  left: 50%;
  transform: translateX(-50%);
  bottom: 26px;
  z-index: 3;
}
.composer {
  background: var(--paper);
  border: 1px solid #9faa99;
  border-radius: 8px;
  box-shadow:
    0 8px 22px #31443319,
    0 2px 3px #31443312;
  overflow: hidden;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.composer:focus-within {
  border-color: #7391c5;
  box-shadow:
    0 8px 22px #31443319,
    0 0 0 2px #2458c510;
}
.composer-heading {
  min-height: 35px;
  background: var(--chrome);
  border-bottom: 1px solid #d7ddd3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 15px;
}
.composer-heading label {
  font-size: 11px;
  font-weight: 500;
}
.composer-tools .quiet {
  padding: 2px 0;
  font-size: 10px;
  color: var(--blue);
}
.composer-scope {
  font: 9px var(--mono);
  color: var(--muted);
  margin-left: auto;
}
.input-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  padding: 15px 16px 4px;
}
textarea {
  resize: none;
  border: 0;
  border-radius: 2px;
  background: transparent;
  outline: 0;
  min-width: 0;
  width: 100%;
  min-height: 35px;
  max-height: 132px;
  font-size: 17px;
  line-height: 1.6;
  padding: 3px 2px;
  overflow-y: auto;
}
textarea:focus-visible {
  outline: none;
}
textarea::placeholder {
  color: #788379;
}
.submit {
  flex-shrink: 0;
  border: 1px solid #b58328;
  background: var(--amber);
  border-radius: 5px;
  padding: 8px 18px;
  box-shadow: 0 3px 0 #c99b46;
  color: #302b1d;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 4px;
}
.submit:hover {
  background: #f7c86b;
}
.submit:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #c99b46;
}
.composer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font: 9px/1.5 var(--mono);
  color: var(--muted);
  padding: 9px 18px 13px;
}
.help-dialog {
  width: 450px;
  padding: 24px;
  border: 1px solid #aebbad;
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 15px 50px #21392b26;
}
.help-dialog::backdrop {
  background: #253c2d33;
}
.help-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.help-heading h2 {
  margin: 0;
  font-size: 18px;
}
.help-dialog h3 {
  font-size: 13px;
  margin: 21px 0 5px;
}
.help-dialog p {
  font-size: 13px;
  line-height: 1.7;
  margin: 5px 0;
}
.help-dialog .help-preview {
  font-size: 11px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 15px;
  color: var(--muted);
}
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.reading-app {
  height: 100dvh;
  overflow: hidden;
}
#desktop-margin-slot {
  min-height: 0;
  min-width: 0;
}
#margin-slot {
  display: none;
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.questions-open,
.sheet-close {
  display: none;
}
.question-content {
  min-width: 0;
}
.question-toggle {
  list-style: none;
  cursor: pointer;
}
.question-toggle::-webkit-details-marker {
  display: none;
}
.question-toggle:focus-visible {
  outline-offset: -3px;
}
.question-preview,
.response-details p {
  overflow-wrap: anywhere;
}
.history-entry[open] .compact-scores {
  display: none;
}
.confidence-caption {
  align-self: center;
  font: 10px var(--sans);
}
.expanded-scores {
  flex-wrap: wrap;
  line-height: 1.7;
}
.entry-status {
  display: block;
  font: 10px var(--mono);
  margin-top: 9px;
  color: var(--muted);
}
.busy-label {
  display: none;
}
.htmx-request .idle-label {
  display: none;
}
.htmx-request .busy-label {
  display: inline;
}
.submit:disabled,
textarea:disabled {
  opacity: 0.7;
  cursor: wait;
}
.form-error,
.answer-error {
  color: #a42716;
  font-size: 13px;
}
.form-error {
  max-height: 95px;
  overflow-y: auto;
  margin: 9px 16px 12px;
}
.request-status {
  padding: 10px 18px;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.network-error {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(540px, calc(100% - 32px));
  background: #fff1ec;
  color: #a42716;
  border: 1px solid #e8b8ae;
  padding: 12px 16px;
}
body.requesting [data-action="edit"],
body.requesting [data-action="cancel-edit"] {
  pointer-events: none;
  opacity: 0.5;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.wordmark svg {
  stroke: var(--ink);
  stroke-width: 1.5;
  fill: var(--yellow);
}
.wordmark svg path:last-child {
  fill: none;
  stroke: var(--ink);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.sign-out {
  display: inline;
  margin-left: 12px;
}
.sign-out button {
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
.history-sheet {
  inset: auto 0 0;
  margin: 0;
  width: 100%;
  max-width: 100%;
  height: 78dvh;
  max-height: var(--sheet-max-height, 85dvh);
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}
.history-sheet::backdrop {
  background: #253c2d33;
}
.history-sheet[open] {
  animation: sheet-up 0.2s ease-out;
}
.history-sheet .question-margin {
  max-height: 100%;
  height: 100%;
  padding: 0 22px 30px;
  border: 0;
  background: var(--paper);
}
.history-sheet .margin-heading {
  padding: 18px 0 15px;
  height: auto;
  background: var(--paper);
}
.history-sheet .sheet-close {
  display: block;
}
.history-sheet .margin-order {
  display: none;
}
.history-sheet .question-preview,
.history-sheet .response-details p {
  font-size: 15px;
}
.history-sheet .compact-scores,
.history-sheet .expanded-scores {
  font-size: 11px;
}
.history-sheet .history {
  padding-inline: 0;
}
.history-sheet .question-toggle {
  padding-block: 18px;
}
.history-sheet .response-details {
  padding-left: 29px;
}
.history-sheet .entry-actions time {
  font-size: 11px;
}
@keyframes sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@media (max-width: 1100px) and (min-width: 801px) {
  .document-window {
    left: 24px;
    right: 24px;
  }
  .reader {
    padding: 24px;
  }
  .window-body {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
  .passage {
    font-size: 19px;
  }
}
@media (max-width: 800px) {
  body,
  .reading-app {
    height: auto;
    overflow: visible;
    background: var(--paper);
  }
  .masthead {
    height: auto;
    padding: 21px 22px 28px;
  }
  .wordmark {
    font-size: 28px;
  }
  .header-actions {
    gap: 12px;
  }
  .edition {
    font-size: 10px;
  }
  .workspace {
    padding: 0 22px;
  }
  .document-window,
  .document-window.maximized {
    position: static;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: block;
    background: none;
    animation: none;
  }
  .window-bar {
    display: block;
    height: auto;
    border: 0;
    background: none;
    padding: 0;
    margin-bottom: 18px;
    box-shadow: none;
  }
  .window-title h1 {
    font-size: 25px;
    font-weight: 500;
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
  }
  .window-title svg,
  .window-controls,
  #desktop-margin-slot {
    display: none;
  }
  .window-body,
  .document-window.history-hidden .window-body {
    display: block;
  }
  .reader {
    padding: 0 0 calc(var(--composer-height) + 38px);
    overflow: visible;
    max-width: 68ch;
    margin: auto;
  }
  .reader > * {
    max-width: none;
  }
  .passage-header h2 {
    font-size: 22px;
  }
  .passage-header {
    margin-bottom: 24px;
  }
  .passage {
    font-size: 19px;
    line-height: 1.75;
  }
  .composer-position {
    left: 12px;
    transform: none;
    bottom: calc(12px + env(safe-area-inset-bottom) + var(--keyboard-inset));
    width: calc(100% - 24px);
  }
  .composer-heading {
    padding: 8px 12px;
    justify-content: space-between;
  }
  .composer-heading label {
    font-size: 11px;
  }
  .composer-scope {
    display: none;
  }
  .composer-tools {
    gap: 8px;
  }
  .composer-tools .quiet {
    font-size: 11px;
  }
  .questions-open {
    display: flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: none;
    color: var(--blue);
    font-size: 11px;
    padding: 6px 0;
    min-height: 28px;
  }
  .input-row {
    gap: 8px;
    padding: 10px 12px 4px;
  }
  textarea {
    font-size: 16px;
    min-height: 36px;
    max-height: 112px;
  }
  .submit {
    padding: 8px 12px;
    font-size: 13px;
  }
  .composer-bottom {
    font-size: 9px;
    padding: 8px 12px 10px;
  }
  .shortcut {
    display: none;
  }
  [data-editing]:not([data-editing=""]) .input-row {
    flex-wrap: wrap;
  }
  [data-editing]:not([data-editing=""]) textarea {
    flex-basis: 100%;
  }
  [data-editing]:not([data-editing=""]) .submit {
    margin-left: auto;
  }
}
/* Sign-in uses the same ink, paper and bright blue as the reading workspace. */
.login-main {
  max-width: 880px;
  margin: 8vh auto;
  padding: 0 28px;
}
.login-main h1 {
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
  margin: 28px 0;
}
.login-main > p {
  max-width: 460px;
  font-size: 1.15rem;
  line-height: 1.6;
}
.login-main .ask-button {
  margin: 26px 0;
  padding: 18px 26px;
  min-width: 260px;
}
.login-main small {
  display: block;
  opacity: 0.7;
}
.login-main #auth-error {
  color: #a42716;
}

.login-main .ask-button {
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
  border-radius: 2px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  transition:
    background 0.15s,
    transform 0.15s;
}
.login-main .ask-button:hover {
  background: #104bc1;
  transform: translateY(-1px);
}
.login-main .ask-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Passage filters: source text remains the selectable foreground. */
:root {
  --explored-low: #ffd21f;
  --explored-mid: #e9d12c;
  --explored-high: #249f55;
  --question-low: #e53935;
  --question-mid: #f8f1de;
  --question-high: #1762d6;
}
.window-bar { position: relative; z-index: 3; }
.filter-control { position: relative; }
.filter-icon { display: grid; place-items: center; width: 29px; height: 27px; padding: 2px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); }
.filter-icon svg { width: 23px; height: 22px; }
.filter-icon:hover, .filter-icon[aria-expanded="true"] { background: #edf1e8; color: var(--ink); }
.filter-icon.active { color: var(--blue); background: #edf2fc; }
.filter-menu { position: absolute; right: 0; top: calc(100% + 7px); width: 168px; padding: 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); box-shadow: 0 7px 20px #28393019; z-index: 5; }
.filter-option { display: block; width: 100%; padding: 10px 12px; border: 0; background: transparent; text-align: left; font-size: 12px; border-radius: 2px; }
.filter-option:hover { background: #edf1e8; }
.filter-option[aria-pressed="true"] { color: var(--blue); background: #edf2fc; }
.filter-plane { position: relative; isolation: isolate; }
.filter-plane canvas { position: absolute; pointer-events: none; opacity: 0; z-index: 0; transition: opacity .25s ease; }
.filter-plane canvas.visible { opacity: .42; }
.filter-plane .passage { position: relative; z-index: 1; }
.filter-selected > summary .question-preview { color: var(--blue); }
.filter-notice { color: var(--muted); font-size: 12px; }
.filter-legend { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 10px; color: var(--muted); }
.filter-legend i { width: 105px; height: 5px; border-radius: 5px; background: linear-gradient(90deg,var(--explored-low),var(--explored-mid),var(--explored-high)); }
.filter-legend[data-mode="question"] i { background: linear-gradient(90deg,var(--question-low),var(--question-mid),var(--question-high)); }
@media (max-width: 800px) {
  .window-bar { display: flex; align-items: flex-start; }
  .window-controls { display: flex; }
  .window-controls > .window-button { display: none; }
  .filter-icon { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .filter-plane canvas { transition: none; } }

/* The connection picker is a small file window above the desktop composer. */
.connection-reference {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 15px;
  border-bottom: 1px solid var(--line);
  background: #f7f8f0;
}
.reference-label {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 0;
  background: none;
  color: var(--blue);
  font: 11px/1.5 var(--mono);
  overflow-wrap: anywhere;
}
.connection-destination {
  display: block;
  margin: 0 0 16px;
  font: 10px/1.7 var(--mono);
  color: var(--blue);
  overflow-wrap: anywhere;
  text-decoration: none;
}
.connection-destination:hover { text-decoration: underline; }
.connection-picker {
  position: fixed;
  inset: auto auto calc(var(--composer-height) + 40px) 50%;
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 32px));
  max-height: min(560px, calc(100dvh - var(--composer-height) - 65px));
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #9faa99;
  border-radius: 7px;
  box-shadow: 0 12px 36px #28393028;
}
.connection-picker[open] { display: flex; flex-direction: column; animation: picker-in 140ms ease-out; }
.connection-picker::backdrop { background: #28393012; }
.picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 15px;
  background: var(--chrome);
  border-bottom: 1px solid var(--line);
}
.picker-heading h2 { margin: 0; font-size: 13px; font-weight: 500; }
#connection-breadcrumbs { display: flex; flex-wrap: wrap; gap: 3px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
#connection-breadcrumbs button { font-size: 11px; text-align: left; }
#connection-breadcrumbs button + button::before { content: '›'; margin-right: 10px; color: var(--muted); }
.picker-search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#connection-search {
  flex: none;
  margin: 12px 16px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font: 13px var(--sans);
}
#connection-search:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.picker-items, #connection-preview { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.picker-items { padding: 0 15px 12px; }
.picker-row {
  display: flex;
  width: 100%;
  gap: 14px;
  padding: 12px 9px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background 120ms;
}
.picker-row:hover, .picker-row:focus-visible { background: var(--chrome); }
.picker-row > span:first-child { color: var(--blue); }
.picker-row strong { display: block; font-size: 13px; font-weight: 500; }
.picker-row small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; font-size: 12px; color: var(--muted); }
#connection-preview { padding: 0 22px 12px; }
#connection-preview-label { font: 10px/1.7 var(--mono); color: var(--muted); }
#connection-preview-text { white-space: pre-wrap; font-size: 16px; line-height: 1.8; }
#connection-picker-status { padding: 12px 20px; color: var(--muted); }
.connection-picker footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
#connection-picker-hint { font-size: 11px; color: var(--muted); }
.connection-picker footer .submit { flex: none; font-size: 12px; }
@keyframes picker-in { from { opacity: 0; translate: 0 5px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 800px) {
  .connection-picker { inset: 8vh auto auto 50%; max-height: 75dvh; }
  .connection-reference { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) { .connection-picker[open] { animation: none; } }
