:root {
  color-scheme: light;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  --bg: #f1f4f5;
  --panel: #ffffff;
  --line: #d7dfe3;
  --text: #1e2a31;
  --muted: #5f6f78;
  --accent: #176b5b;
  --accent-strong: #0d3f38;
  --warning: #9a5b0b;
  --danger: #9d2c2c;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #f7f9fa;
  border-right: 1px solid var(--line);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.brand h1,
.workspace h2,
.form-section h3 {
  margin: 0;
}

.brand h1 {
  font-size: 16px;
}

.brand p,
.topbar p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.primary-button,
.secondary-button,
.dark-button {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 14px;
  min-height: 40px;
  font-weight: 650;
}

.secondary-button.compact {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

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

.secondary-button {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.dark-button {
  background: var(--accent-strong);
  color: #fff;
}

.account-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 9px;
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.account-panel > div:first-child {
  min-width: 0;
}

.account-panel strong,
.account-panel span {
  display: block;
}

.account-panel span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.account-actions .secondary-button.compact {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.sidebar-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 7px;
}

.nav-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 34px;
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
  font-weight: 650;
  text-align: center;
}

.nav-button.active {
  border-color: var(--accent);
  background: #edf7f3;
  color: var(--accent-strong);
}

.summary-strip {
  min-height: 32px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.filter-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.filter-box label {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.filter-box label:last-child {
  grid-column: 1 / -1;
}

.filter-box input,
.filter-box select {
  width: 100%;
  min-height: 32px;
  margin-top: 3px;
  padding: 5px 8px;
}

.summary-strip div {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.summary-strip span {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 750;
}

.summary-strip label {
  color: var(--muted);
  font-size: 11px;
}

.sidebar > .primary-button {
  min-height: 34px;
  padding: 7px 10px;
}

.workload-box {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.workload-box[hidden] {
  display: none;
}

.workload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.workload-row strong {
  color: var(--text);
  font-size: 13px;
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: auto;
  min-height: 0;
  flex: 1;
  padding: 1px 2px 2px;
}

.record-list::before {
  content: "已检测记录";
  display: block;
  flex: 0 0 auto;
  padding: 2px 1px 1px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.record-item {
  flex: 0 0 auto;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0;
  overflow: hidden;
}

.record-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(23, 107, 91, 0.14);
}

.record-select {
  border: 0;
  background: transparent;
  color: var(--text);
  min-width: 0;
  padding: 8px 9px 7px;
  text-align: left;
}

.record-select-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

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

.record-status {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--warning);
  background: #fff6e7;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.record-status.is-generated {
  color: var(--accent-strong);
  background: #edf7f3;
}

.record-status.is-failed {
  color: var(--danger);
  background: #fff1f1;
}

.record-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
}

.record-delete {
  border: 1px solid #ead2d2;
  background: #fff8f8;
  color: var(--danger);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 650;
  margin-right: 7px;
  padding: 5px 7px;
}

.record-delete:hover {
  background: #f8eaea;
}

.empty-list {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 12px;
  text-align: center;
}

.workspace {
  min-width: 0;
  padding: 18px;
  overflow: auto;
}

.admin-dashboard {
  display: grid;
  gap: 16px;
}

.dashboard-header,
.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-header h2,
.admin-panel h3 {
  margin: 0;
}

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

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-panel {
  padding: 16px;
}

.admin-store-table {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
}

.admin-management-row,
.admin-info-row,
.admin-detail-row {
  display: grid;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
}

.admin-management-row {
  grid-template-columns: minmax(160px, 1.4fr) 64px minmax(90px, 0.8fr) minmax(110px, 0.9fr) minmax(110px, 0.9fr) minmax(140px, 1.1fr) 84px;
}

.admin-info-row {
  grid-template-columns: minmax(180px, 1.5fr) 80px minmax(120px, 1fr) minmax(170px, 1.35fr) 76px 96px;
}

.admin-detail-row {
  min-height: 44px;
}

.account-detail-row {
  grid-template-columns: minmax(140px, 1.4fr) 90px 70px minmax(120px, 1fr);
}

.record-detail-row {
  grid-template-columns: minmax(110px, 1fr) 136px minmax(92px, 0.9fr) minmax(112px, 0.9fr) minmax(112px, 0.9fr) 68px;
}

.admin-management-row:last-child,
.admin-info-row:last-child,
.admin-detail-row:last-child {
  border-bottom: 0;
}

.admin-store-head {
  background: #f3f6f8;
  color: var(--muted);
  font-weight: 700;
}

.admin-management-row strong,
.admin-management-row span,
.admin-info-row strong,
.admin-info-row span,
.admin-detail-row strong,
.admin-detail-row span {
  min-width: 0;
}

.admin-management-row strong,
.admin-info-row strong,
.admin-detail-row strong {
  display: block;
}

.admin-management-row div span,
.admin-info-row div span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.admin-management-row > span,
.admin-info-row > span,
.admin-detail-row > span,
.admin-detail-row > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-store-detail {
  margin-top: 16px;
}

.store-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: #f8fafb;
  padding: 14px 16px;
}

.store-detail-header h3,
.store-detail-grid h4 {
  margin: 0;
}

.store-detail-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.store-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 16px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #fff;
  padding: 16px;
}

.store-detail-grid.record-only {
  grid-template-columns: minmax(0, 1fr);
}

.store-detail-grid section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.store-detail-grid h4 {
  background: #f3f6f8;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.status-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.on {
  background: #e8f5ee;
  color: #13734d;
}

.status-pill.off {
  background: #f5eeee;
  color: var(--danger);
}

.test-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 0;
  margin-left: 6px;
  border: 1px solid #e6c783;
  border-radius: 999px;
  background: #fff8e7;
  color: #8a5700;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 750;
  vertical-align: middle;
}

.test-store-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  border: 1px solid #e6c783;
  border-radius: 8px;
  background: #fff8e7;
  padding: 12px 14px;
}

