.study-notes .note-choice, .study-notes .note-tools, .study-notes .note-actions {
  display: flex; align-items: end; flex-wrap: wrap; gap: .65rem 1rem;
}
.study-notes .note-choice { justify-content: space-between; margin-bottom: 1rem; }
.study-notes .note-choice a { padding-block: .65rem; font-size: .9rem; }
.study-notes label { display: grid; gap: .35rem; color: var(--ink); font-weight: 600; }
.study-notes select, .study-notes textarea, .study-notes input {
  border: 1px solid #aab9ac; background-color: white; color: var(--ink); border-radius: 5px;
  font: inherit; font-size: 1rem; width: 100%; min-height: 44px; padding: .55rem .65rem;
}
.study-notes .note-tools input { width: 6rem; }
.study-notes select { min-width: 6rem; }
.study-notes .note-workspace {
  display: grid; gap: 1rem 1.5rem;
  grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
  grid-template-areas: "surface fields"; margin-top: .9rem; align-items: start;
}
.study-notes .note-workspace.can-draw { grid-template-areas: "surface palette" "surface fields"; grid-template-rows: auto 1fr; }
.study-notes .note-surface { grid-area: surface; min-width: 0; }
.study-notes .note-palette { grid-area: palette; }
.study-notes .note-input-mode { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .65rem; margin-bottom: .55rem; }
.study-notes .note-input-mode .hint { flex: 1 1 9rem; margin: 0; }
.study-notes .note-input-mode .button[aria-pressed=true] { background: var(--green); color: var(--paper); }
.study-notes .note-board {
  display: block; width: 100%; height: auto; max-height: 68vh; margin-inline: auto;
  aspect-ratio: 1828 / 3309; background: #edf0e8; border-radius: 5px;
}
.study-notes .note-board.editable { touch-action: none; cursor: crosshair; user-select: none; }
.study-notes .note-fields { grid-area: fields; display: grid; min-width: 0; gap: 1rem; }
.study-notes fieldset { min-width: 0; margin: 0; padding: .9rem; border: 1px solid var(--line); border-radius: 5px; }
.study-notes legend, .study-notes summary { font-weight: 650; }
.study-notes .hint, .study-notes [data-status] { margin: .6rem 0; }
.study-notes [data-status].error { color: var(--danger); }
.study-notes .note-warning { margin: .6rem 0; padding: .65rem; background: #fff1c7; }
.study-notes .button:not(.primary) { color: var(--green); background: white; border: 1px solid #a5b7a6; }
.study-notes .note-coords form, .study-notes .note-comments form { display: grid; gap: .65rem; margin-top: .7rem; }
.study-notes form .button { justify-self: start; }
.study-notes .note-comments { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1.3rem; }
.study-notes .note-comments h3 { margin: 0 0 .65rem; }
.study-notes .note-comment { padding: .65rem 0; border-bottom: 1px solid var(--line); }
.study-notes .note-comment .note-actions { margin-top: .45rem; }
.study-notes .note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 670px) {
  .study-notes .note-workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: "surface" "fields"; }
  .study-notes .note-workspace.can-draw { grid-template-areas: "palette" "surface" "fields"; grid-template-rows: auto; }
  .study-notes .note-board { max-width: 23rem; max-height: 72vh; max-height: 72svh; }
  .study-notes .note-choice label { max-width: 100%; }
  .study-notes .note-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(6.5rem, 100%), 1fr)); gap: .45rem; }
  .study-notes .note-tools select, .study-notes .note-tools input { min-width: 0; width: 100%; }
  .study-notes .note-coords form label + label { margin-top: 0; }
  .study-notes summary { min-height: 44px; padding-block: .65rem; }
}
