*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --canvas: #f3f5f7;
  --surface: #ffffff;
  --surface-subtle: #f8fafb;
  --ink: #1f2a33;
  --ink-soft: #53616c;
  --ink-faint: #77838d;
  --line: #dfe5e8;
  --line-strong: #c7d0d5;
  --teal: #167b72;
  --teal-dark: #0f5d57;
  --teal-soft: #e5f3f0;
  --blue: #356b8c;
  --blue-soft: #e8f0f6;
  --coral: #bd5a4c;
  --coral-soft: #f9eae7;
  --amber: #a76820;
  --amber-soft: #f9efd9;
  --green: #3f7b56;
  --green-soft: #e8f3ec;
  --shadow: 0 12px 32px rgba(24, 39, 51, .07);
  --shadow-tight: 0 5px 16px rgba(24, 39, 51, .08);
  --radius: 8px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

html {
  min-height: 100%;
  background: var(--canvas);
  color-scheme: light;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 3px solid rgba(53, 107, 140, .24);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 10px max(18px, calc((100vw - 1640px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 2px 12px rgba(24, 39, 51, .04);
  backdrop-filter: blur(12px);
}

.brand-block,
.brand-line,
.header-actions,
.button,
.icon-button,
.method-inner,
.local-status,
.cloud-head,
.sync-status,
.section-heading,
.band-heading > div,
.completion-copy,
.score-hero,
.domain-summary,
.domain-score-summary,
.impact-control,
.record-line,
.admin-user-line {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid #b9d9d4;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-family: Georgia, "Songti SC", serif;
  font-size: 21px;
  font-weight: 800;
}

.brand-mark i {
  position: absolute;
  right: -4px;
  bottom: 7px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--coral);
}

.brand-line {
  gap: 9px;
  min-width: 0;
}

.brand-line h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 22px;
  line-height: 1;
}

.product-label {
  padding-left: 9px;
  border-left: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}

.brand-block p {
  margin: 5px 0 0;
  color: var(--ink-faint);
  font-size: 11.5px;
}

.header-actions {
  justify-content: flex-end;
  gap: 8px;
}

.button,
.icon-button,
.tool-button,
.text-button,
.category-filter button,
.result-tabs button,
.rating-button,
.record-item,
.domain-summary,
.link-button {
  cursor: pointer;
}

.button {
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 720;
  transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease, transform .12s ease;
}

.button svg,
.icon-button svg,
.tool-button svg,
.search-field svg,
.cloud-icon svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.button.primary {
  background: var(--teal);
  color: #fff;
}

.button.primary:hover {
  background: var(--teal-dark);
  box-shadow: 0 6px 14px rgba(22, 123, 114, .2);
}

.button.quiet {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.quiet:hover,
.icon-button:hover {
  border-color: #aac3cc;
  background: var(--surface-subtle);
}

.button.danger {
  border-color: #e7c6c1;
  background: var(--coral-soft);
  color: #8b3d33;
}

.button:active,
.icon-button:active,
.tool-button:active {
  transform: translateY(1px);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-soft);
}

.method-strip {
  border-bottom: 1px solid #d7e0e5;
  background: #eaf0f3;
}

.method-inner {
  width: min(1640px, 100%);
  min-height: 34px;
  margin: 0 auto;
  padding: 5px 18px;
  gap: 9px;
}

.method-inner p {
  flex: 1;
  margin: 0;
  color: #495a66;
  font-size: 11.5px;
}

.method-inner strong {
  color: #2f434f;
}

.method-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--blue);
}

.text-button {
  padding: 2px 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(230px, 270px) minmax(560px, 1fr) minmax(340px, 390px);
  align-items: start;
  gap: 14px;
  width: min(1640px, 100%);
  margin: 0 auto;
  padding: 14px 18px 40px;
}

.records-column,
.insights-column {
  position: sticky;
  top: 120px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 134px);
  overflow: auto;
  scrollbar-width: thin;
}

.side-section,
.assessment-column,
.insight-section,
.clinical-note,
.admin-panel,
.metric-card,
.chart-panel,
.table-panel,
.login-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-tight);
}