.test-store-notice strong,
.test-store-notice span {
  display: block;
}

.test-store-notice strong {
  color: #754900;
}

.test-store-notice span {
  margin-top: 3px;
  color: #765f36;
  font-size: 12px;
}

.read-only-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  border: 1px solid #b8d8cc;
  border-radius: 8px;
  background: #f0f8f4;
  padding: 12px 14px;
}

.read-only-notice strong,
.read-only-notice span {
  display: block;
}

.read-only-notice span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.record-workspace.admin-readonly form {
  opacity: 0.86;
}

.store-account-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.store-account-summary strong,
.store-account-summary span {
  display: block;
}

.store-account-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.modal-backdrop.scoped-account-modal {
  z-index: 40;
}

.warn-text {
  color: #b45309;
  font-weight: 800;
}

.danger-text {
  color: var(--danger);
  font-weight: 800;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
}

.topbar h2 {
  font-size: 20px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-actions .primary-button,
.topbar-actions .secondary-button,
.topbar-actions .dark-button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.score-band {
  display: grid;
  grid-template-columns: 120px 140px 110px minmax(240px, 1fr);
  gap: 0;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.score-band div {
  background: transparent;
  border-right: 1px solid var(--line);
  padding: 9px 13px;
  min-height: 58px;
}

.score-band div:last-child {
  border-right: 0;
}

.score-band label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.score-band strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.2;
}

.score-band div:last-child strong {
  font-size: 16px;
}

.section-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 12px rgba(30, 42, 49, 0.05);
}

.section-nav a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 6px 11px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.section-nav a:hover,
.section-nav a:focus-visible {
  background: #edf5f2;
  color: var(--accent-strong);
  outline: none;
}

.form-grid {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.form-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  scroll-margin-top: 58px;
  min-width: 0;
  max-width: 100%;
}

.form-section h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.compact-section {
  padding: 15px 16px;
}

.compact-section h3 {
  margin-bottom: 10px;
}

.compact-basic-grid {
  gap: 8px 10px;
}

.compact-basic-grid label {
  font-size: 12px;
}

