:root {
  --bg-page: #eef4fb;
  --bg-panel: rgba(255, 255, 255, 0.82);
  --bg-panel-strong: #ffffff;
  --text-main: #183046;
  --text-sub: #5d7287;
  --brand-start: #1f7a8c;
  --brand-end: #1d4e89;
  --brand-accent: #31c3b0;
  --brand-soft: #dff7f3;
  --danger: #c2414d;
  --danger-soft: #ffe7ea;
  --line: #d7e4ef;
  --shadow-lg: 0 24px 60px rgba(20, 47, 84, 0.14);
  --shadow-md: 0 12px 30px rgba(17, 43, 74, 0.10);
  --shadow-sm: 0 8px 18px rgba(20, 47, 84, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "HarmonyOS Sans SC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(49, 195, 176, 0.20), transparent 28%),
    radial-gradient(circle at right 15%, rgba(29, 78, 137, 0.18), transparent 24%),
    linear-gradient(180deg, #f7fbff 0%, var(--bg-page) 100%);
  color: var(--text-main);
}

.iconfont {
  font-size: 1em;
  line-height: 1;
  vertical-align: middle;
}

a {
  color: inherit;
}

.app-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.app-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.45;
}

.glow-a {
  width: 320px;
  height: 320px;
  top: -100px;
  right: -40px;
  background: rgba(49, 195, 176, 0.25);
}

.glow-b {
  width: 360px;
  height: 360px;
  left: -80px;
  top: 180px;
  background: rgba(29, 78, 137, 0.16);
}

form {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 18px 20px 0;
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 24px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  box-shadow: 0 18px 44px rgba(29, 78, 137, 0.28);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.brand-mark .iconfont {
  font-size: 24px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text strong {
  font-size: 20px;
  line-height: 1.1;
}

.brand-text span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.04em;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.link .iconfont {
  font-size: 15px;
}

.link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.link.danger {
  background: rgba(194, 65, 77, 0.85);
  border-color: rgba(255, 255, 255, 0.10);
}

.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-weight: 600;
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 32px;
}

.page-header {
  position: relative;
  padding: 28px 30px;
  margin-bottom: 22px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(31, 122, 140, 0.94), rgba(29, 78, 137, 0.92)),
    #ffffff;
  color: #ffffff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.page-header::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  top: -80px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.page-title {
  position: relative;
  z-index: 1;
}

.page-title h1,
.page-title h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
}

.page-title p {
  margin: 10px 0 0;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
}

.page-title p.page-copy-full {
  max-width: none;
}

.page-meta {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13px;
}

.meta-icon {
  margin-right: 6px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card {
  display: block;
  position: relative;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.88));
  border: 1px solid rgba(215, 228, 239, 0.92);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(49, 195, 176, 0.10), transparent 48%);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 40px rgba(17, 43, 74, 0.14);
  border-color: rgba(49, 195, 176, 0.42);
}

.card-icon {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  margin-bottom: 18px;
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-end);
  background: linear-gradient(135deg, rgba(49, 195, 176, 0.22), rgba(29, 78, 137, 0.16));
}

.card-icon .iconfont {
  font-size: 26px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.card p,
.card div {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text-sub);
  line-height: 1.65;
}

.card-foot {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--brand-end);
  font-weight: 700;
}

.card-foot .iconfont {
  font-size: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 8px 10px 0;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(29, 78, 137, 0.18);
  background: rgba(29, 78, 137, 0.08);
  color: var(--brand-end);
  font-size: 12px;
  font-weight: 700;
}

.action-row {
  margin-top: 16px;
}

.panel-flow-input {
  padding-bottom: 18px;
}

.input-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.input-main {
  min-width: 0;
}

.flow-stream {
  grid-template-columns: 1fr;
  gap: 12px;
}

.alertness-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.regulation-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.discrimination-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-panel-strong);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm);
}

.flow-stream .question-card {
  border-radius: 16px;
  border-left: 4px solid rgba(29, 78, 137, 0.24);
}