.side-section {
  overflow: hidden;
}

.section-heading {
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px 12px;
}

.section-heading.compact {
  padding-bottom: 10px;
}

.section-heading h2,
.assessment-toolbar h2,
.band-heading h3,
.cloud-head h3,
.result-group h3,
.modal-head h2,
.method-content h3,
.admin-heading h2,
.chart-heading h2,
.login-panel h1 {
  margin: 0;
  letter-spacing: 0;
}

.section-heading h2,
.assessment-toolbar h2 {
  font-size: 16px;
  line-height: 1.25;
}

.eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-faint);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.count-badge,
.analysis-state,
.record-score,
.privacy-badge,
.online-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.count-badge {
  min-width: 28px;
  background: var(--blue-soft);
  color: var(--blue);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-faint);
}

.search-field:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 107, 140, .1);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
}

.local-status {
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
  color: var(--ink-faint);
  font-size: 10.5px;
}

.local-status > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.local-status b {
  color: var(--ink-soft);
}

.status-light,
.sync-status i,
.online-badge i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #69a37a;
}

.record-list {
  display: grid;
  gap: 6px;
  max-height: 360px;
  padding: 10px 10px 12px;
  overflow: auto;
}

.record-item {
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: background .15s ease, border-color .15s ease;
}

.record-item:hover {
  background: var(--surface-subtle);
}

.record-item.active {
  border-color: #b8d7d2;
  background: var(--teal-soft);
}

.record-line {
  justify-content: space-between;
  gap: 8px;
}

.record-line strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-score {
  min-width: 29px;
  min-height: 21px;
  background: var(--surface);
  color: var(--teal-dark);
}

.record-item small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  padding: 24px 12px;
  color: var(--ink-faint);
  font-size: 12px;
  text-align: center;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 0 12px 12px;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-subtle);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
}

.tool-button:hover {
  border-color: #aac3cc;
  background: var(--surface);
}

.assessment-column {
  min-width: 0;
  overflow: hidden;
}

.assessment-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.completion-block {
  width: 180px;
  flex: 0 0 auto;
}

.delete-record {
  color: var(--coral);
}

.delete-record:hover {
  border-color: #dfb4ae;
  background: var(--coral-soft);
}

.completion-copy {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--ink-faint);
  font-size: 10.5px;
}

.completion-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ecef;
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width .2s ease;
}

.form-band {
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
}

.band-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.band-heading > div {
  align-items: flex-start;
  gap: 10px;
}

.band-heading h3 {
  font-size: 15px;
}

.band-heading p {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 11.5px;
}

.step-index {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 800;
}

.required-note {
  color: var(--coral);
  font-size: 10.5px;
}

.form-grid {
  display: grid;
  gap: 11px;
}

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

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field > span,
.observation-sources legend,
.domain-note label,
.impact-control label {
  color: #44535d;
  font-size: 10.5px;
  font-weight: 750;
}

.field input,
.field select,
.field textarea,
.domain-note textarea,
.impact-control select,
.admin-field input,
.admin-filter input,
.admin-filter select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 9px;
  outline: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field textarea,
.domain-note textarea {
  min-height: 72px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.domain-note textarea:focus,
.impact-control select:focus,
.admin-field input:focus,
.admin-filter input:focus,
.admin-filter select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 107, 140, .1);
}

.safety-field textarea {
  border-color: #ddc9a6;
  background: #fffdf8;
}

.observation-sources {
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.observation-sources legend {
  margin-bottom: 7px;
}

.chip-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip-checks label {
  position: relative;
  cursor: pointer;
}

.chip-checks input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-checks span {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--ink-soft);
  font-size: 10.5px;
  transition: all .15s ease;
}

.chip-checks input:checked + span {
  border-color: #a7cec7;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 750;
}

.text-areas {
  margin-top: 13px;
}

.rating-intro {
  padding-bottom: 15px;
  background: var(--surface-subtle);
}

.rating-legend {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.rating-legend > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 51px;
  padding: 6px;
  border-right: 1px solid var(--line);
}