.compact-basic-grid input,
.compact-basic-grid select {
  min-height: 36px;
  padding: 7px 9px;
}

.basic-info-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  align-items: end;
  padding: 10px 0;
  border-top: 1px solid #edf0f2;
}

.basic-info-row:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.basic-info-row:last-child {
  padding-bottom: 0;
}

.basic-info-label {
  align-self: center;
}

.basic-info-label strong,
.basic-info-label span {
  display: block;
}

.basic-info-label strong {
  color: var(--text);
  font-size: 14px;
}

.basic-info-label span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.field-grid {
  display: grid;
  gap: 10px;
}

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

.field-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

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

.movement-groups {
  border-top: 1px solid var(--line);
}

.movement-group {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.movement-title strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
}

.movement-title span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.movement-inputs.compact {
  grid-template-columns: minmax(220px, 360px);
}

.questionnaire-block {
  border-top: 1px solid var(--line);
  padding: 13px 0;
}

.questionnaire-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

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

.questionnaire-title strong {
  color: var(--text);
  font-size: 15px;
}

.questionnaire-title span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.question-group-title {
  margin-top: 13px;
}

.question-group-title + .checkbox-grid {
  margin-top: 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.checkbox-grid label {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 6px 8px;
  line-height: 1.35;
}

.checkbox-grid input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
}

.checkbox-grid input:disabled {
  opacity: 0.45;
}

.posture-block {
  border-top: 1px solid var(--line);
  margin-top: 13px;
  padding-top: 13px;
}

.posture-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

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

input,
select,
textarea {
  width: 100%;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  background: #fff;
  color: var(--text);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  min-height: 38px;
}

textarea {
  resize: vertical;
}

input[readonly] {
  background: #f4f7f6;
  color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(23, 107, 91, 0.2);
  border-color: var(--accent);
}

.field-missing {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(157, 44, 44, 0.14);
}

.fms-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.fms-head,
.fms-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) 90px 90px 100px 100px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.fms-head {
  background: #f3f6f8;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.fms-row input {
  margin: 0;
}

.fms-cards {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.fms-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  min-width: 0;
  max-width: 100%;
}

.fms-card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: #f3f6f8;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.fms-card-title strong {
  color: var(--text);
  font-size: 15px;
}

.fms-card-title span {
  color: var(--muted);
  font-size: 12px;
}

.fms-observations {
  margin: 0 12px 12px;
  padding: 10px;
  border: 1px solid #d9e7e2;
  border-radius: 7px;
  background: #f7fbfa;
  min-width: 0;
  max-width: 100%;
}

.fms-observations summary {
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.fms-observations summary::after {
  content: "按观察面和项目选择实际表现";
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.fms-observation-options {
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
}

.fms-view-group + .fms-view-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #d9e7e2;
}

.fms-view-group h5 {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 13px;
}

.fms-observation-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fms-observation-item {
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid #d7e1e5;
  border-radius: 7px;
  background: #fff;
}

.fms-observation-item legend {
  padding: 0 5px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.fms-choice-list {
  display: grid;
  gap: 6px;
}

.fms-choice {
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f7f9fa;
}

.fms-choice.is-selected {
  border-color: #91bdb1;
  background: #f0f8f5;
}

.fms-choice-problem.is-selected {
  border-color: #e5bd83;
  background: #fff8ed;
}

.fms-choice-pain.is-selected {
  border-color: #df9999;
  background: #fff2f2;
}

.fms-choice-main {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
}

.fms-choice-main input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  flex: 0 0 auto;
}

.fms-type-badge {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 4px;
  background: #e4f1ed;
  color: #296e5e;
  font-size: 10px;
  font-weight: 700;
}

.fms-choice-problem .fms-type-badge {
  background: #fff0d8;
  color: #95611d;
}

.fms-choice-pain .fms-type-badge {
  background: #ffe0e0;
  color: #a53f3f;
}

.fms-choice-detail {
  display: none;
  gap: 7px;
  padding: 0 8px 8px 31px;
}

.fms-choice.is-selected .fms-choice-detail {
  display: grid;
}

.fms-choice-detail p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.fms-choice-note {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.fms-choice-note input {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
}

.draft-status {
  color: #327666 !important;
  font-size: 12px !important;
}

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

.check,
.check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.check.standalone {
  align-self: end;
  min-height: 38px;
}

.check input,
.check-row input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 14px;
}

.guidance-preview,
.tag-preview {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.guidance-preview span,
.tag-preview span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.guidance-preview p,
.tag-preview p {
  margin: 0;
  white-space: pre-line;
  line-height: 1.6;
}

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

.auto-guidance-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fa;
  padding: 12px;
}

.auto-guidance-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.auto-guidance-grid p {
  margin: 0;
  min-height: 56px;
  white-space: pre-line;
  line-height: 1.6;
}

.coach-note {
  margin-top: 12px;
}

.bottom-actions {
  margin-top: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  position: sticky;
  bottom: 10px;
  z-index: 25;
  box-shadow: 0 8px 24px rgba(30, 42, 49, 0.12);
}

.bottom-actions strong,
.bottom-actions span {
  display: block;
}

.bottom-actions span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 26px;
  box-shadow: 0 12px 28px rgba(30, 42, 49, 0.08);
}

