:root {
  --blue: #0c66e0;
  --teal: #12729c;
  --green: #1f8f5f;
  --amber: #b7791f;
  --ink: #1f2937;
  --muted: #667085;
  --line: #d9e2ec;
  --soft: #f5f7fb;
  --white: #ffffff;
  --danger: #b42318;
  --ai-ink: #123a5f;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--soft);
  color: var(--ink);
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  min-height: 38px;
  padding: 8px 14px;
}

button.primary {
  background: var(--blue);
  color: var(--white);
}

button.soft-primary {
  background: #0f766e;
}

button.secondary {
  background: #e7f0ff;
  color: #094da8;
}

button.ghost {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
}

button.small {
  min-height: 30px;
  padding: 5px 10px;
  background: #edf7f3;
  color: var(--green);
}

button.full {
  width: 100%;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 38px;
  padding: 8px 10px;
}

input.ai-filled-field,
select.ai-filled-field,
textarea.ai-filled-field {
  color: var(--ai-ink);
  font-weight: 700;
  background: #f8fbff;
}

textarea {
  resize: vertical;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(12, 102, 224, 0.12), rgba(31, 143, 95, 0.10)),
    #f7f9fc;
}

.login-panel {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  margin-bottom: 16px;
}

.login-panel h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.login-panel p {
  margin: 0 0 20px;
  color: var(--muted);
}

.message {
  min-height: 20px;
  margin-top: 12px;
  color: var(--danger);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.top-actions,
.toolbar-buttons,
.search-row,
.record-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf7f3;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.knowledge-panel {
  padding: 18px 18px 0;
}

.knowledge-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}

.knowledge-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.knowledge-head h2 {
  margin: 0;
  font-size: 18px;
}

.knowledge-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.knowledge-form,
.knowledge-search {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(220px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
}

.knowledge-search {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 12px;
}

.knowledge-note {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
}

.knowledge-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  margin-top: 12px;
  overflow: auto;
}

.knowledge-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.knowledge-item-title {
  font-weight: 800;
}

.knowledge-item-meta {
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
}

.side-panel,
.record-panel {
  min-width: 0;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
}

.panel-block,
.form-band,
.record-toolbar,
.preview-area {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.panel-block {
  padding: 16px;
}

.side-panel .panel-block {
  padding: 12px;
}

.panel-block h2,
.band-title h2 {
  margin: 0;
  font-size: 15px;
}

.side-panel .panel-block h2 {
  font-size: 13px;
}

.compact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.side-panel label {
  gap: 3px;
}

.side-panel label span {
  font-size: 11px;
}

.side-panel input,
.side-panel select,
.side-panel textarea {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 12px;
}

.side-panel button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.search-row input {
  min-width: 0;
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
}

.empty-list {
  color: var(--muted);
  font-size: 13px;
}

.list-item {
  display: grid;
  gap: 3px;
  align-items: start;
  text-align: left;
  width: 100%;
  min-height: auto;
  padding: 8px 9px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.25;
  overflow: hidden;
}

.list-item.active {
  border-color: var(--blue);
  background: #f3f8ff;
}

.list-title {
  min-width: 0;
  font-weight: 800;
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-meta-sub {
  color: #85909b;
  font-size: 10px;
  font-weight: 700;
}

.record-toolbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(230px, 0.68fr) minmax(0, 2fr);
  gap: 0;
  align-items: stretch;
  margin-bottom: 14px;
  overflow: hidden;
  border-color: #d8dbde;
  background:
    linear-gradient(135deg, rgba(180, 182, 184, 0.16), rgba(255, 255, 255, 0.88)),
    #ffffff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.07);
}

.record-toolbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #f4511e 0%, #f4511e 28%, #b5b7b9 28%, #d5d7d9 72%, #1b8f8a 72%, #1b8f8a 100%);
}

.record-context {
  position: relative;
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 124px;
  padding: 18px 20px;
  overflow: hidden;
  color: #182230;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 247, 248, 0.9)),
    #f4f5f5;
  border-right: 1px solid #d8dbde;
}

.record-context::before {
  content: "";
  position: absolute;
  right: -42px;
  top: 0;
  width: 34%;
  height: 100%;
  background: #f4511e;
  clip-path: polygon(42% 0, 100% 0, 100% 100%, 8% 100%, 0 62%, 12% 42%);
  opacity: 0.96;
}

.record-context::after {
  content: "FU";
  position: absolute;
  right: 14px;
  bottom: -18px;
  color: rgba(255, 255, 255, 0.22);
  font-size: 62px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.record-context-label {
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: calc(100% - 72px);
  margin-bottom: 8px;
  padding: 3px 8px;
  border: 1px solid #cfd3d6;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #5b636b;
  font-size: 11px;
  font-weight: 800;
}

.record-context .current-title,
.record-context .current-subtitle {
  position: relative;
  z-index: 1;
}

.record-context .current-title {
  max-width: calc(100% - 72px);
  overflow-wrap: anywhere;
  color: #182230;
  font-size: 22px;
  line-height: 1.22;
}

.record-context .current-subtitle {
  max-width: calc(100% - 72px);
  margin-top: 6px;
  color: #697179;
  font-size: 13px;
}

.toolbar-buttons {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 0.68fr) minmax(300px, 1.1fr);
  gap: 8px;
  align-content: center;
  min-width: 0;
  padding: 12px;
}

.toolbar-group {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #dfe2e5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.toolbar-group-record {
  grid-template-columns: minmax(78px, 0.85fr) minmax(78px, 0.8fr) minmax(108px, 1.15fr);
}

