:root {
  color-scheme: light;
  --bg: #eef5f9;
  --panel: #ffffff;
  --panel-soft: #f7fbfd;
  --line: #d6e4ec;
  --text: #1b2a35;
  --muted: #647787;
  --accent: #009cde;
  --accent-dark: #0077ad;
  --accent-soft: #e6f7fd;
  --accent-line: #a9dff4;
  --brand-gray: #8b929a;
  --brand-gray-soft: #f1f4f6;
  --brand-green: #18815c;
  --brand-amber: #a96f13;
  --danger: #b42318;
  --danger-bg: #fff2f1;
  --success: #177245;
  --success-bg: #edf8f2;
  --shadow-sm: 0 1px 2px rgba(27, 42, 53, 0.08);
  --shadow-md: 0 8px 24px rgba(27, 42, 53, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f8fcfe 0, var(--bg) 280px);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 10px 22px;
  border-bottom: 3px solid var(--accent);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.menu-toggle {
  display: inline-flex;
  width: 34px;
  min-height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.menu-toggle span {
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent-dark);
}

.menu-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.top-menu-jump {
  width: 230px;
  min-height: 34px;
}

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

.app-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-dark);
}

.app-subtitle {
  margin-top: 2px;
  max-width: 860px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.28;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand-mark img {
  display: block;
  width: 236px;
  max-width: 28vw;
  height: auto;
}

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

.topbar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.topbar-account form {
  margin: 0;
}

.account-name {
  max-width: 260px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}

.app-shell.nav-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar {
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0, #f7fbfd 100%);
  padding: 12px 10px;
}

.nav-collapsed .sidebar {
  display: none;
}

.sidebar-section + .sidebar-section {
  margin-top: 18px;
}

.sidebar-heading {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.side-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-link {
  position: relative;
  display: block;
  min-height: 30px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.side-link::before {
  content: none;
}

.side-link:hover,
.side-link.active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.side-link.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 700;
}

.side-parent {
  cursor: pointer;
}

.side-parent::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
}

.side-parent[aria-expanded="false"]::after {
  transform: translateY(-35%) rotate(-45deg);
}

.side-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 10px;
  padding-left: 8px;
  border-left: 1px solid #e3e8ef;
}

.side-section.is-collapsed {
  display: none;
}

.side-link.disabled {
  color: #9aa3b2;
  cursor: default;
}

.side-link.disabled:hover {
  border-color: transparent;
  background: transparent;
  color: #9aa3b2;
}

.page {
  padding: 16px 20px;
  min-width: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.import-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.manual-set-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
input[type="file"],
select,
textarea {
  min-height: 34px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
  padding: 6px 8px;
}

input[type="file"] {
  padding: 5px 8px;
}

textarea {
  overflow: hidden;
  resize: none;
  line-height: 1.3;
}

.code-input {
  text-transform: uppercase;
}

button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  background: #9aa3b2;
  cursor: default;
}

button:disabled:hover {
  background: #9aa3b2;
}

