/* Native textareas preserve selection and copying. The read-only reference uses
 * the shared article projection; the hidden editor retains the exact source. */
.article-panel :is(#article-input, #article-source-display)[hidden] { display: none !important; }
html[data-design='focus'] #study-sidebar .article-panel[data-source-readonly] {
  align-self: start;
  padding: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html[data-design='focus'] .article-panel[data-source-readonly] .article-input-heading {
  min-height: 32px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
html[data-design='focus'] .article-panel[data-source-readonly] .article-input-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
html[data-design='focus'] .article-panel[data-source-readonly] #locate-source {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
html[data-design='focus'] .article-panel[data-source-readonly] #locate-source:hover { color: var(--ink); }
html[data-design='focus'] #study-sidebar .article-panel[data-source-readonly] :is(#article-input, #article-source-display) {
  flex: 0 1 auto;
  height: clamp(280px, calc(100svh - 240px), 680px);
  min-height: 220px;
  max-height: 680px;
  margin: 0;
  padding: 0 10px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.95;
  resize: none;
  caret-color: transparent;
  box-shadow: none;
  scrollbar-color: var(--journey-control, #bbb) transparent;
}
html[data-design='focus'] .article-panel[data-source-readonly] #article-input::-webkit-scrollbar-thumb {
  background: var(--journey-control, #bbb);
}
html[data-design='focus'] .article-panel[data-source-readonly] .actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
html[data-design='focus'] .article-panel[data-source-readonly] #study-add-content {
  flex: 0 0 auto;
  width: auto;
  min-height: 36px;
  padding: 6px 0 6px 12px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 400;
}
/* Content-sized fields avoid a tall empty reference on short texts. Browsers
 * without this capability retain the bounded, scrollable native textarea. */
@supports (field-sizing: content) {
  html[data-design='focus'] #study-sidebar .article-panel[data-source-readonly] :is(#article-input, #article-source-display) {
    field-sizing: content;
    height: auto;
    max-height: clamp(280px, calc(100svh - 240px), 680px);
  }
}
html[data-design='focus'] .article-panel[data-source-readonly] #study-add-content:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  transform: none;
}
html[data-design='focus'] .article-panel[data-source-readonly] #phase-status[data-severity='info'] { display: none; }

@media (max-width: 999px) {
  html[data-design='focus'] #study-sidebar .article-panel[data-source-readonly] { padding: 16px 0; }
  html[data-design='focus'] #study-sidebar .article-panel[data-source-readonly] :is(#article-input, #article-source-display) {
    height: clamp(260px, 48svh, 480px);
    max-height: 480px;
  }
  html[data-design='focus'] .article-panel[data-source-readonly] :is(#locate-source,#study-add-content) { min-height: 44px; }
  @supports (field-sizing: content) {
    html[data-design='focus'] #study-sidebar .article-panel[data-source-readonly] :is(#article-input, #article-source-display) {
      height: auto;
      max-height: clamp(260px, 48svh, 480px);
    }
  }
}