.toolbar-group-ai,
.toolbar-group-delivery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toolbar-group-label {
  display: inline-flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 6px;
  color: #5f666d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.toolbar-group-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #f4511e;
  box-shadow: 0 0 0 4px rgba(244, 81, 30, 0.12);
}

.toolbar-group-ai .toolbar-group-label::before {
  background: #1b8f8a;
  box-shadow: 0 0 0 4px rgba(27, 143, 138, 0.12);
}

.toolbar-group-delivery .toolbar-group-label::before {
  background: #a9adb1;
  box-shadow: 0 0 0 4px rgba(169, 173, 177, 0.16);
}

.toolbar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 38px;
  padding: 8px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(31, 41, 55, 0.05);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.toolbar-action .toolbar-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.toolbar-action .btn-text {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
}

.toolbar-action.primary {
  background: linear-gradient(135deg, #f4511e, #df3f14);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(244, 81, 30, 0.24);
}

.toolbar-action.soft-primary {
  background: linear-gradient(135deg, #167a76, #20a39d);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(27, 143, 138, 0.22);
}

.toolbar-action.secondary {
  border-color: #d8dcdf;
  background: linear-gradient(180deg, #ffffff, #f2f3f4);
  color: #424a52;
}

.toolbar-action.ghost {
  border-color: #d8dcdf;
  background: #ffffff;
  color: #252b31;
}

.toolbar-action:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(244, 81, 30, 0.24);
  box-shadow: 0 14px 24px rgba(31, 41, 55, 0.1);
}

.toolbar-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

@media (max-width: 1480px) and (min-width: 1101px) {
  .workspace {
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .side-panel {
    font-size: 11px;
  }

  .side-panel .panel-block {
    padding: 10px;
  }

  .side-panel input,
  .side-panel select,
  .side-panel textarea {
    font-size: 11px;
  }

  .form-band {
    padding: 14px;
  }

  .record-toolbar {
    grid-template-columns: minmax(230px, 0.58fr) minmax(0, 1.42fr);
  }

  .toolbar-buttons {
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  }

  .toolbar-group-delivery {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.ai-panel {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid #b7d7f0;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fcff, #ffffff);
}

.ai-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.ai-panel h2 {
  margin: 0;
  color: #0a5578;
  font-size: 17px;
}

.ai-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ai-status {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e7f7f4;
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
}

.ai-warning {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
}

.ai-result {
  max-height: 520px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid #d7e6f2;
  border-radius: 8px;
  background: #fbfdff;
  color: #24313d;
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ai-result h3,
.ai-result h4,
.ai-result h5 {
  margin: 16px 0 8px;
  color: #0a5578;
  line-height: 1.25;
}

.ai-result h3:first-child,
.ai-result h4:first-child,
.ai-result h5:first-child {
  margin-top: 0;
}

.ai-result p {
  margin: 8px 0;
}

.ai-result strong {
  color: #b42318;
  font-weight: 800;
}

.ai-result ul,
.ai-result ol {
  margin: 8px 0 12px;
  padding-left: 22px;
}

.ai-result li {
  margin: 4px 0;
}

.ai-table-wrap {
  max-width: 100%;
  margin: 8px 0 14px;
  overflow: auto;
  border: 1px solid #d6e4f0;
  border-radius: 8px;
}

.ai-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: #fff;
}

.ai-table th,
.ai-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e7eef6;
  border-right: 1px solid #e7eef6;
  text-align: left;
  vertical-align: top;
}

.ai-table th {
  background: #eaf4ff;
  color: #094da8;
  font-size: 13px;
}

.ai-table tr:last-child td {
  border-bottom: 0;
}

.ai-table th:last-child,
.ai-table td:last-child {
  border-right: 0;
}

.ai-refs {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #cde8df;
  border-radius: 8px;
  background: #f4fbf8;
  color: #175943;
  font-size: 13px;
}

.ai-refs h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.ai-refs ul {
  margin: 0;
  padding-left: 18px;
}

.ai-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.current-title {
  font-weight: 800;
}

.current-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.record-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-band {
  padding: 18px;
}

.band-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e8f0fe;
}

.band-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.wide {
  grid-column: 1 / -1;
}

.section-note {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border-left: 4px solid #12729c;
  border-radius: 8px;
  background: #f3f8fb;
  color: #53606a;
  font-size: 13px;
}

.ai-helper-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.ai-helper-pane {
  min-width: 0;
  padding: 14px;
  border: 1px solid #d8e7f3;
  border-radius: 8px;
  background: #fbfdff;
}

.helper-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.helper-head h3 {
  margin: 0;
  color: #0a5578;
  font-size: 15px;
}

.helper-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.helper-controls {
  display: grid;
  gap: 10px;
}

.inline-check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

.inline-check input {
  width: auto;
  min-height: auto;
}

.inline-check span {
  font-size: 13px;
}

.helper-result {
  max-height: 360px;
  margin-top: 12px;
}

.import-result-note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #cde8df;
  border-radius: 8px;
  background: #f4fbf8;
  color: #175943;
  font-size: 13px;
}

.import-result-note strong {
  display: block;
  margin-bottom: 4px;
}

.import-result-note ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.plan-card-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.plan-card-tabs button {
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid #cbdff0;
  background: #fff;
  color: #475467;
  font-size: 13px;
}

.plan-card-tabs button.active {
  border-color: #12729c;
  background: #eef7fb;
  color: #12729c;
}

.upload-strip {
  display: grid;
  grid-template-columns: minmax(0, 280px) 120px 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #b9c7d9;
  border-radius: 10px;
  background: #fbfcff;
}

#imagePreview {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

#imageHint {
  color: var(--muted);
  font-size: 13px;
}

.media-panel {
  display: grid;
  gap: 14px;
}

.media-card {
  padding: 14px;
  border: 1px solid #d7e6f2;
  border-radius: 8px;
  background: #fbfdff;
}

.media-card-head {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) minmax(140px, 0.55fr) 38px;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.media-card-body {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.media-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px dashed #b9c7d9;
  border-radius: 8px;
  background: #fff;
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.media-placeholder {
  padding: 10px;
  color: #8a97a3;
  font-size: 13px;
  text-align: center;
}

.media-file {
  margin-top: 8px;
  padding: 6px;
  font-size: 12px;
}

.media-file-name {
  margin-top: 6px;
  color: #667085;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.plan-stage-table {
  table-layout: fixed;
}

.plan-stage-table th:nth-child(1),
.plan-stage-table td:nth-child(1),
.plan-stage-table th:nth-child(2),
.plan-stage-table td:nth-child(2) {
  width: 12%;
}

.plan-stage-table th:nth-child(3),
.plan-stage-table td:nth-child(3),
.plan-stage-table th:nth-child(4),
.plan-stage-table td:nth-child(4) {
  width: 36%;
}

.plan-stage-table th:nth-child(5),
.plan-stage-table td:nth-child(5) {
  width: 58px;
}

.plan-stage-table textarea {
  min-height: 62px;
}

.posture-picker {
  display: grid;
  grid-template-columns: minmax(240px, 32%) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.posture-body-map {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid #d7e6f2;
  border-radius: 10px;
  background: #fff;
}

.posture-body-map img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.posture-hotspots {
  position: absolute;
  inset: 0;
}

.posture-hotspot {
  position: absolute;
  min-height: 24px;
  padding: 3px 8px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(12, 113, 151, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #075f82;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
}

.posture-hotspot.active,
.posture-hotspot.selected {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.posture-workspace {
  display: grid;
  gap: 10px;
}

.posture-active-panel {
  min-height: 122px;
  padding: 12px;
  border: 1px solid #d7e6f2;
  border-radius: 10px;
  background: #fbfdff;
}

.posture-active-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 9px;
}

.posture-active-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.posture-active-head strong {
  color: var(--teal);
  font-size: 18px;
}

.posture-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  max-height: 296px;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.posture-summary-chip {
  min-height: 46px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.posture-summary-chip span,
.posture-summary-chip em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.posture-summary-chip span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.posture-summary-chip em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.posture-summary-chip.active {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.posture-summary-chip.selected em {
  color: var(--teal);
  font-weight: 800;
}

.choice-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.choice {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}

.choice.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.scale-panel {
  display: grid;
  gap: 14px;
}

.scale-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d7e6f2;
  border-radius: 8px;
  background: #fbfdff;
}

.scale-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.scale-chip input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.scale-chip.active {
  border-color: var(--teal);
  background: #e7f7f4;
  color: #0f766e;
}

.scale-hint,
.scale-empty {
  color: var(--muted);
  font-size: 13px;
}

.scale-selected-wrap {
  display: grid;
  gap: 14px;
}

.scale-card {
  border: 1px solid #d7e6f2;
  border-radius: 10px;
  background: #fbfdff;
  overflow: hidden;
}

.scale-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #e5eef7;
  background: #f3f8ff;
}

.scale-card-head h3 {
  margin: 0;
  color: #094da8;
  font-size: 15px;
}

.scale-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.scale-card-head > span {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.scale-questions {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.scale-question {
  display: grid;
  grid-template-columns: minmax(220px, 0.92fr) minmax(0, 1.6fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e6edf5;
  border-radius: 8px;
  background: #fff;
}

.scale-question-title {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.scale-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 6px;
}

.scale-options label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcff;
  cursor: pointer;
}

.scale-options input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.scale-options span {
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.scale-result-card {
  display: grid;
  grid-template-columns: 150px 200px minmax(0, 1fr);
  gap: 10px;
  margin: 0 14px 14px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #d7e6f2;
  background: #fff;
}

.scale-result-card > div {
  min-width: 0;
}

.scale-result-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.scale-result-card strong {
  display: block;
  margin-top: 3px;
  color: #1f2937;
  font-size: 14px;
}

.scale-result-card p {
  margin: 0;
  color: #475467;
  font-size: 13px;
}

.scale-warning {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border-radius: 7px;
  background: #fff1f0;
  color: #b42318;
  font-size: 13px;
  font-weight: 800;
}

.risk-neutral {
  border-color: #d0d5dd;
  background: #f9fafb;
}

.risk-low {
  border-color: #b7e4cc;
  background: #f3fbf6;
}

.risk-medium {
  border-color: #fedf89;
  background: #fffbeb;
}

.risk-high {
  border-color: #fdb022;
  background: #fff7ed;
}

.risk-critical {
  border-color: #fda29b;
  background: #fff1f0;
}

.scale-summary {
  display: grid;
  gap: 8px;
}

.scale-summary h3 {
  margin: 0;
  color: var(--teal);
  font-size: 14px;
}

.scale-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.scale-summary-table th,
.scale-summary-table td {
  padding: 9px 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.scale-summary-table th {
  background: #f3f8ff;
  color: #094da8;
}

.risk-pill {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.table-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 8px;
}

.table-tools h3 {
  margin: 0;
  color: var(--teal);
  font-size: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.table-scroll .data-table {
  margin-bottom: 0;
}

.data-table th,
.data-table td {
  border: 1px solid var(--line);
  padding: 7px;
  text-align: center;
}

.data-table th {
  background: #f3f8ff;
  color: #094da8;
  white-space: nowrap;
  word-break: keep-all;
}

.data-table input,
.data-table select,
.data-table textarea {
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 0;
  text-align: center;
  padding: 4px;
}

.data-table input.ai-filled-field,
.data-table select.ai-filled-field,
.data-table textarea.ai-filled-field {
  color: var(--ai-ink);
  background: #f8fbff;
}

.data-table textarea {
  resize: vertical;
  text-align: left;
  line-height: 1.45;
}

.palpation-table,
.action-test-table,
.rom-table,
.mmt-table,
.dist-table,
.neuro-table {
  table-layout: fixed;
}

.palpation-table {
  min-width: 560px;
}

.action-test-table,
.rom-table,
.neuro-table {
  min-width: 1120px;
}

.mmt-table,
.dist-table {
  min-width: 680px;
}

.palpation-table th:nth-child(1),
.palpation-table td:nth-child(1) {
  width: 210px;
}

.palpation-table th:nth-child(2),
.palpation-table td:nth-child(2) {
  width: 300px;
}

.action-test-table th:nth-child(1),
.action-test-table td:nth-child(1) {
  width: 135px;
}

.action-test-table th:nth-child(2),
.action-test-table td:nth-child(2) {
  width: 190px;
}

.action-test-table th:nth-child(3),
.action-test-table td:nth-child(3),
.action-test-table th:nth-child(4),
.action-test-table td:nth-child(4) {
  width: 370px;
}

.rom-table th:nth-child(1),
.rom-table td:nth-child(1) {
  width: 135px;
}

.rom-table th:nth-child(2),
.rom-table td:nth-child(2) {
  width: 190px;
}

.rom-table th:nth-child(3),
.rom-table td:nth-child(3),
.rom-table th:nth-child(4),
.rom-table td:nth-child(4) {
  width: 370px;
}

.mmt-table th:nth-child(1),
.mmt-table td:nth-child(1) {
  width: 120px;
}

.mmt-table th:nth-child(2),
.mmt-table td:nth-child(2) {
  width: 310px;
}

.mmt-table th:nth-child(3),
.mmt-table td:nth-child(3),
.mmt-table th:nth-child(4),
.mmt-table td:nth-child(4) {
  width: 95px;
}

.dist-table th:nth-child(1),
.dist-table td:nth-child(1) {
  width: 190px;
}

.dist-table th:nth-child(2),
.dist-table td:nth-child(2) {
  width: 72px;
}

.dist-table th:nth-child(3),
.dist-table td:nth-child(3),
.dist-table th:nth-child(4),
.dist-table td:nth-child(4),
.dist-table th:nth-child(5),
.dist-table td:nth-child(5) {
  width: 118px;
}

.neuro-table th:nth-child(1),
.neuro-table td:nth-child(1) {
  width: 135px;
}

.neuro-table th:nth-child(2),
.neuro-table td:nth-child(2) {
  width: 190px;
}

.neuro-table th:nth-child(3),
.neuro-table td:nth-child(3),
.neuro-table th:nth-child(4),
.neuro-table td:nth-child(4) {
  width: 370px;
}

.palpation-table th:last-child,
.palpation-table td:last-child,
.action-test-table th:last-child,
.action-test-table td:last-child,
.rom-table th:last-child,
.rom-table td:last-child,
.mmt-table th:last-child,
.mmt-table td:last-child,
.dist-table th:last-child,
.dist-table td:last-child,
.neuro-table th:last-child,
.neuro-table td:last-child {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  padding: 4px;
}

.remove-row {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 50%;
  background: #fff0ee;
  color: var(--danger);
}

.preview-area {
  margin-top: 16px;
  padding: 0;
  overflow: auto;
  background: #e9edf2;
}

.preview-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  min-width: 842px;
  padding: 24px;
  background: #e9edf2;
}

.report-page {
  position: relative;
  flex: 0 0 auto;
  width: 794px;
  height: 1123px;
  overflow: hidden;
  background: #fff;
  color: #3d4650;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.42;
}

.report-cover,
.report-back {
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

.report-cover {
  background-image: url("/assets/report-cover.png");
}

.report-cover::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 420px;
  left: 330px;
  width: 440px;
  height: 250px;
  background: #fff;
}

.report-back {
  background-image: url("/assets/report-back.png");
}

.report-back-overlay {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 190px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  padding: 22px 54px 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -18px 42px rgba(255, 255, 255, 0.86);
}

.report-back-brand {
  display: grid;
  align-content: center;
  gap: 6px;
  border-right: 1px solid #d1d9e2;
  padding-right: 20px;
}

.report-back-brand img {
  width: 145px;
  height: 48px;
  object-fit: contain;
  object-position: left center;
}

.report-back-brand strong {
  color: #f05a24;
  font-size: 18px;
}

.report-back-brand span {
  color: #26323d;
  font-size: 12px;
  letter-spacing: 2px;
}

.report-back-stores {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.report-back-stores > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d8e4ee;
  border-radius: 8px;
  background: #f8fbfd;
}

.report-back-stores > div.active {
  border-color: #0b7fa9;
  background: #eef9fc;
}

.report-back-stores b,
.report-back-stores span {
  display: block;
  overflow-wrap: anywhere;
}

.report-back-stores b {
  margin-bottom: 5px;
  color: #0b6f94;
  font-size: 12px;
}

.report-back-stores span {
  color: #4d5964;
  font-size: 9px;
  line-height: 1.55;
}

.report-cover-id {
  position: absolute;
  z-index: 2;
  top: 112px;
  right: 10px;
  width: 430px;
  padding: 12px 14px;
  background: #fff;
  color: #05749d;
  font-family: Georgia, serif;
  font-size: 27px;
  text-align: right;
}

.report-cover-fields {
  position: absolute;
  z-index: 2;
  top: 438px;
  left: 350px;
  width: 380px;
  display: grid;
  gap: 18px;
}

.report-cover-fields div {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: end;
  gap: 12px;
}

.report-cover-fields span {
  color: #2e3338;
  font-size: 23px;
}

.report-cover-fields b {
  min-height: 34px;
  border-bottom: 2px solid #1680a8;
  color: #0877a0;
  font-size: 18px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.report-inner {
  padding: 50px 34px 48px;
}

.report-page-header {
  margin-bottom: 28px;
}

.report-logo {
  display: block;
  width: 190px;
  height: 48px;
  margin: 0 0 20px 24px;
  object-fit: contain;
  object-position: left center;
}

.report-band {
  display: flex;
  align-items: center;
  min-height: 52px;
  background: #dceef9;
  color: #096f9d;
}

.report-band strong {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 18px;
  background: #bee1f5;
  font-family: STSong, SimSun, serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 8px;
  white-space: nowrap;
}

.report-band span {
  flex: 1;
  padding: 0 14px;
  font-size: 28px;
  letter-spacing: 8px;
  text-align: center;
  white-space: nowrap;
}

.report-block {
  margin-bottom: 22px;
}

.report-block h3,
.report-summary-box h3,
.report-rehab-box h3 {
  margin: 0 0 12px;
  padding: 0 10px 7px;
  border-bottom: 2px solid #0a79aa;
  color: #0877a0;
  font-size: 17px;
}

.report-block h3 small,
.report-summary-box h3 small,
.report-rehab-box h3 small {
  font-size: 13px;
}

.report-facts {
  display: grid;
  gap: 12px;
}

.report-facts-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-facts-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-facts-compact {
  margin-top: 13px;
}

.report-facts-two {
  grid-template-columns: 2fr 1fr;
  margin-top: 13px;
}

.report-facts div,
.report-long-field {
  min-width: 0;
}

.report-facts span,
.report-long-field span {
  display: block;
  margin-bottom: 4px;
  color: #0877a0;
  font-size: 11px;
}

.report-facts b,
.report-long-field b {
  display: block;
  min-height: 24px;
  padding: 2px 5px;
  border-bottom: 1px dashed #0b79aa;
  color: #4c5660;
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.report-long-field {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: start;
  gap: 12px;
  margin-top: 12px;
}

.report-long-field b {
  min-height: 44px;
}

.report-media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 270px;
  border: 1px dashed #5ea1c4;
}

.report-injury-card,
.report-imaging-card {
  position: relative;
  min-width: 0;
  padding: 26px 12px 10px;
  overflow: hidden;
}

.report-injury-card {
  border-right: 1px dashed #5ea1c4;
}

.report-injury-card > span,
.report-imaging-card > span {
  position: absolute;
  top: 5px;
  left: 10px;
  color: #0877a0;
  font-size: 12px;
}

.report-injury-card > strong {
  position: absolute;
  z-index: 2;
  top: 5px;
  right: 12px;
  color: #4a5560;
  font-size: 12px;
}

.report-body-mini {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

.report-body-mini img {
  position: absolute;
  top: 0;
  left: 50%;
  width: auto;
  max-width: none;
  height: 100%;
  transform: translateX(-18%);
  object-fit: contain;
}

.report-body-photo img {
  left: 0;
  width: 100%;
  height: 100%;
  transform: none;
  object-fit: contain;
}

.report-body-photo em {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  z-index: 2;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: #52606c;
  font-size: 10px;
  font-style: normal;
  text-align: center;
}

.injury-marker {
  position: absolute;
  z-index: 3;
  top: var(--marker-y);
  left: var(--marker-x);
  width: 17px;
  height: 17px;
  transform: translate(-50%, -50%);
  border: 3px solid #fff;
  border-radius: 50%;
  background: #f4511e;
  box-shadow: 0 0 0 3px rgba(244, 81, 30, 0.42), 0 2px 8px rgba(90, 30, 12, 0.35);
}

.injury-marker::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px solid rgba(244, 81, 30, 0.7);
  border-radius: 50%;
}

.report-imaging-card > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.report-image-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  color: #9aa7b3;
  font-size: 12px;
}

.report-facts.compact {
  margin-top: 10px;
}

.report-footer {
  position: absolute;
  left: 58px;
  right: 58px;
  bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #aeb4bb;
  font-family: STSong, SimSun, serif;
  font-size: 11px;
  letter-spacing: 5px;
}

.report-footer b {
  position: absolute;
  right: 0;
  color: #9da6af;
  font-family: Arial, sans-serif;
  letter-spacing: 0;
}

.report-posture-block {
  margin-top: 10px;
}

.report-posture-layout {
  display: grid;
  grid-template-columns: 1fr 230px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 610px;
}

.report-posture-list {
  display: grid;
  gap: 12px;
  align-content: start;
}

.report-posture-item {
  min-width: 0;
}

.report-posture-item span {
  display: block;
  color: #0877a0;
  font-size: 13px;
  line-height: 1.15;
  letter-spacing: 2px;
}

.report-posture-item b {
  display: block;
  min-height: 18px;
  margin-top: 2px;
  border-bottom: 1px dashed #78a9c1;
  color: #55616c;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.report-body-figure {
  position: relative;
  height: 590px;
  overflow: hidden;
  background: #fff;
}

.report-posture-page .report-note-box {
  min-height: 118px;
}

.report-body-figure img {
  position: absolute;
  top: 0;
  left: 50%;
  width: auto;
  max-width: none;
  height: 100%;
  transform: translateX(-18%);
  object-fit: contain;
  opacity: 0.78;
}

.report-note-box {
  min-height: 92px;
  padding: 10px 14px;
  border: 1px solid #b9d8e8;
  background: #f5fbfe;
}

.report-note-box span {
  color: #0877a0;
  font-size: 12px;
  font-weight: 700;
}

.report-note-box p {
  margin: 5px 0 0;
  font-size: 11px;
}

.report-functional-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 18px;
  height: 865px;
}

.report-functional-notes,
.report-functional-tables {
  min-width: 0;
}

.report-functional-notes {
  display: grid;
  grid-template-rows: 0.85fr 0.8fr 0.58fr 0.85fr;
  border: 1px dashed #bdd1de;
  background: linear-gradient(90deg, #dcecf7 0 72px, #fff 72px);
}

.report-functional-notes > div {
  min-height: 0;
  padding: 12px 12px 10px 86px;
  border-bottom: 1px dashed #d3dde4;
  overflow: hidden;
}

.report-functional-notes > div:last-child {
  border-bottom: 0;
}

.report-functional-notes h3,
.report-functional-tables h3 {
  margin: 0 0 8px;
  color: #0877a0;
  font-size: 13px;
}

.report-functional-tables h3:not(:first-child) {
  margin-top: 10px;
}

.report-functional-notes p {
  margin: 0;
  color: #56616b;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.report-functional-tables .preview-table {
  font-size: 8.5px;
}

.report-functional-tables .preview-table th,
.report-functional-tables .preview-table td {
  height: 22px;
  padding: 3px;
}

.report-palpation-table th:nth-child(1),
.report-palpation-table td:nth-child(1) {
  width: 34%;
}

.report-palpation-table th:nth-child(2),
.report-palpation-table td:nth-child(2) {
  width: 66%;
}

.report-rom-table th:nth-child(1),
.report-rom-table td:nth-child(1) {
  width: 12%;
}

.report-rom-table th:nth-child(2),
.report-rom-table td:nth-child(2) {
  width: 20%;
}

.report-rom-table th:nth-child(3),
.report-rom-table td:nth-child(3),
.report-rom-table th:nth-child(4),
.report-rom-table td:nth-child(4) {
  width: 34%;
}

.report-dist-table th:nth-child(1),
.report-dist-table td:nth-child(1) {
  width: 23%;
}

.report-dist-table th:nth-child(2),
.report-dist-table td:nth-child(2) {
  width: 9%;
}

.report-dist-table th:nth-child(3),
.report-dist-table td:nth-child(3),
.report-dist-table th:nth-child(4),
.report-dist-table td:nth-child(4),
.report-dist-table th:nth-child(5),
.report-dist-table td:nth-child(5) {
  width: 22.666%;
}

.report-action-table th:nth-child(1),
.report-action-table td:nth-child(1) {
  width: 12%;
}

.report-action-table th:nth-child(2),
.report-action-table td:nth-child(2) {
  width: 20%;
}

.report-action-table th:nth-child(3),
.report-action-table td:nth-child(3),
.report-action-table th:nth-child(4),
.report-action-table td:nth-child(4) {
  width: 34%;
}

.report-neuro-table th:nth-child(1),
.report-neuro-table td:nth-child(1) {
  width: 12%;
}

.report-neuro-table th:nth-child(2),
.report-neuro-table td:nth-child(2) {
  width: 20%;
}

.report-neuro-table th:nth-child(3),
.report-neuro-table td:nth-child(3),
.report-neuro-table th:nth-child(4),
.report-neuro-table td:nth-child(4) {
  width: 34%;
}

.report-mmt-table th:nth-child(1),
.report-mmt-table td:nth-child(1) {
  width: 54%;
}

.report-mmt-table th:nth-child(2),
.report-mmt-table td:nth-child(2),
.report-mmt-table th:nth-child(3),
.report-mmt-table td:nth-child(3) {
  width: 23%;
}

.report-functional-side-note {
  min-height: 54px;
  max-height: 92px;
  padding: 7px 8px;
  overflow: hidden;
  border: 1px dashed #cad5df;
  background: #fbfdff;
}

.report-functional-side-note p {
  margin: 0;
  color: #56616b;
  font-size: 9px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.report-functional-supplement-page .report-page-header {
  margin-bottom: 22px;
}

.report-supplement-block {
  margin: 0 8px;
}

.report-supplement-list {
  display: grid;
  gap: 14px;
}

.report-supplement-item {
  padding: 13px 15px;
  border: 1px solid #b9d8e8;
  border-left: 5px solid #0877a0;
  border-radius: 8px;
  background: #f8fcff;
}

.report-supplement-item h4 {
  margin: 0 0 7px;
  color: #0877a0;
  font-size: 14px;
}

.report-supplement-item p {
  margin: 0;
  color: #4f5b66;
  font-size: 11px;
  line-height: 1.72;
  overflow-wrap: anywhere;
  white-space: normal;
}

.report-functional-tables {
  padding: 12px 12px 16px;
  border: 1px dashed #bdd1de;
}

.report-functional-tables h3 {
  margin: 0 -12px 8px;
  padding: 9px 12px;
  background: #dcecf7;
  text-align: center;
}

.report-functional-tables h3:not(:first-child) {
  margin-top: 24px;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: #4d5964;
  font-size: 10px;
}

.preview-table th {
  background: #4b74c8;
  color: #fff;
  font-weight: 700;
}

.preview-table th,
.preview-table td {
  height: 34px;
  padding: 5px 4px;
  border: 1px solid #8eadeb;
  text-align: center;
  overflow-wrap: anywhere;
}

.preview-table tbody tr:nth-child(even) td {
  background: #edf3fd;
}

.report-small-table {
  font-size: 8px;
}

.report-small-table th,
.report-small-table td {
  height: 24px;
  padding: 3px;
}

.report-empty {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px dashed #cad5df;
  color: #9aa5af;
  font-size: 10px;
}

.report-summary-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 310px;
  margin: 20px 14px 30px;
  padding: 18px;
  border: 2px solid #2c5ebd;
  border-radius: 42px;
  background: #eef4fd;
}

.report-summary-box > div {
  padding: 0 12px;
}

.report-summary-box p {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 7px;
  min-height: 88px;
  margin: 12px 0 0;
  color: #4f5b66;
  font-size: 11px;
}

.report-summary-box p b {
  color: #202a35;
  font-size: 18px;
}

.report-rehab-box {
  min-height: 475px;
  margin: 0 18px;
  padding: 25px 26px;
  border: 2px solid #2c5ebd;
  border-radius: 42px;
  background: #eef4fd;
}

.report-goal {
  display: grid;
  grid-template-columns: 110px 1fr 90px 140px;
  align-items: center;
  min-height: 42px;
  margin-bottom: 12px;
  background: #d8e2f1;
}

.report-goal span,
.report-goal b {
  padding: 8px 10px;
  color: #0877a0;
  font-size: 11px;
}

.report-goal b {
  color: #4d5964;
  font-weight: 600;
}

.report-rehab-box dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px 14px;
  margin: 0;
  font-size: 10px;
}

.report-rehab-box dt {
  color: #0877a0;
}

.report-rehab-box dd {
  margin: 0;
  color: #59636d;
  overflow-wrap: anywhere;
}

.report-signatures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin: 22px 52px 0;
}

.report-signatures span {
  display: block;
  color: #0877a0;
  font-size: 10px;
}

.report-signatures b {
  display: block;
  min-height: 25px;
  margin-top: 4px;
  border-bottom: 1px dashed #0b79aa;
  color: #4d5964;
  font-size: 11px;
  font-weight: 500;
}

.report-scale-page .report-page-header {
  margin-bottom: 18px;
}

.report-scale-page .report-band strong {
  font-size: 23px;
  letter-spacing: 4px;
}

.report-scale-page .report-band span {
  font-size: 20px;
  letter-spacing: 2px;
}

.report-scale-page .report-block {
  margin-bottom: 12px;
}

.report-scale-table {
  font-size: 8.6px;
}

.report-scale-table th,
.report-scale-table td {
  height: auto;
  min-height: 30px;
  padding: 5px 6px;
  line-height: 1.35;
  vertical-align: top;
}

.report-scale-table th:nth-child(1),
.report-scale-table td:nth-child(1) {
  width: 112px;
}

.report-scale-table th:nth-child(2),
.report-scale-table td:nth-child(2) {
  width: 62px;
  text-align: center;
}

.report-scale-table th:nth-child(3),
.report-scale-table td:nth-child(3) {
  width: 94px;
}

.report-scale-table td small {
  display: block;
  margin-top: 2px;
  color: #71808d;
  font-size: 7.4px;
  line-height: 1.25;
}

.report-risk {
  display: inline-block;
  max-width: 86px;
  padding: 3px 5px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.35;
}

.report-risk-neutral,
.report-risk-low {
  background: #edf7f3;
  color: #147d56;
}

.report-risk-medium {
  background: #fffbeb;
  color: #b7791f;
}

.report-risk-high {
  background: #fff7ed;
  color: #c2410c;
}

.report-risk-critical {
  background: #fff1f0;
  color: #b42318;
}

.report-scale-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.report-scale-note {
  min-height: 88px;
  padding: 8px;
  border: 1px solid #cbdff0;
  border-left: 5px solid #7aa6c7;
  border-radius: 8px;
  background: #fbfdff;
}

.report-risk-border-low {
  border-left-color: #2f9461;
}

.report-risk-border-medium {
  border-left-color: #d09218;
}

.report-risk-border-high {
  border-left-color: #f97316;
}

.report-risk-border-critical {
  border-left-color: #d92d20;
}

.report-scale-note h3 {
  margin: 0 0 5px;
  color: #0877a0;
  font-size: 10.5px;
}

.report-scale-note p {
  margin: 3px 0 0;
  color: #53606a;
  font-size: 8.4px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.report-scale-disclaimer {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 54px;
  min-height: 54px;
  padding: 8px 12px;
}

.report-scale-disclaimer p {
  font-size: 9px;
  line-height: 1.45;
}

.report-media-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.report-media-card {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 10px;
  min-height: 180px;
  padding: 10px;
  border: 1px solid #cbdff0;
  border-radius: 8px;
  background: #fbfdff;
}

.report-media-thumb {
  display: grid;
  place-items: center;
  width: 128px;
  height: 158px;
  overflow: hidden;
  border: 1px solid #d8e5ef;
  border-radius: 7px;
  background: #fff;
}

.report-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.report-media-copy {
  min-width: 0;
}

.report-media-copy strong {
  display: block;
  color: #1f2937;
  font-size: 12px;
}

.report-media-copy span {
  display: block;
  margin: 2px 0 6px;
  color: #0877a0;
  font-size: 9px;
  font-weight: 700;
}

.report-media-copy p {
  margin: 4px 0;
  color: #53606a;
  font-size: 8.6px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.report-media-note {
  position: absolute;
  left: 58px;
  right: 58px;
  bottom: 58px;
}

.report-client-plan-page .report-page-header {
  margin-bottom: 14px;
}

.client-plan-shell {
  margin: 0 10px;
  padding: 18px;
  border: 1px solid #cbdff0;
  border-radius: 16px;
  background: #ffffff;
}

.client-plan-hero {
  display: grid;
  grid-template-columns: 1fr 210px;
  gap: 18px;
  min-height: 112px;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef7f4, #f7fbff);
  border: 1px solid #c7dfd8;
}

.client-plan-hero span {
  color: #12729c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
}

.client-plan-hero h2 {
  margin: 7px 0 5px;
  color: #182230;
  font-size: 25px;
  line-height: 1.18;
  letter-spacing: 0;
}

.client-plan-hero p {
  margin: 0;
  color: #53606a;
  font-size: 12px;
}

.client-plan-hero dl {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  margin: 0;
  align-content: center;
  color: #475467;
  font-size: 10px;
}

.client-plan-hero dt {
  color: #12729c;
  font-weight: 800;
}

.client-plan-hero dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.client-plan-section {
  margin-top: 14px;
}

.client-plan-section h3 {
  margin: 0 0 8px;
  color: #12729c;
  font-size: 13px;
  letter-spacing: 1px;
}

.client-plan-issue-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: issue;
}

.client-plan-issue-list li {
  position: relative;
  min-height: 52px;
  padding: 10px 10px 10px 34px;
  border: 1px solid #d9e8ef;
  border-radius: 8px;
  background: #fbfdff;
  color: #344054;
  font-size: 10.5px;
  line-height: 1.45;
}

.client-plan-issue-list li::before {
  counter-increment: issue;
  content: counter(issue);
  position: absolute;
  left: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #12729c;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.client-stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.client-stage-card {
  min-height: 142px;
  padding: 11px;
  border: 1px solid #d9e8ef;
  border-top: 4px solid #1f8f5f;
  border-radius: 8px;
  background: #ffffff;
}

.client-stage-card span {
  color: #12729c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.client-stage-card strong {
  display: block;
  margin: 3px 0 8px;
  color: #182230;
  font-size: 11px;
  line-height: 1.2;
}

.client-stage-card p {
  margin: 0;
  min-height: 44px;
  color: #344054;
  font-size: 10px;
  line-height: 1.45;
}

.client-stage-card em {
  display: block;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed #cbdff0;
  color: #667085;
  font-size: 8.8px;
  font-style: normal;
  line-height: 1.35;
}

.client-path {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.client-path span {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 7px;
  border-radius: 999px;
  background: #edf7f3;
  color: #245b45;
  font-size: 9.5px;
  font-weight: 800;
}

.client-path b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1f8f5f;
  color: #fff;
  font-size: 10px;
}

.client-plan-bottom {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 14px;
}

.client-delivery-grid {
  display: grid;
  gap: 8px;
}

.client-delivery-grid span {
  min-height: 36px;
  padding: 9px 10px;
  border: 1px solid #d9e8ef;
  border-radius: 8px;
  background: #fbfdff;
  color: #344054;
  font-size: 10px;
  font-weight: 700;
}

.client-media-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.client-media-tile {
  min-height: 142px;
  padding: 8px;
  border: 1px dashed #b9c7d9;
  border-radius: 8px;
  background: #fbfdff;
}

.client-media-tile img {
  width: 100%;
  height: 82px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.client-media-tile strong {
  display: block;
  margin-top: 6px;
  color: #182230;
  font-size: 10px;
}

.client-media-tile p {
  margin: 3px 0 0;
  color: #667085;
  font-size: 8.4px;
  line-height: 1.3;
}

.client-media-video {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 82px;
  padding: 8px;
  border-radius: 6px;
  background: #eef4fd;
  color: #12729c;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.client-media-video small {
  display: block;
  max-width: 100%;
  margin-top: 4px;
  color: #667085;
  font-size: 8px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.client-plan-disclaimer {
  margin: 12px 0 0;
  color: #667085;
  font-size: 8.8px;
  line-height: 1.45;
}

.plan-card-export-wrapper {
  position: fixed;
  top: 0;
  left: -1200px;
  width: 794px;
  background: #fff;
  pointer-events: none;
  z-index: -1;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
  z-index: 50;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .record-toolbar {
    grid-template-columns: 1fr;
  }

  .record-context {
    min-height: 108px;
  }

  .toolbar-buttons {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-helper-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar,
  .top-actions,
  .toolbar-buttons {
    align-items: stretch;
    flex-direction: column;
  }

  .record-toolbar {
    grid-template-columns: 1fr;
  }

  .record-context {
    min-height: 112px;
    padding: 16px;
  }

  .record-context .current-title {
    font-size: 20px;
  }

  .toolbar-buttons {
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .toolbar-group,
  .toolbar-group-record,
  .toolbar-group-ai,
  .toolbar-group-delivery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-action {
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
  }

  .ai-panel-head,
  .ai-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace {
    padding: 10px;
  }

  .side-panel {
    display: flex;
  }

  .form-grid,
  .scale-question,
  .scale-result-card,
  .compact-grid,
  .knowledge-form,
  .upload-strip,
  .media-card-head,
  .media-card-body {
    grid-template-columns: 1fr;
  }

  .posture-picker {
    grid-template-columns: 1fr;
  }

  .posture-body-map {
    min-height: 520px;
  }

  .posture-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 360px;
  }

  .scale-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .scale-options {
    grid-template-columns: 1fr;
  }

  #imagePreview {
    width: 100%;
    height: auto;
    max-height: 220px;
  }
}
