/* Episode composer: common participation, optional exceptions, compact follow-up. */
.operation-row .row-content > strong {
  font-weight: 400;
}
.operation-row .row-content > strong mark {
  background: transparent;
  color: inherit;
  font-weight: 700;
}
#save-error {
  color: var(--rose);
  flex-basis: 100%;
}
.editor-page {
  max-width: 1480px;
  margin-inline: auto;
}
.editor-page .editor-layout {
  display: block;
  gap: 22px;
}
.editor-page #case-form {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
}
.editor-page #case-form > #section-performed,
.editor-page #case-form > .editor-save {
  grid-column: 1 / -1;
}
.editor-page #case-form > #section-context {
  margin: 0;
  height: 100%;
}
.editor-page #case-form > .ai-companion {
  display: block;
  margin: 0;
  border-radius: 24px;
  padding: 26px;
  align-self: stretch;
  min-width: 0;
  position: static;
}
.assistant-orb {
  width: 88px;
  height: 88px;
  display: block;
  fill: currentColor;
  margin-bottom: 10px;
}
@keyframes assistant-orbit {
  to {
    transform: rotate(360deg);
  }
}
.title-mode {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}
.editor-page .patient-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.editor-page .shared-participation {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(0, 1.3fr);
  align-items: start;
  gap: 18px;
  padding: 16px;
  border-radius: 16px;
  background: var(--blue-bg);
  margin-bottom: 22px;
}
.editor-page .shared-participation .team-editor {
  margin: 0;
}
.editor-page .shared-participation .team-chips:empty {
  display: none;
}
@media (max-width: 760px) {
  .editor-page .patient-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .editor-page .shared-participation {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}
.editor-page .editor-section {
  border-radius: 24px;
  margin: 0;
  padding: 24px;
  min-width: 0;
  box-shadow: 0 3px 12px #12294604;
}
#section-performed,
.editor-save {
  grid-column: 1 / -1;
}
.editor-page .editor-section h2 {
  font-size: 18px;
  letter-spacing: -0.45px;
}
.editor-page .session-fields {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 18px;
}
.editor-page .field label {
  font-size: 12px;
  font-weight: 550;
}
.editor-page .field input,
.editor-page .field textarea {
  border-radius: 13px;
  background: var(--surface-alt);
  border-color: transparent;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.editor-page .field input:focus,
.editor-page .field textarea:focus {
  border-color: var(--blue);
  background: var(--surface);
}
.editor-page #section-context textarea {
  min-height: 68px;
}
.editor-page .editor-rail {
  top: 112px;
}
.editor-page .progress-card {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}
.editor-page .progress-card a {
  color: var(--muted);
}
.editor-page .progress-card a.active {
  color: var(--blue);
  background: var(--blue-bg);
}
.editor-page .ai-companion {
  background: #0867dc;
  color: white;
  border: 0;
  box-shadow: 0 8px 24px #0867dc22;
}
.editor-page .ai-companion p,
.editor-page .ai-companion small {
  color: #ffffffcc;
}
.editor-page .ai-companion .button.primary {
  background: white;
  color: #0867dc;
}
.editor-page .ai-companion .button {
  min-height: 44px;
  white-space: normal;
  line-height: 1.35;
}
.editor-page .ai-companion .button.text {
  color: white;
  background: #ffffff16;
  border: 1px solid #ffffff45;
}
.editor-page .ai-companion .button:focus-visible {
  outline: 3px solid white;
  outline-offset: 3px;
}
.editor-page .ai-companion .button.primary:hover {
  background: #eaf3ff;
  color: #064aa0;
}
.editor-page .ai-companion .button:disabled {
  opacity: 0.7;
  cursor: wait;
}
.editor-page .ai-companion .assistant-icon {
  background: #ffffff25;
  color: white;
}
.editor-page .ai-companion summary {
  color: #fff;
}
.editor-page .progress-card > .eyebrow {
  color: var(--muted);
}
.editor-page .upload-zone {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  text-align: left;
}
.editor-page .upload-zone > svg {
  width: 28px;
  height: 28px;
  margin: 0;
  grid-row: 1 / 3;
}
.editor-page .upload-zone > p {
  margin: 0;
  font-size: 13px;
}
.editor-page .upload-zone > small {
  grid-column: 2;
}
.editor-page .upload-zone > .button {
  grid-column: 3;
  grid-row: 1 / 3;
}
.editor-page #section-performed {
  border: 1px solid var(--line);
  padding: 26px;
}
.performed-heading .performed-symbol {
  display: grid;
  place-items: center;
  background: var(--blue-bg);
  color: var(--blue);
  border-radius: 12px;
  width: 40px;
  height: 40px;
}
.performed-heading .performed-symbol svg {
  width: 21px;
  height: 21px;
}
.performed-heading .gesture-count {
  margin-left: auto;
  background: var(--surface-alt);
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.editor-page .procedure-editor-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.editor-page .procedure-editor-top > .field {
  flex: 1;
  min-width: 0;
}
.editor-page .procedure-editor-top label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.editor-page .procedure-editor-top .field-error:empty {
  display: none;
}
.editor-page .procedure-editor-top input {
  font-size: 17px;
  font-weight: 550;
  background: var(--surface);
  min-height: 48px;
}
.editor-page .gesture-index {
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.editor-page .procedure-editor .linked-label {
  margin-left: 29px;
}
.editor-page #section-performed > header h2 {
  font-size: 22px;
}
.editor-page .gesture-attributes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.editor-page .gesture-attributes .pick {
  min-height: 42px;
  border-radius: 13px;
  background: var(--surface);
}
.editor-page .procedure-editor > .field input {
  font-size: 17px;
  font-weight: 550;
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 52px;
}
.editor-page .procedure-editor > .field label {
  display: none;
}
.editor-page .title-options {
  margin-bottom: 12px;
}
.editor-page .editor-save {
  margin: 0;
  padding: 8px 0 20px;
}
.compact-register .filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) minmax(0, 1fr) 40px;
  gap: 6px;
}
.technique-selector {
  display: grid;
  grid-template-columns: repeat(var(--technique-count, 2), minmax(0, 1fr));
  align-items: stretch;
  min-width: 0;
  gap: 3px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-alt);
  animation: technique-appear 180ms ease-out;
}
.technique-selector > button {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0;
  min-height: 34px;
  min-width: 0;
  padding: 8px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.25;
  cursor: pointer;
  overflow-wrap: normal;
  transition:
    background 160ms ease,
    color 160ms ease;
}
.technique-selector > button:hover {
  color: var(--text);
}
.technique-selector > button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--blue);
  box-shadow: 0 1px 3px #0000000a;
}
.register-tools > .technique-filter {
  margin-top: 10px;
}
.technique-filter > button {
  font-size: 12px;
}
@keyframes technique-appear {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .technique-selector {
    animation: none;
  }
  .technique-selector > button {
    transition: none;
  }
}
.compact-register .filter-row > .pick {
  width: 100%;
  min-width: 0;
  padding-inline: 10px;
  gap: 5px;
}
.compact-register .filter-row > .pick > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compact-register .filter-row > .icon-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.compact-register .filter-row > .icon-button[aria-expanded='true'] {
  color: var(--blue);
  background: var(--blue-bg);
}
.editor-section > header {
  margin-bottom: 22px;
}
.editor-section > header .section-number {
  background: var(--blue-bg);
  color: var(--blue);
}
.procedure-editor {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-alt) 65%, var(--surface));
  padding: 18px;
}
.procedure-editor-top {
  margin-bottom: 8px;
}
.gesture-participation {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 14px;
}
#section-participation {
  background: color-mix(in srgb, var(--blue-bg) 30%, var(--surface));
}
#section-participation > .eyebrow {
  display: block;
  margin-bottom: 14px;
}
.course-editor {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 22px;
}
.course-editor h3 {
  font-size: 17px;
  margin: 0 0 16px;
}
.course-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.course-option {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  text-align: left;
}
.course-option svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.course-option.chosen {
  background: var(--blue-bg);
  color: var(--blue);
  border-color: var(--blue);
}
.course-option.chosen[data-value='none'] {
  background: var(--teal-bg);
  color: var(--teal);
  border-color: currentColor;
}
.course-option.chosen[data-value='complications'] {
  background: var(--amber-bg);
  color: var(--amber);
  border-color: currentColor;
}
.editor-page .editor-disclosure {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  margin: 0;
  border-radius: 13px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  transition: background 0.15s;
}
.editor-page .editor-disclosure::-webkit-details-marker {
  display: none;
}
.editor-page .editor-disclosure::marker {
  content: '';
}
.editor-page .editor-disclosure:hover {
  background: color-mix(in srgb, var(--blue-bg) 45%, transparent);
}
.editor-page .editor-disclosure:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.editor-page .editor-disclosure span {
  margin: 0;
}
.editor-page .disclosure-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--blue-bg);
  color: var(--blue);
  flex: none;
}
.editor-page .disclosure-icon svg {
  width: 17px;
  height: 17px;
}
.editor-page .disclosure-label {
  flex: 1;
}
.editor-page .editor-disclosure .disclosure-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 450;
}
.editor-page .disclosure-toggle {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
}
.editor-page .disclosure-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.18s ease;
}
.editor-page details[open] > .editor-disclosure .disclosure-toggle svg {
  transform: rotate(45deg);
}
.editor-page details[open] > .editor-disclosure {
  margin-bottom: 12px;
}
.editor-page .title-options {
  border: 1px solid var(--line);
  border-radius: 15px;
}
.editor-page .title-options > .field {
  margin: 0 12px 14px;
}
.editor-page .note-editor {
  padding: 10px;
  border-radius: 17px;
}
.editor-page .note-editor > .field {
  margin: 0 8px 8px;
}
.editor-page .note-editor > .field > label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.editor-page .note-editor .disclosure-icon {
  color: var(--amber);
  background: var(--amber-bg);
}
.editor-page .gesture-participation {
  padding-top: 6px;
}
.editor-page .ai-companion .editor-disclosure {
  color: white;
  padding-inline: 0;
  font-size: 12px;
}
.editor-page .ai-companion .disclosure-icon {
  color: white;
  background: #ffffff20;
}
.editor-page .add-procedure {
  min-height: 48px;
  border-style: solid;
  background: var(--blue-bg);
  border-color: transparent;
  border-radius: 14px;
  font-weight: 600;
}
.editor-page .add-procedure:hover {
  border-color: var(--blue);
}
@media (prefers-reduced-motion: reduce) {
  .editor-page .disclosure-toggle svg {
    transition: none;
  }
}
.editor-page .upload-zone {
  padding: 20px;
  min-height: 0;
}
.editor-page .title-preview {
  background: var(--surface-alt);
  border-left: 3px solid var(--blue);
}
@media (max-width: 760px) {
  .editor-page #case-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .editor-page .editor-section {
    width: 100%;
    padding: 19px;
  }
  .editor-page .gesture-attributes {
    grid-template-columns: 1fr 1fr;
  }
  .editor-page .editor-save {
    width: 100%;
  }
  .editor-page .upload-zone {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .editor-page .upload-zone > .button {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .procedure-editor {
    padding: 15px;
  }
  .course-option {
    flex: 1 1 150px;
  }
}
@media (min-width: 761px) and (max-width: 1300px) {
  .editor-page .editor-layout {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 16px;
  }
  .editor-page #case-form {
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
  }
  .editor-page .patient-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Two panes only when a wide landscape workspace can accommodate both. */
.editor-page .title-preview-row {
  display: flex;
  align-items: start;
  gap: 10px;
  margin-bottom: 18px;
}
.editor-page .title-preview-row .title-preview {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 19px;
  font-weight: 550;
  letter-spacing: -0.3px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.editor-page .title-preview-row .icon-button {
  flex: none;
  color: var(--blue);
  background: var(--blue-bg);
}
.editor-page #title-edit-field:not([hidden]) {
  margin: 0 0 20px;
}
.editor-page .closing-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}
.editor-page .closing-card {
  grid-column: auto;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  margin: 0;
  background: var(--surface);
}
.editor-page .course-editor h3 svg {
  color: var(--amber);
}
.editor-page .closing-card h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  margin: 0 0 18px;
}
.editor-page .closing-card h3 svg {
  width: 19px;
  height: 19px;
  flex: none;
  color: var(--blue);
}
.editor-page .closing-card .upload-zone {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 12px 0;
  border: 0;
  background: transparent;
}
.editor-page .closing-card .attached-file {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 36px 36px;
  gap: 10px;
  padding: 10px;
}
.editor-page .closing-card .attached-file > div {
  min-width: 0;
  grid-column: 2 / -1;
}
.editor-page .closing-card .attached-file strong {
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.editor-page .closing-card .attached-file > .icon-button {
  grid-row: 2;
}
.editor-page .closing-card .attached-file > .icon-button:nth-last-child(2) {
  grid-column: 3;
}
.editor-page .closing-card .attached-file > .icon-button:last-child {
  grid-column: 4;
}
.editor-page .closing-card .course-options {
  flex-direction: column;
  margin-bottom: 0;
}
.editor-page .closing-card .course-option {
  width: 100%;
  min-height: 46px;
}
.editor-page .notebook,
.case-detail .note-card {
  background: #fff8df;
  border: 1px solid #eddfa9;
}
.editor-page .notebook h3,
.case-detail .note-card h3 {
  color: #705b28;
}
.editor-page .notebook h3 svg,
.case-detail .note-card h3 svg {
  color: #a67b24;
}
.case-detail .note-card p {
  padding: 0 8px 0 16px;
  border-left: 2px solid #dd9e8b70;
  line-height: 28px;
  min-height: 84px;
  background: repeating-linear-gradient(transparent 0 27px, #bc9f5b30 27px 28px);
  color: #514426;
  overflow-wrap: anywhere;
}
.editor-page .notebook .field > label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.editor-page .notebook textarea {
  min-height: 224px;
  padding: 0 8px 0 18px;
  border: 0;
  border-left: 2px solid #dd9e8b70;
  border-radius: 0;
  line-height: 28px;
  background: repeating-linear-gradient(transparent 0 27px, #bc9f5b30 27px 28px);
  color: #514426;
  resize: vertical;
}
.editor-page .notebook textarea:focus {
  background: repeating-linear-gradient(transparent 0 27px, #bc9f5b40 27px 28px);
  border-color: #b88a3a;
  outline-offset: 4px;
}
[data-theme='dark'] .editor-page .notebook,
[data-theme='dark'] .case-detail .note-card {
  background: #383124;
  border-color: #716044;
  box-shadow: inset 0 1px 0 #f5d59818;
}
[data-theme='dark'] .editor-page .notebook h3 svg,
[data-theme='dark'] .case-detail .note-card h3 svg {
  color: #e7b960;
}
[data-theme='dark'] .editor-page .notebook textarea,
[data-theme='dark'] .case-detail .note-card p {
  background: repeating-linear-gradient(transparent 0 27px, #edc77824 27px 28px);
  border-left-color: #d8927380;
}
[data-theme='dark'] .editor-page .notebook h3,
[data-theme='dark'] .editor-page .notebook textarea,
[data-theme='dark'] .case-detail .note-card h3,
[data-theme='dark'] .case-detail .note-card p {
  color: #f1e2b5;
}
@media (max-width: 1100px) {
  .editor-page .closing-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .editor-page .closing-card .course-option {
    flex: auto;
  }
}
@media (min-width: 1080px) and (max-width: 1180px) and (orientation: landscape) {
  .compact-register .register-frame {
    grid-template-columns: minmax(360px, 0.85fr) minmax(560px, 1.3fr);
  }
  .compact-register .register-frame .register-list,
  .compact-register .register-frame.has-detail .register-list {
    display: flex;
    border-right: 1px solid var(--line);
  }
  .compact-register .register-frame .register-detail {
    display: block;
  }
  .compact-register .back-button {
    display: none;
  }
}
.refined-detail .patient-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
}
.refined-detail .patient-identity {
  flex: 1;
  min-width: 0;
}
.refined-detail .patient-strip .case-actions {
  margin-left: auto;
  flex: none;
}
.refined-detail .patient-strip .avatar {
  width: 46px;
  height: 46px;
  font-size: 15px;
  border-radius: 16px;
}
.refined-detail .patient-identity h2 {
  font-size: 19px;
  letter-spacing: -0.025em;
}
.refined-detail .patient-identity h2 span {
  font-weight: 450;
}
.refined-detail .patient-identity p {
  font-size: 12px;
  margin-top: 5px;
}
.refined-detail .case-title {
  padding: 27px 0 25px;
  margin-bottom: 0;
}
.refined-detail .case-title > h2 {
  font-size: clamp(25px, 2.25vw, 34px);
  line-height: 1.2;
  font-weight: 620;
  letter-spacing: -0.04em;
  margin: 0 0 18px;
}
.refined-detail .case-metadata {
  font-size: 12px;
  gap: 12px 20px;
}
.refined-detail .case-metadata svg {
  width: 16px;
  height: 16px;
}
.refined-detail .indication {
  padding: 14px 18px;
  border: 0;
  margin-bottom: 30px;
  background: color-mix(in srgb, var(--surface-alt) 40%, var(--surface));
  border-radius: 15px;
}
#editor-attention-slot {
  grid-column: 1 / -1;
}
#editor-attention-slot:empty {
  display: none;
}
.editor-attention {
  border: 1px solid color-mix(in srgb, var(--amber, #b96a0b) 32%, var(--line));
  border-radius: 18px;
  padding: 18px 20px;
  background: var(--surface);
}
.editor-attention header {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 14px;
}
.editor-attention header > svg {
  color: var(--amber, #b96a0b);
  width: 20px;
}
.editor-attention header > span {
  margin-left: auto;
  color: var(--muted);
}
.editor-attention ul {
  padding-left: 20px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.editor-attention-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.editor-attention-links button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.editor-attention-links button:hover {
  color: var(--blue);
  border-color: var(--blue);
}
.editor-attention-links svg {
  width: 13px;
  height: 13px;
}
.composer-v3 .needs-attention-control {
  border-color: color-mix(in srgb, var(--amber, #b96a0b) 65%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--amber, #b96a0b) 12%, transparent);
}
.composer-v3 .needs-attention > label {
  color: var(--amber, #b96a0b);
}
.refined-detail .indication h3 {
  font-size: var(--type-caption);
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
}
.refined-detail .gestures-caption {
  font-size: 11px;
  font-weight: 550;
  color: var(--muted);
  margin: 0 0 9px;
  letter-spacing: 0.025em;
}
.refined-detail .gesture-heading {
  display: flex;
  align-items: center;
  gap: 9px;
}
.refined-detail .gesture-heading h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.refined-detail .gesture-heading .role-pill {
  flex: none;
  white-space: nowrap;
}
.refined-detail .clinical-gesture {
  padding: 22px 0;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.refined-detail .gesture-number {
  width: 27px;
  height: 27px;
  flex: none;
  color: var(--blue);
  background: var(--blue-bg);
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
}
.refined-detail .gesture-family {
  margin: 5px 0 0 36px;
  font-size: 12px;
  color: var(--muted);
}
.refined-detail .clinical-gesture .gesture-heading {
  border: 0;
  padding-bottom: 0;
}
.refined-detail .gesture-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 13px 0 0;
  font-size: 13px;
}
.refined-detail .gesture-facts .role-pill {
  display: inline-flex;
  width: auto;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 9px;
}
.refined-detail .gesture-facts .badge {
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 9px;
}
.refined-detail .team-line {
  margin-top: 11px;
  margin-left: 0;
  font-size: 13px;
}
.inline-course {
  margin-top: 14px;
  padding: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.inline-course label {
  display: grid;
  gap: 8px;
  font-size: 13px;
}
.inline-course textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.inline-course > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.inline-course [role='alert'] {
  color: var(--rose);
}
.refined-detail .document-missing {
  padding: 16px;
  background: transparent;
  border-style: dashed;
  gap: 9px;
}
.refined-detail .document-strip {
  margin-top: 26px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  transition:
    background 180ms ease,
    border-color 180ms ease;
}
.refined-detail [data-record-drop]:hover,
.refined-detail [data-record-drop].is-dragging {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 4%, var(--surface));
}
.refined-detail [data-record-drop].is-dragging {
  outline: 3px solid color-mix(in srgb, var(--blue) 14%, transparent);
  outline-offset: 3px;
}
.refined-detail .document-ready {
  background: transparent;
}
.refined-detail .document-ready .doc-icon {
  background: transparent;
  color: var(--blue);
  border: 0;
  border-radius: 12px;
}
.refined-detail .document-missing .doc-icon {
  width: 25px;
  height: 28px;
  border: 0;
  background: transparent;
}
.refined-detail .document-missing strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.refined-detail .course-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 16px;
}
.refined-detail .course-summary > svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.refined-detail .course-summary .button {
  margin-left: auto;
  font-size: 12px;
  padding: 6px 9px;
}
.refined-detail .case-bottom {
  grid-template-columns: minmax(0, 1fr);
}
.refined-detail .record-note {
  padding: 14px 16px;
  border-radius: 16px;
}
.refined-detail .record-note.is-empty {
  padding: 0;
  border: 0;
  background: transparent;
}
.note-add {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms,
    color 160ms;
}
.note-add > svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.note-add > svg:last-child {
  margin-left: auto;
  color: var(--blue);
}
.note-add:hover {
  border-color: var(--blue);
  color: var(--text);
}
.record-note > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.record-note > header h3 {
  margin: 0;
  font-size: 13px;
}
.record-note > header .icon-button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: inherit;
}
.refined-detail .record-note .note-preview {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
  margin: 0;
}
.refined-detail .record-note.is-expanded .note-preview {
  display: block;
  overflow: visible;
}
.note-read-more {
  border: 0;
  padding: 6px 0 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.note-read-more:hover {
  text-decoration: underline;
}
.note-input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.refined-detail .record-note textarea {
  width: 100%;
  min-height: 112px;
  padding: 0 8px 0 14px;
  border: 0;
  border-left: 2px solid #dd9e8b70;
  border-radius: 0;
  background: repeating-linear-gradient(transparent 0 27px, #bc9f5b30 27px 28px);
  color: #514426;
  line-height: 28px;
  font-size: 13px;
  resize: vertical;
}
[data-theme='dark'] .refined-detail .record-note textarea {
  background: repeating-linear-gradient(transparent 0 27px, #edc77824 27px 28px);
  border-left-color: #d8927380;
  color: #f1e2b5;
}
.note-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.record-note .note-error {
  display: block;
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 10px;
}
@media (max-width: 760px) {
  .refined-detail .patient-strip {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
  }
  .refined-detail .patient-strip .case-actions {
    grid-column: 2;
    margin-left: auto;
  }
  .refined-detail .gesture-heading {
    flex-wrap: nowrap;
    align-items: flex-start;
  }
  .refined-detail .gesture-heading h3 {
    flex: 1;
    min-width: 0;
  }
  .refined-detail .gesture-heading .role-pill {
    margin-left: 25px;
  }
}
.entry-confirmation {
  width: min(540px, calc(100vw - 32px));
}
.entry-confirmation > p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}
.entry-confirmation-fields {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  margin: 20px 0;
  padding: 16px 16px 16px 34px;
  border-radius: 14px;
  background: var(--surface-alt);
  font-size: 14px;
}
.entry-confirmation-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.entry-confirmation-actions .button {
  min-height: 44px;
  font-size: 15px;
  border-radius: 12px;
}
@media (max-width: 520px) {
  .entry-confirmation-actions {
    flex-direction: column-reverse;
  }
  .entry-confirmation-actions .button {
    width: 100%;
  }
}
.source-preview {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.source-preview iframe {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
}
.source-preview img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}
.ai-filled {
  outline: 2px solid color-mix(in srgb, var(--blue) 35%, transparent);
  outline-offset: 4px;
  border-radius: 12px;
}
.title-preview.is-placeholder {
  color: var(--muted);
  font-weight: 400;
}
.ai-warning {
  border-left: 2px solid var(--blue);
  padding-left: 10px;
}
.editor-page.with-source {
  max-width: 1600px;
}
@media (min-width: 1200px) {
  .editor-page.with-source .editor-layout {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 38%);
  }
}
@media (max-width: 800px) {
  .editor-page.with-source .editor-layout {
    display: flex;
    flex-direction: column;
  }
  .editor-page.with-source .editor-rail {
    position: static;
    order: -1;
  }
  .editor-page.with-source .progress-card {
    display: none;
  }
}