.rating-legend > div:last-child {
  border-right: 0;
}

.rating-legend b {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
}

.rating-legend span {
  color: var(--ink-soft);
  font-size: 9.5px;
  line-height: 1.35;
}

.rating-legend .legend-na b {
  background: #eceff1;
  color: var(--ink-faint);
}

.category-filter {
  display: flex;
  gap: 5px;
  margin-top: 12px;
  overflow-x: auto;
}

.category-filter button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
}

.category-filter button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.domain-list {
  display: grid;
}

.domain-card {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.domain-card:last-child {
  border-bottom: 0;
}

.domain-card[hidden] {
  display: none;
}

.domain-summary {
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 13px 18px;
  list-style: none;
  user-select: none;
}

.domain-summary::-webkit-details-marker {
  display: none;
}

.domain-summary:hover {
  background: var(--surface-subtle);
}

.domain-card[open] .domain-summary {
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.domain-title-block {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.domain-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
}

.domain-title-block h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
}

.domain-title-block p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-score-summary {
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.domain-average {
  display: grid;
  min-width: 42px;
  text-align: right;
}

.domain-average strong {
  font-size: 16px;
  line-height: 1;
}

.domain-average span {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.domain-state {
  min-width: 55px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf0f2;
  color: var(--ink-faint);
  font-size: 9.5px;
  font-weight: 750;
  text-align: center;
}

.domain-state.low {
  background: var(--coral-soft);
  color: #8b3d33;
}

.domain-state.mid {
  background: var(--amber-soft);
  color: #845213;
}

.domain-state.high {
  background: var(--green-soft);
  color: #326545;
}

.chevron {
  width: 16px;
  height: 16px;
  color: var(--ink-faint);
  transition: transform .18s ease;
}

.domain-card[open] .chevron {
  transform: rotate(180deg);
}

.domain-body {
  padding: 0 18px 17px;
}

.domain-controls {
  display: flex;
  justify-content: flex-end;
  padding: 11px 0;
}

.impact-control {
  gap: 7px;
}

.impact-control select {
  min-height: 31px;
  width: 142px;
  padding: 4px 7px;
  font-size: 10.5px;
}

.item-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 222px;
  align-items: center;
  min-height: 46px;
  border-bottom: 1px solid var(--line);
}

.item-row:last-child {
  border-bottom: 0;
}

.item-label {
  padding: 9px 11px;
  color: #34434d;
  font-size: 11px;
  line-height: 1.4;
}

.item-label small {
  display: block;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9.5px;
}

.rating-scale {
  display: grid;
  grid-template-columns: repeat(6, 30px);
  justify-content: end;
  gap: 4px;
  padding: 7px 10px;
  border-left: 1px solid var(--line);
  background: var(--surface-subtle);
}

.rating-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 750;
  transition: background .13s ease, border-color .13s ease, color .13s ease, transform .1s ease;
}

.rating-button:hover {
  border-color: var(--blue);
}

.rating-button.selected {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.rating-button.na.selected {
  border-color: #7b8790;
  background: #7b8790;
}

.rating-button:active {
  transform: scale(.95);
}

.domain-note {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.domain-note textarea {
  min-height: 62px;
  font-size: 11px;
}

.insight-section {
  padding: 15px;
}

.insight-section .section-heading {
  padding: 0 0 13px;
}

.analysis-state {
  background: #edf0f2;
  color: var(--ink-faint);
}

.analysis-state.ready {
  background: var(--green-soft);
  color: #326545;
}

.score-hero {
  align-items: flex-start;
  gap: 13px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.score-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--teal) var(--score-angle, 0deg), #e7ecef 0);
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: var(--surface);
}

.score-ring strong,
.score-ring span {
  position: relative;
  z-index: 1;
}

.score-ring strong {
  align-self: end;
  font-size: 23px;
  line-height: 1;
}

.score-ring span {
  align-self: start;
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 8.5px;
}

.score-copy {
  min-width: 0;
}

.score-copy h3 {
  margin: 4px 0 5px;
  font-size: 14px;
}

.score-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.55;
}

.priority-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 11px;
}