.button-link {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover {
  background: var(--accent-dark);
}

.button-link.secondary-button-link {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

.button-link.secondary-button-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

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

.secondary-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.notice-title {
  margin-bottom: 6px;
  font-weight: 700;
}

.notice ul {
  margin: 0;
  padding-left: 20px;
}

.notice.success {
  border-color: #a9dfbf;
  background: var(--success-bg);
  color: var(--success);
}

.notice.error {
  border-color: #f4b3ad;
  background: var(--danger-bg);
  color: var(--danger);
}

.project-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.project-context-bar h1 {
  margin: 0;
  font-size: 18px;
}

.context-label-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.context-label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.context-meta {
  margin-bottom: 3px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.project-switch-form {
  display: grid;
  min-width: 260px;
  gap: 4px;
}

.workspace {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

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

.sets-panel,
.questions-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.sets-panel {
  padding: 12px;
}

.sets-panel h1,
.questions-header h2 {
  margin: 0;
  font-size: 17px;
}

.set-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.set-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.set-link:hover,
.set-link.active {
  border-color: var(--accent);
}

.set-title {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.set-meta,
.source,
.empty {
  color: var(--muted);
  font-size: 13px;
}

.questions-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.source {
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.question-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.count {
  min-width: 48px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-align: center;
  font-weight: 700;
}

.sort-links {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.sort-links a {
  min-height: 32px;
  padding: 7px 9px;
  color: var(--text);
  text-decoration: none;
  border-right: 1px solid var(--line);
  font-weight: 600;
}

.sort-links a:last-child {
  border-right: 0;
}

.sort-links a:hover,
.sort-links a.active {
  background: #eef6f3;
  color: var(--accent-dark);
}

.question-editor {
  padding: 10px 12px 12px;
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.question-list-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.question-form {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.create-question-form {
  margin-bottom: 10px;
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.question-form-title {
  margin-bottom: 8px;
  font-weight: 700;
}

.question-row {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.question-form-title + .question-row {
  margin-top: 0;
}

.question-row-top {
  grid-template-columns: 92px 86px 120px auto;
  justify-content: start;
  align-items: end;
}

.question-row-full {
  grid-template-columns: minmax(0, 1fr);
}

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

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

.inline-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 6px;
}

.secondary-link {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.secondary-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.editor-empty {
  padding: 18px 4px 4px;
}

.questionnaire-group-form {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.questionnaire-group-form:last-child {
  margin-bottom: 0;
}

.questionnaire-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.questionnaire-group-header h3 {
  margin: 0;
  font-size: 15px;
}

.questionnaire-group-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.questionnaire-grid {
  display: grid;
  grid-template-columns: 72px minmax(260px, 1fr) minmax(260px, 360px) 160px;
  gap: 8px;
  align-items: start;
}

.questionnaire-grid-head {
  padding: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.questionnaire-row-item {
  padding: 6px 0;
  border-top: 1px solid #edf0f4;
}

.mobile-label {
  display: none;
}

.main-empty {
  padding: 32px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.home-copy,
.login-panel,
.process-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.home-copy {
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
  border-top: 4px solid var(--accent);
}

.home-copy h1 {
  max-width: 980px;
  margin: 0;
  color: var(--accent-dark);
  font-size: 28px;
  line-height: 1.18;
}

.home-subtitle {
  max-width: 900px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.home-text {
  max-width: 980px;
  margin-top: 18px;
  color: #2d3440;
  font-size: 15px;
  line-height: 1.55;
}

.home-text p,
.process-panel p,
.login-note {
  margin: 0;
}

.home-text h2 {
  margin: 18px 0 10px;
  font-size: 18px;
}

.home-text p + p,
.process-panel p + p {
  margin-top: 10px;
}

.login-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-top: 4px solid var(--brand-gray);
}

.login-panel h2,
.process-panel h2 {
  margin: 0;
  font-size: 18px;
}

.login-panel button {
  width: 100%;
  margin-top: 2px;
}

.login-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.process-panel {
  max-width: 1180px;
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.55;
}

.process-panel h2 {
  margin-bottom: 10px;
}

.about-panel {
  max-width: 980px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.about-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  border-top: 4px solid var(--accent);
}

.about-header h1 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 20px;
}

.about-body {
  padding: 16px;
}

.about-section {
  max-width: 820px;
}

.about-section + .about-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.about-section h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.about-section p {
  margin: 0;
  line-height: 1.55;
}

.about-section p + p {
  margin-top: 8px;
}

.about-contacts dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.about-contacts dl > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
}

.about-contacts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.about-contacts dd {
  margin: 0;
  line-height: 1.45;
}

.about-contacts a {
  color: var(--accent-dark);
  font-weight: 700;
}

.about-body > .secondary-link {
  margin-top: 16px;
}

.rating-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.rating-toolbar h1 {
  margin: 0;
  font-size: 18px;
}

.site-settings-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.site-settings-toolbar h1 {
  margin: 0;
  font-size: 18px;
}

.site-backup-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.site-backup-panel h2 {
  margin: 0;
  font-size: 16px;
}

.site-backup-actions,
.site-backup-actions form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.site-backup-actions input[type="file"] {
  max-width: 260px;
}

.reports-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.reports-toolbar h1 {
  margin: 0;
  font-size: 18px;
}

.reports-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.status-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.status-toolbar h1 {
  margin: 0;
  font-size: 18px;
}

.status-note {
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}

.status-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.status-header h2 {
  margin: 0;
  font-size: 17px;
}

.status-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.status-table-wrap {
  overflow: auto;
  background: #ffffff;
}

.status-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.status-table th,
.status-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #edf0f4;
  border-right: 1px solid #edf0f4;
  text-align: left;
  vertical-align: top;
}

.status-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #e5f6fc;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-table td {
  max-width: 420px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.status-table th:nth-child(3),
.status-table td:nth-child(3) {
  width: 150px;
}

.requirement-min,
.requirement-count {
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
}

.status-table .requirement-count.is-met {
  border-color: #a9dfbf;
  background: var(--success-bg);
  color: var(--success);
}

.status-table .requirement-count.is-missing {
  border-color: #f3b8b2;
  background: var(--danger-bg);
  color: var(--danger);
}

.project-activity-panel {
  margin-top: 12px;
}

.status-subheader {
  border-top: 1px solid var(--line);
}

.project-activity-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(42px, 1fr);
  gap: 8px;
  align-items: end;
  min-height: 230px;
  padding: 12px;
  overflow-x: auto;
}

.project-activity-chart-hours {
  grid-auto-columns: minmax(48px, 1fr);
  min-height: 210px;
}

.activity-bar {
  display: grid;
  grid-template-rows: 20px 160px 20px;
  gap: 5px;
  min-width: 42px;
  color: var(--text);
  text-align: center;
  text-decoration: none;
}

.project-activity-chart-hours .activity-bar {
  grid-template-rows: 20px 140px 20px;
  min-width: 48px;
}

.activity-value,
.activity-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.activity-track {
  display: flex;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 6px 6px 3px 3px;
  background: #f8fbfd;
  overflow: hidden;
}

.activity-fill {
  width: 100%;
  min-height: 0;
  background: linear-gradient(180deg, #18b8ed 0, var(--accent-dark) 100%);
}

.activity-fill-secondary {
  background: linear-gradient(180deg, #9ca3af 0, #586474 100%);
}

.activity-bar:hover .activity-track,
.activity-bar.is-selected .activity-track {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 156, 222, 0.14);
}

.activity-bar.is-selected .activity-label {
  color: var(--accent-dark);
}

.reports-note {
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}

.reports-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.reports-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.reports-header h2 {
  margin: 0;
  font-size: 17px;
}

.reports-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.report-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  overflow: hidden;
}

.report-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700;
}

.report-meta,
.report-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.report-note {
  padding: 0 10px 8px;
}

.report-table-wrap {
  max-height: 520px;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.report-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.report-table th,
.report-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #edf0f4;
  border-right: 1px solid #edf0f4;
  text-align: left;
  vertical-align: top;
}

.report-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #e5f6fc;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.report-table td {
  max-width: 420px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.site-template-tabs {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.site-template-tabs .active-tab {
  background: var(--accent-dark);
}

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

.site-template-card {
  display: block;
  min-height: 120px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}

.site-template-card:hover {
  border-color: var(--accent);
  background: #eef6f3;
}

.site-template-card h2 {
  margin: 0;
  font-size: 17px;
}

.template-meta-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.template-table-wrap {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.rating-create-form {
  margin-bottom: 10px;
}

.rating-form-grid {
  display: grid;
  grid-template-columns: 150px 170px 180px auto;
  gap: 8px;
  align-items: end;
}

.rating-text-field {
  grid-column: 1 / -1;
}

.rating-table-wrap {
  overflow-x: auto;
}

.rating-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

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

.rating-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.rating-table th:first-child,
.rating-table td:first-child,
.rating-table th:nth-child(3),
.rating-table td:nth-child(3),
.rating-table th:nth-child(4),
.rating-table td:nth-child(4) {
  width: 150px;
}

.rating-table th:last-child,
.rating-table td:last-child {
  width: 120px;
}

.projects-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.projects-title-row,
.projects-control-row {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.projects-title-row {
  padding: 12px;
}

.projects-title-row h1 {
  margin: 0;
  font-size: 20px;
}

.projects-control-row {
  display: grid;
  grid-template-columns: auto minmax(320px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
}

.participants-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.age-groups-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.age-groups-toolbar form {
  margin: 0;
}

.project-create,
.project-search,
.projects-panel,
.participant-create,
.participant-search,
.participants-panel,
.participant-section-panel,
.age-group-create,
.age-groups-panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

.project-create,
.participant-create,
.age-group-create {
  padding: 12px;
}

.age-groups-toolbar .age-group-create {
  padding: 0;
  border: 0;
  background: transparent;
}

.age-groups-toolbar .button-summary {
  background: var(--accent);
}

.age-groups-toolbar .button-summary:hover {
  background: var(--accent-dark);
}

.button-summary {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border-radius: 4px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

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

.button-summary:hover {
  background: var(--accent-dark);
}

.participant-create-summary .summary-label-open {
  display: none;
}

.participant-create[open] .participant-create-summary .summary-label-closed {
  display: none;
}

.participant-create[open] .participant-create-summary .summary-label-open {
  display: inline;
}

.project-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  padding: 0;
  border: 0;
  background: transparent;
}

.participant-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  padding: 12px;
}

.project-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 160px 150px 150px auto;
  gap: 8px;
  align-items: end;
}

.project-create[open] {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.project-create[open] .project-create-form {
  grid-column: 1 / -1;
  grid-template-columns: minmax(170px, 1fr) 150px 130px 130px minmax(180px, 1fr);
  margin-top: 0;
}

.project-create-form .project-comment-field {
  grid-column: auto;
}

.participant-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  align-items: end;
}

.project-create-form {
  margin-top: 10px;
}

.participant-create-form {
  margin-top: 10px;
}

.age-group-form {
  display: grid;
  grid-template-columns: 100px 100px minmax(260px, 1fr) 180px auto;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
}

.project-comment-field {
  grid-column: 1 / -2;
}

.participant-extra-field {
  grid-column: span 2;
}

.projects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.participants-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.projects-header h1 {
  margin: 0;
  font-size: 18px;
}

.participants-header h1 {
  margin: 0;
  font-size: 18px;
}

.projects-table-wrap {
  overflow-x: auto;
}

.participants-table-wrap {
  overflow-x: auto;
}

.age-groups-table-wrap {
  overflow-x: auto;
}

.projects-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
}

.participants-table {
  width: 100%;
  min-width: 1240px;
  border-collapse: collapse;
}

.age-groups-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.projects-table th,
.projects-table td,
.participants-table th,
.participants-table td,
.age-groups-table th,
.age-groups-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.projects-table th:last-child,
.projects-table td:last-child,
.participants-table th:last-child,
.participants-table td:last-child,
.age-groups-table th:last-child,
.age-groups-table td:last-child {
  border-right: 0;
}

.participants-table th,
.participants-table td {
  padding-top: 4px;
  padding-bottom: 4px;
}

.projects-table th,
.participants-table th,
.age-groups-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.projects-table th a,
.participants-table th a {
  color: inherit;
  text-decoration: none;
}

.participants-table th a.sortable-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
}

.projects-table th a:hover,
.participants-table th a:hover {
  color: var(--accent-dark);
}

.participants-table th a.sortable-header.is-active {
  color: var(--accent-dark);
}

.sort-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.participants-table th a.sortable-header:hover .sort-icon,
.participants-table th a.sortable-header.is-active .sort-icon {
  border-color: #aacbc2;
  background: #eef6f3;
  color: var(--accent-dark);
}

.projects-table th:first-child,
.projects-table td:first-child {
  width: 380px;
}

.participants-table th:first-child,
.participants-table td:first-child {
  width: 180px;
}

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

.participants-table th:nth-child(3),
.participants-table td:nth-child(3),
.participants-table th:nth-child(4),
.participants-table td:nth-child(4),
.participants-table th:nth-child(5),
.participants-table td:nth-child(5),
.participants-table th:nth-child(6),
.participants-table td:nth-child(6) {
  width: 180px;
}

.participants-table th:last-child,
.participants-table td:last-child {
  width: 120px;
}

.age-groups-table th:first-child,
.age-groups-table td:first-child,
.age-groups-table th:nth-child(2),
.age-groups-table td:nth-child(2) {
  width: 90px;
}

.age-groups-table th:nth-child(4),
.age-groups-table td:nth-child(4),
.age-groups-table th:last-child,
.age-groups-table td:last-child {
  width: 180px;
}

.age-groups-table form,
.age-group-actions form {
  margin: 0;
}

.age-group-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.age-group-edit-row td {
  background: #f3f8f6;
}

.filter-row th {
  background: #fbfcfd;
}

.filter-row input,
.filter-row select {
  min-height: 30px;
}

.project-actions {
  min-width: 360px;
}

.project-users {
  min-width: 140px;
}

.participant-actions-inner,
.participant-table-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.participant-actions {
  white-space: nowrap;
}

.participant-table-tools {
  justify-content: flex-end;
}

.participant-counts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.participant-count-card {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
}

.participant-count-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.participant-count-card strong {
  font-size: 15px;
}

.participant-count-card.is-alert {
  border-color: #f3b8b2;
  background: var(--danger-bg);
  color: var(--danger);
}

.participant-count-card.is-warning {
  border-color: #e9cf7f;
  background: #fff8d7;
  color: #775a00;
}

.participant-actions-inner a {
  display: inline-flex;
  min-width: 34px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.participant-actions-inner a:hover {
  border-color: var(--accent);
  background: #eef6f3;
}

.participant-delete form {
  margin: 0;
}

.participant-code {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.participants-table tr.participant-recent-history td {
  background: #fff3d6;
}

.participants-table tr.participant-history td {
  background: #f8fbfd;
}

.participant-history-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 20px;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e8eef4;
  color: #4b5968;
  font-size: 11px;
  font-weight: 800;
}

.participant-history-badge.is-recent {
  background: #f1b85d;
  color: #3f2b00;
}

.participant-history-note {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e3bf75;
  border-radius: 6px;
  background: #fff8e8;
  color: #5d4500;
  font-size: 13px;
}

.participant-section-body {
  padding: 16px 12px;
  color: var(--muted);
}

.participant-section-notice {
  margin: 12px 12px 0;
}

.participant-section-notice a {
  margin-left: 8px;
  color: inherit;
  font-weight: 700;
}

.participant-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.participant-footer-actions,
.participant-questionnaire-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}

.participant-footer-actions {
  border-top: 1px solid var(--line);
}

.participant-questionnaire-actions-top {
  border-bottom: 1px solid var(--line);
}

.participant-questionnaire-actions-bottom {
  border-top: 1px solid var(--line);
}

.participant-questionnaire-actions button:disabled {
  background: #9aa3b2;
  cursor: default;
}

.participant-questionnaire-table-wrap {
  overflow-x: auto;
}

.participant-questionnaire-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

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

.participant-questionnaire-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.participant-questionnaire-table th:first-child,
.participant-questionnaire-table td:first-child {
  width: 56px;
}

.participant-questionnaire-table th:nth-child(2),
.participant-questionnaire-table td:nth-child(2) {
  width: 46%;
}

.participant-questionnaire-table th:nth-child(3),
.participant-questionnaire-table td:nth-child(3) {
  width: 48%;
}

.participant-questionnaire-table tr.is-exclusion td {
  background: #fde2df;
}

.participant-questionnaire-table tr.is-exclusion .questionnaire-question-text {
  color: var(--danger);
  font-weight: 700;
}

.questionnaire-number {
  color: var(--muted);
  font-weight: 700;
}

.questionnaire-question-text {
  overflow-wrap: anywhere;
}

.questionnaire-answer-choice {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.questionnaire-answer-choice input {
  margin-top: 2px;
  flex: 0 0 auto;
}

.questionnaire-answer-choice span {
  overflow-wrap: anywhere;
}

.questionnaire-answer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.questionnaire-empty-option {
  background: #fbfcfd;
}

.participant-survey-body {
  overflow-x: auto;
  padding: 12px;
}

.participant-survey-start {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px;
}

.participant-survey-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

.survey-toolbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.survey-toolbar-status {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.survey-question-count {
  font-weight: 700;
  white-space: nowrap;
}

.survey-timer-field {
  display: grid;
  grid-template-columns: auto 70px;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.survey-timer-field input {
  min-height: 30px;
  padding: 5px 7px;
  text-align: center;
  font-weight: 700;
}

.participant-survey-toolbar button,
.participant-survey-toolbar .secondary-link {
  min-height: 28px;
  padding: 0 7px;
  font-size: 12px;
}

.survey-action-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

.survey-action-group > * {
  flex: 0 0 auto;
}

.survey-split {
  --survey-left-width: 40%;
  display: grid;
  grid-template-columns: minmax(360px, var(--survey-left-width)) 8px minmax(606px, 1fr);
  min-width: 974px;
  min-height: 520px;
  align-items: stretch;
}

.survey-left-pane,
.survey-right-pane {
  min-width: 0;
  overflow: auto;
}

.survey-left-pane {
  display: grid;
  grid-template-rows: auto auto;
  gap: 6px;
  padding-right: 12px;
}

.survey-right-pane {
  padding-left: 12px;
}

.survey-splitter {
  width: 8px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #eef2f6;
  cursor: col-resize;
}

.survey-splitter:hover,
.survey-splitter:focus {
  background: #d8e7e2;
  outline: 0;
}

.survey-question-card,
.survey-detail-pane,
.survey-combined-panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

.survey-question-card {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 0;
  padding: 10px;
}

.survey-question-card.is-critical {
  border-color: #b42318;
  background: #d92d20;
  color: #ffffff;
}

.survey-pane-title {
  margin-bottom: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.survey-question-text {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: left;
  width: 100%;
}

.survey-left-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

.survey-left-details .survey-detail-pane {
  border: 0;
  border-radius: 0;
}

.survey-left-details .survey-detail-pane + .survey-detail-pane {
  border-top: 1px solid var(--line);
}

.survey-detail-pane {
  padding: 8px 10px;
}

.survey-readonly-text {
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.survey-combined-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.survey-response-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 1.1fr);
  gap: 12px;
  align-items: stretch;
}

.survey-response-main {
  display: grid;
  gap: 12px;
  align-content: start;
}

.survey-response-row {
  display: grid;
  grid-template-columns: minmax(270px, 1fr) minmax(300px, auto);
  gap: 12px;
  align-items: center;
}

.survey-radio-field,
.survey-difficulty-rating {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.survey-radio-field .field-label,
.survey-difficulty-rating .field-label {
  flex: 0 0 auto;
  margin-bottom: 0;
  white-space: nowrap;
}

.survey-radio-field .radio-row {
  flex-wrap: nowrap;
}

.survey-wide-field textarea {
  min-height: 34px;
}

.survey-understanding-comment textarea {
  min-height: 34px;
}

.survey-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.survey-progress-strip {
  display: grid;
  grid-template-columns: repeat(var(--survey-question-count, 15), minmax(22px, 1fr));
  gap: 3px;
  align-items: center;
  width: 100%;
}

.survey-progress-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #ffffff;
  color: #5d6875;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.survey-progress-step.is-current {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

.survey-progress-step.is-difficulty-1 {
  border-color: #8bc7a0;
  background: #dff3e6;
  color: #1d6b38;
}

.survey-progress-step.is-difficulty-2 {
  border-color: #a8d5bd;
  background: #eef8ef;
  color: #2c7547;
}

.survey-progress-step.is-difficulty-3 {
  border-color: #e3cf80;
  background: #fff4bf;
  color: #7a5d00;
}

.survey-progress-step.is-difficulty-4 {
  border-color: #e5a65c;
  background: #ffe1ba;
  color: #8a4c00;
}

.survey-progress-step.is-difficulty-5 {
  border-color: #d77b73;
  background: #ffd4d0;
  color: #8f1d14;
}

.survey-progress-step.is-critical {
  border-color: #9b2c24;
  background: #d92d20;
  color: #ffffff;
}

.rating-scale.is-disabled {
  opacity: 0.55;
}

.survey-navigation,
.radio-row,
.difficulty-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.survey-question-block {
  padding: 16px 0 12px;
}

.survey-question-block h2 {
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1.3;
}

.survey-question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.survey-readonly-block {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.survey-readonly-item {
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.survey-label,
.field-label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.survey-response-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.survey-fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.survey-fieldset legend {
  padding: 0 4px;
  font-weight: 700;
}

.radio-row label,
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.difficulty-row {
  align-items: flex-end;
  margin: 10px 0;
}

.difficulty-level-field {
  width: 180px;
  margin-bottom: 0;
}

.participant-rating-feedback-body {
  padding: 12px;
}

.participant-feedback-comment {
  margin-bottom: 12px;
}

.participant-rating-table-wrap {
  overflow-x: auto;
}

.participant-rating-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.participant-rating-table th,
.participant-rating-table td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.25;
}

.participant-rating-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.participant-rating-table th:first-child,
.participant-rating-table td:first-child {
  width: 56px;
}

.participant-rating-table th:nth-child(3),
.participant-rating-table td:nth-child(3),
.participant-rating-table th:nth-child(4),
.participant-rating-table td:nth-child(4) {
  width: 140px;
}

.rating-scale {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.rating-scale-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.rating-star {
  display: inline-flex;
  width: 26px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #cfd7e2;
  background: #ffffff;
  color: #9aa3b2;
  font-size: 16px;
  line-height: 1;
}

.rating-star:hover,
.rating-star.is-selected {
  border-color: #d2a63d;
  background: #fff7df;
  color: #b7791f;
}

.rating-star-ease {
  color: #ffffff;
  opacity: 0.78;
}

.rating-star-ease-1 {
  border-color: #d46b62;
  background: #d92d20;
}

.rating-star-ease-2 {
  border-color: #e59852;
  background: #f79009;
}

.rating-star-ease-3 {
  border-color: #d2a63d;
  background: #facc15;
  color: #5f4700;
}

.rating-star-ease-4 {
  border-color: #6dbb85;
  background: #32a852;
}

.rating-star-ease-5 {
  border-color: #238a52;
  background: #16803c;
}

.rating-star-ease:hover,
.rating-star-ease.is-selected {
  border-color: #1e2329;
  box-shadow: 0 0 0 2px rgba(30, 35, 41, 0.18);
  opacity: 1;
}

.rating-star:disabled {
  cursor: default;
  opacity: 0.75;
}

.rating-scale-value {
  display: inline-flex;
  min-width: 24px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.rating-scale-label {
  min-width: 92px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.action-row,
.project-row-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.action-row + .action-row,
.project-row-tools {
  margin-top: 6px;
}

.role-label {
  min-width: 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.action-row a {
  display: inline-flex;
  min-width: 34px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.action-row .icon-form {
  margin: 0;
}

.action-row button.icon-action,
.action-row a.icon-action {
  display: inline-flex;
  min-width: 30px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.action-row button.icon-action:hover,
.action-row a.icon-action:hover {
  border-color: var(--accent);
  background: #eef6f3;
}

.action-row button.danger-icon {
  color: var(--danger);
}

.action-row button.danger-icon:hover {
  border-color: #f3b8b2;
  background: var(--danger-bg);
}

.action-row a:hover {
  border-color: var(--accent);
  background: #eef6f3;
}

.action-row a[aria-disabled="true"] {
  color: #9aa3b2;
}

.project-row-tools form {
  margin: 0;
}

.project-code {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.project-comment {
  white-space: pre-wrap;
}

.completion-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.completion-link {
  text-decoration: none;
}

.completion-link:hover {
  filter: brightness(0.97);
}

.completion-filled {
  border-color: #a9dfbf;
  background: var(--success-bg);
  color: var(--success);
}

.completion-empty {
  border-color: #f3b8b2;
  background: var(--danger-bg);
  color: var(--danger);
}

.status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-change-form {
  margin: 0;
}

.status-select {
  min-height: 28px;
  max-width: 150px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

button.status-badge.status-button {
  font-size: 12px;
  line-height: 1;
}

button.status-badge.status-button:hover {
  border-color: var(--accent);
  filter: brightness(0.98);
}

.status-draft {
  background: #f4f6f8;
  color: #475467;
}

button.status-badge.status-draft:hover {
  background: #f4f6f8;
  color: #475467;
}

.status-interview,
.status-active {
  border-color: #a9dfbf;
  background: var(--success-bg);
  color: var(--success);
}

button.status-badge.status-interview:hover,
button.status-badge.status-active:hover {
  background: var(--success-bg);
  color: var(--success);
}

.status-report,
.status-completed {
  border-color: #b7c6d9;
  background: #edf3fb;
  color: #315f95;
}

button.status-badge.status-report:hover,
button.status-badge.status-completed:hover {
  background: #edf3fb;
  color: #315f95;
}

.status-archive {
  border-color: #d0d5dd;
  background: #f8fafc;
  color: #667085;
}

button.status-badge.status-archive:hover {
  background: #f8fafc;
  color: #667085;
}

.danger-button {
  min-height: 26px;
  padding: 0 8px;
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
  font-size: 12px;
}

.danger-button:hover {
  background: #8f1d14;
}

.project-edit-row td {
  background: #f3f8f6;
}

.button-create,
.button-summary {
  background: #3f6f97;
}

.button-create:hover,
.button-summary:hover {
  background: #315878;
}

.button-load {
  background: #8a6a2f;
}

.button-load:hover {
  background: #6f5425;
}

.button-duplicate {
  background: #6f5f9b;
}

.button-duplicate:hover {
  background: #57497d;
}

.button-save {
  background: var(--brand-green);
}

.button-save:hover {
  background: #126849;
}

.button-edit {
  background: var(--brand-amber);
}

.button-edit:hover {
  background: #83550e;
}

button.button-save:disabled,
button.button-edit:disabled,
button.button-save:disabled:hover,
button.button-edit:disabled:hover {
  background: #9aa3b2;
}

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

.secondary-link.button-back:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.group-button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

.questionnaire-group-header button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

.danger-button.icon-only,
.danger-icon {
  display: inline-flex;
  width: 30px;
  min-width: 30px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #9b2c24;
  background: var(--danger);
  color: #ffffff;
  line-height: 1;
}

.danger-button.icon-only:hover,
.danger-icon:hover {
  border-color: #7a1e17;
  background: #8f1d14;
  color: #ffffff;
}

body .action-row button.icon-action.danger-icon {
  border-color: #9b2c24;
  background: var(--danger);
  color: #ffffff;
}

body .action-row button.icon-action.danger-icon:hover {
  border-color: #7a1e17;
  background: #8f1d14;
  color: #ffffff;
}

.project-search .form-field {
  max-width: 34ch;
}

.project-form {
  grid-template-columns: minmax(220px, 30ch) 150px 130px 130px minmax(180px, 1fr) minmax(180px, 1fr) minmax(320px, 1fr) auto;
}

.project-form .project-comment-field,
.project-create-form .project-comment-field {
  grid-column: auto;
  min-width: 360px;
}

.project-form-actions {
  align-self: end;
  flex-wrap: nowrap;
}

.project-create[open] {
  grid-template-columns: auto minmax(0, 1fr);
}

.project-create[open] .project-create-form {
  grid-column: 1 / -1;
  grid-template-columns: minmax(220px, 30ch) 150px 130px 130px minmax(360px, 1fr) auto;
}

.projects-table th a,
.participants-table th a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.projects-table th a.active-sort,
.projects-table th a:hover {
  color: var(--accent-dark);
}

.projects-table th a.active-sort .sort-icon,
.projects-table th a:hover .sort-icon {
  border-color: #aacbc2;
  background: #eef6f3;
  color: var(--accent-dark);
}

.deadline-cell {
  width: 112px;
  white-space: nowrap;
}

.deadline-cell span {
  display: block;
}

.participants-table {
  min-width: 1080px;
}

.status-table,
.rating-table,
.age-groups-table,
.participant-rating-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.status-table th,
.status-table td {
  padding: 3px 6px;
  line-height: 1.15;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.status-table th:nth-child(2),
.status-table td:nth-child(2) {
  max-width: 360px;
  text-align: left;
  white-space: normal;
}

.status-table th:nth-child(3),
.status-table td:nth-child(3) {
  width: auto;
}

.status-table th:nth-child(4),
.status-table td:nth-child(4) {
  width: 130px;
}

.status-table td:nth-child(n+3) {
  text-align: center;
}

.status-row-number {
  width: 44px;
  color: var(--muted);
  font-weight: 700;
}

.rating-table th,
.rating-table td,
.age-groups-table th,
.age-groups-table td,
.participant-rating-table th,
.participant-rating-table td {
  width: auto;
  white-space: nowrap;
}

.rating-table th:first-child,
.rating-table td:first-child,
.rating-table th:nth-child(3),
.rating-table td:nth-child(3),
.rating-table th:nth-child(4),
.rating-table td:nth-child(4),
.rating-table th:last-child,
.rating-table td:last-child,
.age-groups-table th:first-child,
.age-groups-table td:first-child,
.age-groups-table th:nth-child(2),
.age-groups-table td:nth-child(2),
.age-groups-table th:nth-child(4),
.age-groups-table td:nth-child(4),
.age-groups-table th:last-child,
.age-groups-table td:last-child,
.participant-rating-table th:first-child,
.participant-rating-table td:first-child,
.participant-rating-table th:nth-child(3),
.participant-rating-table td:nth-child(3),
.participant-rating-table th:nth-child(4),
.participant-rating-table td:nth-child(4) {
  width: auto;
}

.rating-table td:nth-child(2),
.participant-rating-table td:nth-child(2) {
  max-width: 520px;
  white-space: normal;
}

.age-group-actions,
.table-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  white-space: nowrap;
}

.table-actions form {
  margin: 0;
}

.participant-rating-table td:nth-child(3),
.participant-rating-table .rating-range-cell {
  text-align: center;
}

.participant-rating-table .rating-answer-cell {
  text-align: left;
}

.participant-rating-table input.rating-small-number {
  width: 92px;
}

.survey-split {
  min-height: 0;
  align-items: start;
}

.survey-question-text {
  font-size: 25px;
}

.survey-label {
  font-size: 14px;
}

.survey-readonly-text {
  font-size: 17px;
}

.rating-star-ease,
.rating-star-ease-1,
.rating-star-ease-2,
.rating-star-ease-3,
.rating-star-ease-4,
.rating-star-ease-5 {
  border-color: #cfd7e2;
  background: #ffffff;
  color: #9aa3b2;
  opacity: 1;
}

.rating-star-ease-3,
.rating-star-ease-3:hover,
.rating-star-ease-3.is-selected,
.ease-scale .rating-star-ease-3.is-selected {
  border-color: #d2a63d;
  background: #fff2b8;
  color: #6f5100;
  box-shadow: none;
}

.ease-scale.ease-value-1 .rating-star-ease-1.is-selected {
  border-color: #16703d;
  background: #1f8f4d;
  color: #ffffff;
  box-shadow: none;
}

.ease-scale.ease-value-1 .rating-star-ease-2.is-selected,
.ease-scale.ease-value-2 .rating-star-ease-2.is-selected {
  border-color: #98d7a8;
  background: #eaf7ee;
  color: #1f7a3b;
  box-shadow: none;
}

.ease-scale.ease-value-4 .rating-star-ease-4.is-selected,
.ease-scale.ease-value-5 .rating-star-ease-4.is-selected {
  border-color: #ef9a93;
  background: #fde9e7;
  color: #b42318;
  box-shadow: none;
}

.ease-scale.ease-value-5 .rating-star-ease-5.is-selected {
  border-color: #b42318;
  background: #d92d20;
  color: #ffffff;
  box-shadow: none;
}

.admin-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.admin-toolbar h1,
.statistics-header h2 {
  margin: 0;
}

.period-form,
.user-create-form {
  display: grid;
  gap: 8px;
  align-items: end;
}

.period-form {
  grid-template-columns: 150px 150px auto;
}

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

.statistics-panel,
.notifications-panel,
.users-panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

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

.notification-settings-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) 110px minmax(180px, 1fr) minmax(160px, 1fr) minmax(220px, 1.2fr);
  gap: 8px;
  align-items: end;
  padding: 12px;
}

.checkbox-field {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.notification-extra-recipients {
  grid-column: 1 / -2;
}

.notification-settings-actions {
  align-self: end;
}

.notifications-table {
  min-width: 1180px;
}

.notifications-table th,
.notifications-table td {
  vertical-align: middle;
}

.notification-check-cell {
  text-align: center;
}

.statistics-header {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.bar-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(34px, 1fr);
  gap: 8px;
  align-items: end;
  min-height: 260px;
  padding: 12px;
  overflow-x: auto;
}

.bar-chart-item {
  display: grid;
  grid-template-rows: 20px 180px 18px;
  gap: 4px;
  min-width: 34px;
  text-align: center;
}

.bar-value,
.bar-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bar-track {
  display: flex;
  align-items: end;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.bar-fill {
  width: 100%;
  background: #4f7d73;
}

.bar-fill-secondary {
  background: #5b75a6;
}

.user-create-form {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) 140px 140px 150px auto;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.users-table-wrap {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
}

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

.users-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 920px) {
  .page {
    padding: 12px;
  }

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

  .topbar-main {
    width: 100%;
    flex-wrap: wrap;
  }

  .brand-mark img {
    width: 62px;
    max-width: 62px;
  }

  .brand-copy {
    flex: 1 1 260px;
  }

  .topbar-account {
    width: 100%;
    justify-content: space-between;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.nav-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-tree {
    display: flex;
  }

  .toolbar,
  .import-form,
  .manual-set-form,
  .workspace,
  .question-row,
  .question-row-top,
  .question-row-halves,
  .questionnaire-grid,
  .survey-response-grid,
  .rating-form-grid {
    grid-template-columns: 1fr;
  }

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

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

  .status-toolbar,
  .status-header {
    align-items: stretch;
    flex-direction: column;
  }

  .site-settings-toolbar,
  .site-backup-panel {
    align-items: stretch;
    flex-direction: column;
  }

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

  .project-context-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .project-switch-form {
    min-width: 0;
  }

  .projects-toolbar,
  .projects-control-row,
  .participants-toolbar,
  .site-template-list,
  .home-hero,
  .project-search,
  .participant-search,
  .project-form,
  .participant-form,
  .template-meta-form,
  .age-group-form {
    grid-template-columns: 1fr;
  }

  .project-comment-field,
  .participant-extra-field {
    grid-column: auto;
  }

  .project-create[open],
  .project-create[open] .project-create-form,
  .survey-response-layout,
  .statistics-grid,
  .period-form,
  .user-create-form,
  .notification-settings-form {
    grid-template-columns: 1fr;
  }

  .about-contacts dl > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .questionnaire-grid-head {
    display: none;
  }

  .mobile-label {
    display: block;
  }

  .questionnaire-group-header {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-set-form {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 16px;
    padding-left: 0;
  }
}

/* Navigation shell rules are kept last so generic button/link styles cannot override them. */
body .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 10px 22px;
}

body .topbar-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

body button.menu-toggle {
  display: inline-flex;
  width: 34px;
  min-height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
}

body button.menu-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent-dark);
}

.answer-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.answer-option-actions {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.option-row input[type="text"] {
  flex: 1;
}

.option-row input[type="number"] {
  width: 120px;
}

.option-row label {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.add-option, .remove-option {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.answer-option-actions > .add-option {
  width: max-content;
  align-self: flex-start;
}

.add-option:hover, .remove-option:hover {
  border-color: var(--accent);
  background: #eef6f3;
}

.remove-option.danger-button.icon-only {
  border-color: #9b2c24;
  background: var(--danger);
  color: #ffffff;
}

.remove-option.danger-button.icon-only:hover {
  border-color: #7a1e17;
  background: #8f1d14;
  color: #ffffff;
}

.offline-workbench {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.offline-topline,
.offline-status-row,
.offline-workspace-header,
.offline-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.offline-topline h1,
.offline-workspace-header h2,
.offline-section-title h3 {
  margin: 0;
}

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

.offline-status-row {
  align-items: stretch;
}

.offline-status,
.offline-package-info {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.offline-status {
  flex: 1;
  font-weight: 700;
}

.offline-status-ok,
.offline-status-progress {
  border-color: #a8d5bd;
  background: var(--success-bg);
  color: var(--success);
}

.offline-status-pending,
.offline-status-offline {
  border-color: #e8cf93;
  background: #fff8e8;
  color: var(--brand-amber);
}

.offline-status-conflict {
  border-color: #f0b2ad;
  background: var(--danger-bg);
  color: var(--danger);
}

.offline-package-info {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
}

.offline-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.offline-local-panel,
.offline-workspace,
.offline-form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.offline-local-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

.offline-local-panel .participant-create {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.offline-local-panel .participant-create-form {
  display: grid;
  grid-template-columns: 1fr;
}

.offline-list-title {
  font-weight: 800;
}

.offline-participant-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.offline-participant-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.offline-participant-item:hover,
.offline-participant-item.is-selected {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.offline-participant-code {
  font-weight: 800;
}

.offline-mini-statuses {
  display: flex;
  grid-column: 1 / -1;
  gap: 4px;
}

.offline-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
}

.offline-status-chip.is-synced {
  background: var(--success-bg);
  color: var(--success);
}

.offline-status-chip.is-pending {
  background: #fff8e8;
  color: var(--brand-amber);
}

.offline-status-chip.is-conflict,
.offline-status-chip.is-rejected {
  background: var(--danger-bg);
  color: var(--danger);
}

.offline-workspace {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.offline-empty-workspace {
  padding: 20px;
  color: var(--muted);
}

.offline-form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  box-shadow: none;
}

.offline-questionnaire-list,
.offline-rating-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.offline-question-card {
  margin: 0 0 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.offline-question-card legend,
.offline-question-card summary {
  font-weight: 800;
}

.offline-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.offline-choice-list label,
.offline-radio-field label {
  display: flex;
  gap: 6px;
  align-items: center;
}

.offline-choice-list label {
  flex: 0 1 auto;
  min-width: 140px;
  max-width: 260px;
}

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

.offline-readonly {
  padding: 8px;
  border: 1px solid #e2edf3;
  border-radius: 6px;
  background: #ffffff;
}

.offline-readonly p {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.offline-radio-field {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.offline-radio-field legend {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  font-weight: 700;
}

.offline-save-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

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

.offline-rating-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 70px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.offline-rating-row em {
  color: var(--muted);
  font-style: normal;
  text-align: center;
}

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

@media (max-width: 720px) {
  .offline-topline,
  .offline-status-row,
  .offline-workspace-header,
  .offline-section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .offline-survey-grid,
  .offline-rating-row {
    grid-template-columns: 1fr;
  }

  .offline-rating-row input {
    width: 100%;
  }
}

body .app-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}

body .app-shell.nav-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

body .sidebar {
  display: block;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #ffffff;
  padding: 10px;
}

body .nav-collapsed .sidebar {
  display: none;
}

body .side-tree,
body .side-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body .side-section {
  margin-left: 10px;
  padding-left: 8px;
  border-left: 1px solid #e3e8ef;
}

body .side-section.is-collapsed {
  display: none;
}

body .side-tree > .side-link,
body .side-section > .side-link,
body button.side-link {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
}

body .side-link:hover,
body .side-link.active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

body .side-link.disabled {
  color: #9aa3b2;
  cursor: default;
}

body .side-link.disabled.active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

body .side-link.disabled:hover {
  border-color: transparent;
  background: transparent;
  color: #9aa3b2;
}

body .side-link.disabled.active:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

body button.side-parent {
  position: relative;
  cursor: pointer;
}

body button.side-parent::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
}

body button.side-parent[aria-expanded="false"]::after {
  transform: translateY(-35%) rotate(-45deg);
}

@media (max-width: 920px) {
  body .app-shell,
  body .app-shell.nav-collapsed {
    grid-template-columns: 1fr;
  }

  body .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