.question-title {
  font-weight: 700;
  line-height: 1.6;
}

.question-sub {
  margin-top: 6px;
  color: var(--text-sub);
  font-size: 13px;
}

.score-group {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.score-options {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.score-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fcff;
}

.score-option input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.score-group-vertical {
  flex-direction: column;
  align-items: flex-start;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9fcff;
}

.score-pill input[type="radio"] {
  width: 16px;
  height: 16px;
}

.inline-fields {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.inline-fields label {
  color: var(--text-sub);
  font-size: 13px;
}

.input-select {
  max-width: 260px;
}

.input-textarea {
  width: 100%;
  min-height: 54px;
  resize: vertical;
}

.inline-checks {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}

.inline-checks-vertical {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.inline-checks-vertical label {
  line-height: 1.6;
}

.question-method {
  white-space: pre-line;
}

.result-block {
  margin-top: 10px;
}

.result-text {
  margin-top: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  line-height: 1.75;
}

.status-pill-ready {
  border-color: rgba(11, 122, 99, 0.24);
  background: rgba(11, 122, 99, 0.12);
  color: #0b7a63;
}

.status-pill-info {
  border-color: rgba(49, 195, 176, 0.26);
  background: rgba(49, 195, 176, 0.14);
  color: #0b6e73;
}

.status-pill-link {
  margin-top: 10px;
  text-decoration: none;
}

.status-pill-link:hover,
.status-pill-link:focus,
.status-pill-link:active,
.status-pill-link:visited {
  text-decoration: none;
}

.panel {
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  border: 1px solid rgba(215, 228, 239, 0.92);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.page-panel-full {
  width: 100%;
  max-width: none;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.panel-title h2 {
  margin: 0;
  font-size: 28px;
}

.panel-title p {
  margin: 8px 0 0;
  color: var(--text-sub);
}

.title-icon {
  margin-right: 8px;
  color: var(--brand-end);
}

.hero-panel {
  max-width: 520px;
  margin: 52px auto 0;
  padding: 0;
  overflow: hidden;
}

.hero-panel-header {
  padding: 28px 28px 22px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
}

.hero-panel-header h2 {
  margin: 0;
  font-size: 30px;
}

.hero-panel-header p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.82);
}

.hero-panel-body {
  padding: 28px;
  background: var(--bg-panel-strong);
}

.form-stack {
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 14px;
  align-items: center;
  margin-bottom: 14px;
}

.field-block {
  display: grid;
  gap: 8px;
}

.remember-me-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.remember-me-inline input[type="checkbox"] {
  margin: 0;
}

.remember-me-inline label {
  margin: 0;
}

.field-label,
.form-row label {
  color: var(--text-main);
  font-weight: 700;
}

.input,
.btn {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0 14px;
  font-size: 15px;
}

.input {
  width: 100%;
  background: #fbfdff;
  color: var(--text-main);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input:focus {
  outline: none;
  border-color: rgba(29, 78, 137, 0.45);
  box-shadow: 0 0 0 4px rgba(29, 78, 137, 0.10);
  background: #ffffff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: none;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(29, 78, 137, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 26px rgba(29, 78, 137, 0.22);
  text-decoration: none;
}

.btn:focus,
.btn:active,
.btn:visited,
.btn span {
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.btn-secondary {
  background: linear-gradient(135deg, #31c3b0, #2494a6);
}

.btn-block {
  width: 100%;
}

.msg,
.info-msg,
.count-msg {
  margin-bottom: 14px;
}

.alert,
.msg {
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.55;
}

.alert-danger,
.msg {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(194, 65, 77, 0.16);
}

.alert-info,
.count-msg,
.info-msg {
  background: var(--brand-soft);
  color: #0b6e73;
  border: 1px solid rgba(49, 195, 176, 0.18);
  padding: 12px 14px;
  border-radius: 14px;
}

.alert-success {
  background: #e6f9f3;
  color: #0b7a63;
  border: 1px solid rgba(11, 122, 99, 0.14);
  padding: 12px 14px;
  border-radius: 14px;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 0;
}

.stat-tile {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.stat-tile strong {
  display: block;
  font-size: 20px;
  margin-bottom: 4px;
}

.stat-tile span {
  color: rgba(255, 255, 255, 0.80);
  font-size: 13px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-bar-evals {
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 210px) minmax(170px, 210px) minmax(130px, 180px) auto;
  align-items: center;
}

.filter-bar-evals .input-select,
.filter-bar-evals .input {
  width: 100%;
  max-width: none;
}

.parent-qr-config {
  grid-template-columns: minmax(220px, 1fr) 140px auto;
  align-items: center;
}

.parent-qr-page img {
  display: block;
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(215, 228, 239, 0.92);
  background: rgba(255, 255, 255, 0.70);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 14px 16px;
  font-size: 14px;
  text-align: left;
  border-bottom: 1px solid rgba(215, 228, 239, 0.82);
}

.table th {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-sub);
  background: rgba(247, 251, 255, 0.95);
}

.table th .sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-block;
}

.table th .sort-link:hover {
  text-decoration: underline;
}

.table tbody tr:hover {
  background: rgba(49, 195, 176, 0.06);
}

/* Desktop table readability: keep key cells on one line and rely on horizontal scroll when needed. */
.table-evaluations {
  min-width: 1420px;
}

.table-evaluations th,
.table-evaluations td {
  white-space: nowrap;
  word-break: keep-all;
}

.table-evaluations td.cell-actions {
  min-width: 240px;
  white-space: nowrap;
}

.table-evaluations .action-link {
  white-space: nowrap;
}

/* Fallback for environments still using old table markup (no extra classes yet). */
.table-evaluations th,
.table-evaluations td {
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

.table-evaluations th:nth-child(1),
.table-evaluations td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 5;
  min-width: 64px;
  background: #ffffff;
}

.table-evaluations th:nth-child(2),
.table-evaluations td:nth-child(2) {
  position: sticky;
  left: 64px;
  z-index: 5;
  min-width: 108px;
  background: #ffffff;
  box-shadow: 6px 0 10px -10px rgba(20, 47, 84, 0.5);
}

.table-evaluations th:last-child,
.table-evaluations td:last-child {
  position: sticky;
  right: 0;
  z-index: 6;
  min-width: 260px;
  background: #ffffff;
  box-shadow: -6px 0 10px -10px rgba(20, 47, 84, 0.5);
}

/* Strong desktop lock rules for evaluation list */
.table-evaluations-desktop-lock {
  min-width: 1520px;
  table-layout: auto;
}

.table-evaluations-desktop-lock th,
.table-evaluations-desktop-lock td {
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

.table-evaluations-desktop-lock .col-id {
  position: sticky;
  left: 0;
  z-index: 6;
  min-width: 64px;
  background: #ffffff;
}

.table-evaluations-desktop-lock .col-name {
  position: sticky;
  left: 64px;
  z-index: 6;
  min-width: 108px;
  background: #ffffff;
  box-shadow: 6px 0 10px -10px rgba(20, 47, 84, 0.5);
}

.table-evaluations-desktop-lock .col-actions {
  position: sticky;
  right: 0;
  z-index: 7;
  min-width: 260px;
  background: #ffffff;
  box-shadow: -6px 0 10px -10px rgba(20, 47, 84, 0.5);
}

.table-evaluations-desktop-lock thead .col-id,
.table-evaluations-desktop-lock thead .col-name,
.table-evaluations-desktop-lock thead .col-actions {
  background: rgba(247, 251, 255, 0.98);
  z-index: 8;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  margin: 4px 8px 4px 0;
  padding: 0 12px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  color: var(--brand-end);
  background: rgba(29, 78, 137, 0.08);
}

.action-link .iconfont {
  font-size: 14px;
}

.action-link:hover {
  background: rgba(29, 78, 137, 0.14);
}

.pager-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.pager-summary {
  color: var(--text-sub);
  font-size: 13px;
}

.pager-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pager-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.pager-tools-compact {
  margin-top: 0;
}

.pager-size-group,
.pager-jump-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pager-jump-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.pager-jump-cluster {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.pager-tools-label {
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pager-jump-input {
  width: 88px;
  min-width: 88px;
  text-align: center;
}

.pager-jump-btn {
  min-height: 36px;
  padding: 0 14px;
}

.pager-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  color: var(--brand-end);
  background: rgba(29, 78, 137, 0.08);
}

.pager-link:hover {
  background: rgba(29, 78, 137, 0.14);
}

.pager-link.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #31c3b0, #2494a6);
}

.stream-status {
  display: none;
}

@media (max-width: 768px) {
  .pager-bar,
  .pager-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .pager-links,
  .pager-size-group,
  .pager-jump-form {
    justify-content: center;
  }

  .pager-jump-form {
    gap: 6px;
  }

  .pager-jump-actions {
    gap: 4px;
  }

  .pager-jump-cluster {
    justify-content: center;
    gap: 4px;
  }

  .pager-link {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 13px;
  }

  .pager-jump-input {
    width: 72px;
    min-width: 72px;
  }

  .pager-summary,
  .pager-tools-label {
    text-align: center;
  }
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  margin-right: 6px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(29, 78, 137, 0.1);
  color: var(--brand-end);
}

.tag-chip-ok {
  background: rgba(11, 122, 99, 0.14);
  color: #0b7a63;
}

.tag-chip-muted {
  background: rgba(93, 114, 135, 0.14);
  color: #526171;
}

.muted-note {
  color: var(--text-sub);
}

@media (max-width: 991.98px) {
  .topbar-inner {
    border-radius: 20px;
    padding: 16px;
  }

  .card-grid,
  .stats-strip {
    grid-template-columns: 1fr;
  }

  .page-title h1,
  .page-title h2 {
    font-size: 28px;
  }
}

@media (max-width: 767.98px) {
  .topbar {
    padding: 14px 14px 0;
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .page-shell {
    padding: 18px 14px 28px;
  }

  .page-header {
    padding: 24px 20px;
    border-radius: 22px;
  }

  .page-title h1,
  .page-title h2 {
    font-size: 24px;
  }

  .panel,
  .hero-panel-body,
  .hero-panel-header {
    padding: 22px 18px;
  }

  .form-row,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .parent-qr-config {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .parent-qr-config .btn {
    width: 100%;
  }

  .parent-form-page .form-grid,
  .parent-form-page .alertness-grid,
  .parent-form-page .regulation-grid,
  .parent-form-page .discrimination-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .parent-form-page .inline-actions {
    width: 100%;
  }

  .parent-form-page .inline-actions .btn {
    width: 100%;
  }

  .inline-actions {
    width: 100%;
  }

  .panel-flow-input {
    /* Reserve enough space for two-row fixed actions + device safe area */
    padding-bottom: calc(152px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
  }

  .panel-flow-input .form-grid,
  .panel-flow-input .flow-stream,
  .panel-flow-input .alertness-grid,
  .panel-flow-input .regulation-grid,
  .panel-flow-input .discrimination-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .panel-flow-input .flow-stream {
    gap: 10px;
  }

  .input-layout {
    grid-template-columns: 1fr;
  }

  .result-preview-card {
    position: static;
  }

  .panel-flow-input .alertness-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .panel-flow-input .regulation-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .panel-flow-input .discrimination-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .panel-flow-input .question-card {
    padding: 12px;
    border-radius: 14px;
  }

  .panel-flow-input .question-title {
    font-size: 15px;
    line-height: 1.6;
  }

  .panel-flow-input .score-group {
    gap: 8px;
  }

  .panel-flow-input .score-pill {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 14px;
  }

  .panel-flow-input .input-action-row {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(215, 228, 239, 0.92);
    box-shadow: 0 10px 26px rgba(20, 47, 84, 0.16);
    backdrop-filter: blur(8px);
  }

  .panel-flow-input .input-action-row .btn {
    flex: 1 1 calc(50% - 5px);
    min-height: 44px;
  }

  .table th,
  .table td {
    white-space: normal;
    word-break: break-word;
    padding: 10px 10px;
  }

  .table .col-mobile-hide {
    display: none;
  }

  .table-evaluations,
  .table-evaluations-desktop-lock {
    min-width: 0;
  }

  .table-evaluations-desktop-lock th,
  .table-evaluations-desktop-lock td {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  .table-wrap {
    overflow-x: hidden;
  }

  .table-evaluations thead {
    display: none;
  }

  .table-evaluations,
  .table-evaluations tbody,
  .table-evaluations tr,
  .table-evaluations td {
    display: block;
    width: 100%;
  }

  .table-evaluations tr {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-bottom: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px rgba(20, 47, 84, 0.08);
  }

  .table-evaluations-desktop-lock .col-id,
  .table-evaluations-desktop-lock .col-name,
  .table-evaluations-desktop-lock .col-actions {
    position: static;
    left: auto;
    right: auto;
    min-width: 0;
    box-shadow: none;
  }

  .table-evaluations th:nth-child(1),
  .table-evaluations td:nth-child(1),
  .table-evaluations th:nth-child(2),
  .table-evaluations td:nth-child(2),
  .table-evaluations th:last-child,
  .table-evaluations td:last-child {
    position: static;
    left: auto;
    right: auto;
    min-width: 0;
    box-shadow: none;
  }

  .table-evaluations td {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    font-size: 15px;
    line-height: 1.6;
    padding: 8px 0;
    border-bottom: 1px solid rgba(215, 228, 239, 0.72);
  }

  .table-evaluations td:not(.cell-actions) {
    color: #0a1a2f;
    font-weight: 600;
  }

  .table-evaluations td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .table-evaluations td::before {
    content: attr(data-label);
    color: var(--text-sub);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
  }

  .table-evaluations .cell-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }

  .table-evaluations .cell-actions::before {
    display: block;
    width: 100%;
    margin-bottom: 8px;
  }

  .table-evaluations .cell-actions .action-link {
    margin: 0;
    min-height: 34px;
    font-size: 14px;
    white-space: normal;
  }

  .table-evaluations .cell-actions .action-link .iconfont {
    font-size: 15px;
  }

  .stream-status {
    display: block;
    margin: 10px 2px 12px;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .table-child-profiles tbody tr.is-stream-hidden {
    display: none;
  }

  .table-child-profiles tbody tr.is-stream-visible {
    animation: stream-fade-in 0.24s ease both;
  }
}

@media (max-width: 430px) {
  .table-evaluations tr {
    padding: 10px;
    border-radius: 14px;
  }

  .table-evaluations td {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 8px;
    font-size: 15px;
  }

  .table-evaluations td::before {
    font-size: 15px;
  }

  .table-evaluations .cell-actions .action-link {
    min-height: 33px;
    padding: 0 10px;
    font-size: 14px;
  }

  .table-evaluations .cell-actions .action-link .iconfont {
    font-size: 14px;
  }
}

@media (max-width: 390px) {
  .table-evaluations td {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 7px;
    font-size: 15px;
  }

  .table-evaluations td::before {
    font-size: 15px;
  }

  .table-evaluations .cell-actions::before {
    margin-bottom: 6px;
  }
}

@media (max-width: 360px) {
  .table-evaluations td {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 7px 0;
    font-size: 15px;
  }

  .table-evaluations td::before {
    font-size: 15px;
  }

  .table-evaluations .cell-actions .action-link {
    min-height: 32px;
    margin: 0;
    font-size: 14px;
  }
}

@keyframes stream-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