.priority-tags span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #7d4a0e;
  font-size: 9.5px;
  font-weight: 700;
}

.priority-tags span.urgent {
  background: var(--coral-soft);
  color: #873d34;
}

.cloud-section {
  background: #f7fafb;
}

.cloud-head {
  gap: 10px;
}

.cloud-head > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.cloud-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
}

.cloud-head h3 {
  font-size: 12.5px;
}

.cloud-head p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd3d8;
  cursor: pointer;
  transition: background .18s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  transition: transform .18s ease;
}

.switch input:checked + span {
  background: var(--teal);
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

.sync-status {
  gap: 6px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 9.5px;
}

.sync-status i {
  background: #9aa5ad;
}

.sync-status.enabled i {
  background: var(--green);
}

.sync-status.error i {
  background: var(--coral);
}

.manage-privacy {
  margin-top: 8px;
}

.result-section {
  padding-top: 10px;
}

.result-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border-radius: 7px;
  background: #edf0f2;
}

.result-tabs button {
  min-height: 29px;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-faint);
  font-size: 9.5px;
  font-weight: 750;
}

.result-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(24, 39, 51, .1);
}

.result-panel {
  display: none;
  padding-top: 13px;
}

.result-panel.active {
  display: block;
}

.result-group + .result-group {
  margin-top: 16px;
}

.result-group h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  font-size: 11px;
}

.result-marker {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.result-marker.strength {
  background: var(--green);
}

.result-marker.need {
  background: var(--coral);
}

.result-group ul,
.strategy-list,
.goal-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.result-group li,
.strategy-list li,
.goal-list li {
  padding: 9px 10px;
  border-left: 3px solid var(--line-strong);
  background: var(--surface-subtle);
  color: #42515b;
  font-size: 10.5px;
  line-height: 1.5;
}

#strengthList li {
  border-left-color: #81b390;
}

#needList li {
  border-left-color: #db948a;
}

.goal-list {
  counter-reset: goal;
}

.goal-list li {
  position: relative;
  padding-left: 34px;
  border-left-color: var(--teal);
  counter-increment: goal;
}

.goal-list li::before {
  content: counter(goal);
  position: absolute;
  top: 9px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 8px;
  font-weight: 800;
}

.strategy-list li {
  border-left-color: var(--blue);
}

.goal-note {
  margin-bottom: 9px;
  padding: 8px 9px;
  border: 1px solid #d8e3e9;
  border-radius: 7px;
  background: var(--blue-soft);
  color: #405f73;
  font-size: 9.5px;
}

.clinical-note {
  padding: 12px 14px;
  border-color: #e4cfab;
  background: #fffaf0;
  box-shadow: none;
}

.clinical-note strong {
  color: #754610;
  font-size: 10.5px;
}

.clinical-note p {
  margin: 4px 0 0;
  color: #785c3c;
  font-size: 9.5px;
  line-height: 1.55;
}

.modal {
  width: min(640px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(20, 35, 45, .25);
}

.modal::backdrop {
  background: rgba(21, 31, 39, .46);
  backdrop-filter: blur(3px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 17px;
}

.modal-body {
  max-height: calc(100vh - 120px);
  padding: 18px;
  overflow: auto;
}

.method-content {
  display: grid;
  gap: 17px;
}

.method-content section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.method-content section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.method-content h3 {
  font-size: 13px;
}

.method-content p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.7;
}

.reference-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.reference-links a {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.privacy-principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.privacy-principles > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-subtle);
}

.privacy-principles b,
.privacy-principles span {
  display: block;
}

.privacy-principles b {
  margin-bottom: 4px;
  font-size: 10.5px;
}

.privacy-principles span {
  color: var(--ink-faint);
  font-size: 9.5px;
  line-height: 1.5;
}

.sync-mode {
  display: grid;
  gap: 7px;
  margin: 18px 0 14px;
  padding: 0;
  border: 0;
}

.sync-mode legend {
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 800;
}

