/* P03 and P05: neutral detail surfaces, forest selection, shared light/dark tokens. */
.child-editor, .student-profile-page { min-width: 0; }
.child-editor .child-header {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.child-editor .editor-identity, .student-profile-page .profile-identity {
  display: flex; align-items: center; gap: var(--space-3); min-width: 0;
}
.child-editor .editor-name, .student-profile-page .profile-identity > div { min-width: 0; }
.child-editor .editor-avatar-holder { flex: none; }
.child-editor .editor-avatar, .student-profile-page .profile-avatar {
  width: var(--space-12); height: var(--space-12); flex: none; color: var(--color-ink);
}
.child-editor .editor-identity h1, .student-profile-page .profile-name-row h1 {
  margin: 0; font-size: var(--text-2xl); overflow-wrap: anywhere;
}
.child-editor .editor-identity p, .student-profile-page .profile-identity p {
  margin: var(--space-1) 0 0; color: var(--color-muted); font-size: var(--text-sm);
}
.child-editor .editor-child-nav { display: flex; align-items: center; gap: var(--space-2); }
.child-editor .editor-child-nav button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); }
.child-editor .editor-child-nav button:first-child .icon { transform: rotate(180deg); }
.child-editor .editor-child-nav strong { white-space: nowrap; font-size: var(--text-sm); color: var(--color-muted); }
.child-editor .editor-feedback { display: grid; gap: var(--space-1); justify-items: end; }
.child-editor .editor-feedback .chip { margin: 0; }
.child-editor .editor-save { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1); color: var(--color-muted); font-size: var(--text-xs); }
.child-editor .editor-save-short { display: none; }
.child-editor .editor-save[data-state="unsaved"] { color: var(--color-error-ink); }
.child-editor .child-header > .semester-selector { grid-column: 1 / 3; }
.child-editor .editor-print { justify-content: center; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-line); background: var(--color-secondary-bg); color: var(--color-secondary-ink); border-radius: var(--radius-sm); text-decoration: none; font-size: var(--text-sm); }
.child-editor .editor-navigation {
  position: sticky; top: var(--shell-topbar-height, 0px); z-index: var(--z-sticky);
  display: grid; gap: var(--space-2); padding-block: var(--space-2);
  min-width: 0; background: var(--color-bg);
}
.child-editor .editor-progress { min-width: 0; }
.child-editor .editor-progress .progress { display: flex; align-items: center; gap: var(--space-3); }
.child-editor .editor-progress p { flex: none; margin: 0; color: var(--color-muted); font-size: var(--text-xs); }
.child-editor .editor-progress progress { height: var(--space-2); min-width: 0; max-width: 24rem; }
.child-editor .domain-tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 0; border-bottom: 1px solid var(--color-line); background: var(--color-surface); }
.child-editor .domain-tabs button {
  flex: 1 1 7rem; min-width: 0; min-height: 44px; padding: var(--space-3) var(--space-2);
  border: 0; border-bottom: 3px solid transparent; border-radius: var(--radius-none);
  background: transparent; color: var(--color-muted); font-size: var(--text-sm); line-height: var(--line-tight);
  white-space: normal; overflow-wrap: normal;
}
.child-editor .domain-tabs [aria-selected="true"] { border-bottom-color: var(--color-primary); color: var(--color-primary); font-weight: 650; }
.child-editor .editor-panel { min-width: 0; scroll-margin-top: 11rem; }
.child-editor .editor-draft-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-block: var(--space-3); }
.child-editor .editor-draft-actions .hint { flex-basis: 100%; margin: 0; }
.child-editor .editor-draft-actions .hint:empty { display: none; }
.child-editor .editor-provider-settings { color: var(--color-muted); font-size: var(--text-xs); overflow-wrap: anywhere; }
.child-editor .editor-provider-line { min-width: 0; color: var(--color-muted); font-size: var(--text-xs); margin-bottom: var(--space-3); }
.child-editor .editor-provider-disclosure[data-open="true"] > .disclosure-content { margin-block: var(--space-2); }
.child-editor .privacy-prompt { white-space: pre-wrap; overflow-wrap: anywhere; }
.child-editor .editor-name-panel { min-width: 0; }
.child-editor .editor-name-disclosure { font-size: var(--text-xs); color: var(--color-muted); }
.child-editor .editor-name-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); margin-block: var(--space-2) var(--space-3); }
.child-editor .editor-name-form label { margin: 0; }
.child-editor .editor-name-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); align-items: end; }
.child-editor .editor-name-form .hint, .child-editor .editor-name-feedback { grid-column: 1 / -1; margin: 0; font-size: var(--text-xs); color: var(--color-muted); }
.child-editor .editor-name-feedback:empty { display: none; }
.child-editor .editor-domain { padding: 0; }
.child-editor .editor-domain-heading { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border-bottom: 1px solid var(--color-line); }
.child-editor .editor-domain-symbol { flex: none; color: var(--color-muted); }
.child-editor .editor-domain-heading h2 { margin: 0; color: var(--color-ink); font-size: var(--text-lg); }
.child-editor .editor-domain-heading p { margin: var(--space-1) 0 0; font-size: var(--text-xs); color: var(--color-muted); }
.child-editor .editor-domain-summary { display: none; }
.child-editor .editor-domain-columns { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--density-gap); padding: var(--density-card-space); align-items: start; }
.child-editor .editor-domain-columns > * { min-width: 0; }
.child-editor .editor-evidence { grid-column: 1 / -1; }
.child-editor .editor-rating-control { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 0; margin: 0 0 var(--space-4); border: 0; min-width: 0; }
.child-editor .editor-rating-control legend { padding: 0; margin-bottom: var(--space-2); font-weight: 650; }
.child-editor .editor-rating-control .rating-choice { position: relative; display: flex; justify-content: center; min-width: 0; min-height: 44px; margin: 0; padding: var(--space-2); border: 1px solid var(--color-line); border-radius: var(--radius-none); background: var(--color-surface); color: var(--color-muted); font-size: var(--text-sm); text-align: center; cursor: pointer; }
.child-editor .rating-choice:first-of-type { border-radius: var(--radius-sm) var(--radius-none) var(--radius-none) var(--radius-sm); }
.child-editor .rating-choice:last-of-type { border-radius: var(--radius-none) var(--radius-sm) var(--radius-sm) var(--radius-none); }
.child-editor .rating-choice + .rating-choice { border-inline-start: 0; }
.child-editor .editor-rating-control .rating-choice:has(:checked) { background: var(--color-action); color: var(--color-action-ink); border-color: var(--color-action); font-weight: 650; }
.child-editor .editor-rating-control .rating-choice:has(:checked):hover { background: var(--color-action-hover); }
.child-editor .editor-rating-control .rating-choice:has(:checked):active { background: var(--color-action-pressed); }
.child-editor .rating-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; margin: 0; }
.child-editor .rating-choice:has(:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; z-index: var(--z-raised); }
.child-editor .editor-comment-label, .child-editor .editor-narrative-label { margin: 0; font-weight: 650; }
.child-editor .editor-comment-label textarea, .child-editor .editor-narrative-label textarea { font-size: var(--text-sm); line-height: var(--line-relaxed); font-weight: 400; }
.child-editor .editor-character-count { margin: var(--space-1) 0 var(--space-3); text-align: right; font-size: var(--text-xs); }
.child-editor .editor-comparison { padding: var(--space-3); border: 1px solid var(--color-line); border-radius: var(--radius-sm); background: var(--color-surface-soft); }
.child-editor .editor-comparison h3 { margin: 0 0 var(--space-2); font-size: var(--text-sm); }
.child-editor .editor-comparison-track { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); }
.child-editor .editor-comparison-track > div { display: grid; gap: var(--space-1); font-size: var(--text-xs); }
.child-editor .editor-comparison-track .chip { margin: 0; justify-self: start; }
.child-editor .editor-comparison-change { font-size: var(--text-sm); color: var(--color-ink); }
.child-editor .editor-photo-controls { min-width: 0; }
.child-editor .editor-photo-controls h3 { margin: 0 0 var(--space-3); font-size: var(--text-sm); }
.child-editor .editor-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.child-editor .editor-photo-actions { margin-top: var(--space-2); padding: var(--space-3); border: 1px dashed var(--color-line); border-radius: var(--radius-sm); background: var(--color-surface); }
.child-editor .editor-photo-actions > .disclosure-trigger { justify-content: center; color: var(--color-muted); }
.child-editor .editor-photo-actions[data-open="false"] > .disclosure-trigger { min-height: 6rem; }
.child-editor .editor-photo-actions > .disclosure-content > button { width: 100%; }
.child-editor .editor-local-image, .child-editor .editor-photo-details { color: var(--color-muted); font-size: var(--text-xs); }
.child-editor .editor-photo-pending { gap: var(--space-2); }
.child-editor .editor-domain-columns > .narrative-box { margin: 0; }
.child-editor .narrative-box { display: grid; gap: var(--space-3); }
.child-editor .narrative-box > .stale { margin: 0; }
.child-editor .editor-narrative-placeholder { display: grid; justify-items: center; align-content: center; gap: var(--space-3); min-height: 10rem; margin: 0; padding: var(--space-5); border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--color-surface-soft); color: var(--color-muted); text-align: center; }
.child-editor .editor-narrative-label textarea { min-height: 12rem; }
.child-editor .editor-narrative-body .editor-character-count { margin-bottom: 0; }
.child-editor .narrative-source { margin: 0; font-size: var(--text-xs); }
.child-editor .editor-draft-narrative, .child-editor .editor-write-manually { width: 100%; }
.child-editor .editor-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--density-gap); margin-bottom: var(--space-4); }
.child-editor .editor-review-item { min-width: 0; padding: var(--space-4); border: 1px solid var(--color-line); border-radius: var(--radius-md); }
.child-editor .editor-review-item h3 { margin-top: 0; color: var(--color-ink); background: transparent; font-size: var(--text-lg); }
.child-editor .editor-review-item .narrative-box { margin: 0; }
/* Reuse the true provenance label as a visible watermark, never invent an image source. */
.child-editor .photo, .student-profile-page .photo { display: grid; width: 100%; min-width: 0; }
.child-editor .photo-picture, .student-profile-page .photo-picture { grid-area: 1 / 1; overflow: hidden; border: 1px solid var(--color-line); border-radius: var(--radius-sm); }
.child-editor .photo img, .student-profile-page .photo img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.child-editor .photo figcaption, .student-profile-page .photo figcaption { display: contents; }
.child-editor .photo-description, .student-profile-page .photo-description { grid-row: 2; margin-top: var(--space-2); font-size: var(--text-xs); color: var(--color-muted); overflow-wrap: anywhere; }
.child-editor .photo-provenance, .student-profile-page .photo-provenance { grid-area: 1 / 1; z-index: var(--z-raised); align-self: end; justify-self: start; margin: var(--space-2); padding: var(--space-1) var(--space-2); max-width: calc(100% - var(--space-4)); border: 1px solid var(--color-line); border-radius: var(--radius-sm); color: var(--color-ink); background: var(--color-surface); font-size: var(--text-xs); overflow-wrap: anywhere; }
.student-profile-page .profile-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.student-profile-page .profile-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.student-profile-page .profile-current-status .chip { margin: 0; }
.student-profile-page .profile-actions { margin: 0; }
.student-profile-page .profile-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: var(--density-gap); }
.student-profile-page .profile-content > .card { margin: 0; }
.student-profile-page .profile-comparison { grid-column: 1 / -1; }
.student-profile-page .profile-comparison-table { margin-bottom: 0; }
.student-profile-page .profile-comparison-table thead { background: var(--color-surface-soft); }
.student-profile-page .profile-comparison-table th, .student-profile-page .profile-comparison-table td { font-size: var(--text-sm); vertical-align: middle; }
.student-profile-page .profile-comparison-table th[data-domain] { background: transparent; color: var(--color-ink); }
.student-profile-page .positive { font-weight: 650; color: var(--color-ink); }
.student-profile-page .progress-change-value { display: inline-flex; align-items: center; gap: var(--space-1); }
.student-profile-page .progress-change-value > .icon { transform: rotate(-90deg); }
.student-profile-page .timeline-semester + .timeline-semester, .student-profile-page .narrative-semester + .narrative-semester { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--color-line); }
.student-profile-page .timeline-semester > h3 { margin: 0; font-size: var(--text-sm); color: var(--color-muted); }
.student-profile-page .profile-evidence-row { border-inline-start: 2px solid var(--color-line); padding: var(--space-3) var(--space-4); margin-top: var(--space-3); }
.student-profile-page .profile-evidence-row h4 { margin: 0 0 var(--space-2); color: var(--color-ink); }
.student-profile-page .profile-evidence-row p { font-size: var(--text-sm); line-height: var(--line-relaxed); }
.student-profile-page .profile-evidence-row .photo { margin-block: var(--space-3); }
.student-profile-page .profile-review-notice { padding: var(--space-3); background: var(--color-surface-soft); border: 1px solid var(--color-line); border-radius: var(--radius-sm); color: var(--color-muted); font-size: var(--text-sm); }
.student-profile-page .narrative-semester > .disclosure-trigger { padding: var(--space-3); border: 1px solid var(--color-line); border-radius: var(--radius-sm); }
.student-profile-page .narrative-semester > .disclosure-trigger .chip { margin-inline-start: var(--space-2); }
.student-profile-page .narrative-box { border: 1px solid var(--color-line); border-radius: var(--radius-sm); padding: var(--space-3); }
.student-profile-page .narrative-box h4 { margin: 0 0 var(--space-2); }
.student-profile-page .narrative-box .evidence-text { margin-bottom: 0; font-size: var(--text-sm); line-height: var(--line-relaxed); }
.student-profile-page .narrative-source { display: inline-block; padding: var(--space-2); border: 1px solid var(--color-line); border-radius: var(--radius-sm); background: var(--color-surface-soft); color: var(--color-muted); font-size: var(--text-xs); }
@media (max-width: 1199px) {
  .child-editor .editor-nav-label { display: none; }
  .child-editor .editor-child-nav button { width: 44px; padding: var(--space-2); }
}
@media (max-width: 1023px) {
  .child-editor .child-header { grid-template-columns: minmax(0, 1fr) auto; }
  .child-editor .editor-feedback { grid-column: 2; grid-row: 1; }
  .child-editor .editor-child-nav { grid-column: 1; grid-row: 2; justify-content: space-between; }
  .child-editor .child-header > .semester-selector { grid-column: 2; grid-row: 2; }
  .child-editor .editor-save-full { display: none; }
  .child-editor .editor-save-short { display: inline; }
  .child-editor .editor-identity h1 { font-size: var(--text-xl); }
  .child-editor .editor-identity p { display: none; }
  .child-editor .editor-batch-draft { width: 100%; }
  .child-editor .editor-domain-columns, .child-editor .editor-review-grid { grid-template-columns: minmax(0, 1fr); }
  .child-editor .editor-rating-control { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
  .child-editor .editor-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .child-editor .editor-extras { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-3); }
  .child-editor .editor-extras .editor-progress { flex: 1 1 100%; }
  .child-editor .editor-domain-description { display: none; }
  .child-editor .editor-domain-summary { display: block; }
  .student-profile-page .profile-content { grid-template-columns: minmax(0, 1fr); }
  .student-profile-page .profile-comparison-table { display: block; }
  .student-profile-page .profile-comparison-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .student-profile-page .profile-comparison-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .student-profile-page .profile-comparison-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--color-line); border-radius: var(--radius-sm); padding: var(--space-3); background: var(--color-surface); }
  .student-profile-page .profile-comparison-table tr > * { display: block; min-width: 0; padding: var(--space-1) 0; border: 0; }
  .student-profile-page .profile-comparison-table th, .student-profile-page .profile-comparison-table .progress-change { grid-column: 1 / -1; }
  .student-profile-page .profile-comparison-table .mobile-cell-label { display: block; font-size: var(--text-xs); color: var(--color-muted); }
}
@media (max-width: 600px) {
  .child-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-2); }
  .child-editor > .child-header, .child-editor > .editor-navigation, .child-editor > .editor-panel, .child-editor > .editor-extras, .child-editor > .editor-draft-actions { grid-column: 1 / -1; }
  .child-editor .child-header { grid-template-columns: minmax(0, 1fr) 7rem; padding: var(--space-2); gap: var(--space-2); }
  .child-editor .editor-child-nav { grid-column: 1; gap: var(--space-1); }
  .child-editor .editor-child-nav button { flex: none; min-width: 44px; }
  .child-editor .editor-child-nav strong { font-size: var(--text-xs); }
  .child-editor .child-header > .semester-selector { grid-column: 2; grid-row: 2; }
  .child-editor .semester-selector select { width: 7rem; min-width: 0; font-size: var(--text-xs); }
  .child-editor .semester-caption, .child-editor .editor-domain-heading {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .child-editor .editor-domain-heading > .icon { display: none; }
  .child-editor .editor-identity { gap: var(--space-2); }
  .child-editor .editor-identity h1 { font-size: var(--text-lg); }
  .child-editor .editor-avatar { width: var(--space-10); height: var(--space-10); }
  .child-editor .editor-navigation { padding-block: 0; }
  .child-editor .domain-tabs { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-inline: contain; }
  .child-editor .domain-tabs button { flex: 0 0 auto; min-width: 44px; white-space: nowrap; font-size: var(--text-xs); }
  .child-editor > .editor-provider-line:has(.disclosure[data-open="true"]), .child-editor > .editor-name-panel:has(.disclosure[data-open="true"]) { grid-column: 1 / -1; }
  .child-editor .editor-name-control { grid-template-columns: minmax(0, 1fr); }
  .child-editor .editor-name-form button { justify-self: start; }
  .child-editor .editor-rating-control { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); }
  .child-editor .editor-rating-control .rating-choice { border: 1px solid var(--color-line); border-radius: var(--radius-sm); font-size: var(--text-xs); }
  .child-editor .editor-domain-columns { gap: var(--density-gap); padding: var(--density-card-space); }
  .child-editor .editor-photos { grid-template-columns: minmax(0, 1fr); }
  .child-editor .editor-comparison-track { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .child-editor .editor-comparison-change { grid-column: 1 / -1; }
  .student-profile-page .profile-actions { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
  .student-profile-page .profile-comparison-table tbody { grid-template-columns: minmax(0, 1fr); }
  .student-profile-page .profile-comparison { padding: var(--space-3); }
}
@media (max-width: 360px) {
  .child-editor .editor-comparison-track { grid-template-columns: minmax(0, 1fr); }
  .child-editor .editor-comparison-track > .icon { transform: rotate(90deg); }
}
@media (max-height: 650px) and (max-width: 767px) {
  .child-editor .editor-navigation { position: static; }
}