.login-brand {
  margin-bottom: 22px;
}

.login-form {
  display: grid;
  gap: 14px;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(30, 42, 49, 0.36);
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-panel {
  width: min(820px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 18px;
}

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

.modal-header h3,
.modal-header p {
  margin: 0;
}

.modal-header p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.icon-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.account-create-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

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

.check-inline {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-inline input {
  width: auto;
}

.store-list {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.store-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.store-row strong,
.store-row span {
  display: block;
}

.store-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.account-table {
  display: grid;
  gap: 8px;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) 76px 110px 68px 92px auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.account-row strong,
.account-row span {
  display: block;
}

.account-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

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

.danger-button {
  border: 1px solid #ead2d2;
  border-radius: 7px;
  background: #fff8f8;
  color: var(--danger);
  min-height: 34px;
  padding: 7px 10px;
  font-weight: 650;
}

.compact-modal {
  max-width: 780px;
}

.store-detail-form {
  display: grid;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.modal-form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.modal-form-section h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

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

.modal-field-grid.compact-two {
  grid-template-columns: minmax(150px, 220px) minmax(220px, 1fr);
  align-items: end;
}

.module-config summary {
  cursor: pointer;
  font-weight: 700;
}

.module-config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.module-config-grid label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 34px;
  color: var(--text);
  white-space: nowrap;
}

.module-config-grid input {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-start;
}

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

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

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

  .admin-store-table {
    overflow-x: auto;
  }

  .admin-management-row,
  .admin-info-row {
    min-width: 1280px;
  }

  .store-detail-grid {
    grid-template-columns: 1fr;
  }

  .read-only-notice,
  .test-store-notice,
  .store-account-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .movement-group {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .basic-info-row {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
  }

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

  .account-create-form,
  .store-create-form,
  .account-row,
  .store-row,
  .module-config-grid,
  .modal-field-grid,
  .modal-field-grid.compact-two {
    grid-template-columns: 1fr;
  }

  .account-row-actions {
    justify-content: flex-start;
  }

  .fms-observation-items {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fms-observations summary::after {
    display: block;
    margin: 3px 0 0;
  }

  .fms-result-grid {
    grid-template-columns: 1fr;
  }

  .fms-result-note {
    grid-column: auto;
  }

  .bottom-actions {
    align-items: stretch;
    flex-direction: column;
    position: static;
  }

  .field-grid.four,
  .field-grid.five,
  .field-grid.three,
  .field-grid.two,
  .checkbox-grid,
  .movement-inputs,
  .movement-inputs.compact,
  .posture-grid,
  .auto-guidance-grid,
  .fms-head,
  .fms-row {
    grid-template-columns: 1fr;
  }

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

  .score-band div:nth-child(3) {
    border-right: 0;
  }

  .score-band div:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .section-nav {
    top: 0;
  }
}