.sync-mode label {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.sync-mode label:has(input:checked) {
  border-color: #a9cec8;
  background: var(--teal-soft);
}

.sync-mode input {
  margin: 3px 0 0;
  accent-color: var(--teal);
}

.sync-mode b,
.sync-mode small {
  display: block;
}

.sync-mode b {
  font-size: 11px;
}

.sync-mode small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9.5px;
  line-height: 1.5;
}

.authority-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e3c68f;
  border-radius: 7px;
  background: var(--amber-soft);
  color: #6e4a1c;
  font-size: 10.5px;
  cursor: pointer;
}

.authority-check input {
  margin: 2px 0 0;
  accent-color: var(--teal);
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: .48;
  box-shadow: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  max-width: min(380px, calc(100vw - 36px));
  padding: 10px 13px;
  border: 1px solid #b9c8d0;
  border-radius: 7px;
  background: #26353f;
  color: #fff;
  box-shadow: 0 10px 30px rgba(20, 35, 45, .22);
  font-size: 11.5px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .17s ease, transform .17s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1320px) {
  .workspace {
    grid-template-columns: minmax(210px, 235px) minmax(520px, 1fr) minmax(320px, 350px);
  }

  .form-grid.four {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 350px;
  }

  .records-column {
    position: static;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) 270px;
    max-height: none;
    overflow: visible;
  }

  .record-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 170px;
  }

  .insights-column {
    top: 88px;
  }
}

@media (max-width: 820px) {
  .app-header {
    position: relative;
    align-items: flex-start;
    padding: 10px 14px;
  }

  .brand-block p,
  .admin-link span,
  .header-actions .button.quiet:not(.admin-link) span {
    display: none;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .method-inner {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 7px 14px;
  }

  .method-inner p {
    flex: 1 1 calc(100% - 18px);
  }

  .method-inner .text-button {
    margin-left: 16px;
  }

  .workspace {
    display: block;
    padding: 10px 10px 30px;
  }

  .records-column,
  .insights-column {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    max-height: none;
    margin-bottom: 10px;
    overflow: visible;
  }

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

  .assessment-column {
    margin-bottom: 10px;
  }

  .form-grid.four,
  .form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rating-legend {
    grid-template-columns: repeat(3, 1fr);
  }

  .rating-legend > div:nth-child(3) {
    border-right: 0;
  }

  .rating-legend > div:nth-child(-n+3) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .app-header {
    gap: 8px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .product-label {
    display: none;
  }

  .header-actions {
    gap: 5px;
  }

  .header-actions .button {
    min-height: 36px;
    padding: 0 9px;
  }

  .header-actions .button.primary span {
    display: none;
  }

  .workspace {
    padding-inline: 7px;
  }

  .records-column {
    grid-template-columns: 1fr;
  }

  .record-list,
  .form-grid.four,
  .form-grid.two,
  .privacy-principles {
    grid-template-columns: 1fr;
  }

  .assessment-toolbar {
    align-items: flex-start;
    padding: 13px;
  }

  .completion-block {
    width: 105px;
  }

  .form-band,
  .domain-body {
    padding-inline: 13px;
  }

  .band-heading {
    display: block;
  }

  .required-note {
    display: block;
    margin: 8px 0 0 37px;
  }

  .rating-legend > div {
    min-height: 48px;
  }

  .domain-summary {
    padding-inline: 13px;
  }

  .domain-title-block p,
  .domain-state {
    display: none;
  }

  .item-row {
    grid-template-columns: 1fr;
    padding-top: 3px;
  }

  .rating-scale {
    justify-content: start;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .impact-control {
    width: 100%;
    justify-content: space-between;
  }

  .impact-control select {
    width: 150px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .app-header,
  .method-strip,
  .records-column,
  .assessment-column,
  .cloud-section,
  .result-tabs,
  .toast {
    display: none !important;
  }

  .workspace {
    display: block;
    width: auto;
    padding: 0;
  }

  .insights-column {
    position: static;
    display: block;
    max-height: none;
  }

  .insight-section,
  .clinical-note {
    margin-bottom: 14px;
    box-shadow: none;
  }

  .result-panel {
    display: block;
  }
}
