:root {
  color-scheme: light;
  --bg: #edf7fb;
  --surface: #ffffff;
  --surface-2: #f4fbfd;
  --surface-3: #e5f6fb;
  --text: #17324c;
  --muted: #5d748a;
  --line: #c9e0ea;
  --primary: #087fc0;
  --primary-strong: #035f94;
  --accent: #f1c64f;
  --error: #c2414b;
  --shadow: 0 14px 40px rgba(8, 80, 132, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #dff2f8 0%, var(--bg) 280px),
    var(--bg);
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
  letter-spacing: 0;
}

body.cover-mode {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.success-mode {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

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

.survey-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 0;
}

#surveyPanel {
  padding: 20px 14px 48px;
}

.cover-panel {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  row-gap: 18px;
  padding: clamp(186px, 27.4vh, 238px) 26px calc(34px + env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(2, 39, 75, 0.02) 0%, rgba(2, 39, 75, 0.05) 50%, rgba(2, 24, 47, 0.42) 100%),
    url("cover-bg.png") center / cover no-repeat;
  color: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.cover-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 7px;
  width: min(100%, 620px);
  max-width: 620px;
  justify-self: center;
  padding: 36px 18px 18px;
  text-align: left;
  color: #183a53;
  background: rgba(244, 250, 252, 0.78);
  border: 1px solid rgba(188, 232, 242, 0.68);
  border-radius: 8px;
  box-shadow:
    0 18px 30px rgba(0, 39, 83, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
  text-shadow: none;
  backdrop-filter: blur(2px);
}

.cover-action {
  position: relative;
  z-index: 1;
  grid-row: 3;
  align-self: end;
  margin-bottom: 0;
}

.survey-hero,
.admin-header {
  background:
    linear-gradient(145deg, rgba(5, 94, 154, 0.96) 0%, rgba(10, 146, 184, 0.93) 74%, rgba(244, 204, 81, 0.58) 100%);
  color: #fff;
  padding: 28px 22px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 16px 36px rgba(7, 80, 132, 0.16);
}

.cover-title {
  position: absolute;
  top: clamp(12px, 2.2vh, 22px);
  right: 22px;
  left: 22px;
  z-index: 1;
  margin: 0 auto;
  max-width: 700px;
  color: #fff;
  text-align: center;
  text-shadow:
    0 3px 11px rgba(1, 25, 54, 0.56),
    0 0 1px rgba(0, 42, 79, 0.86);
  font-size: clamp(24px, 6.85vw, 38px);
  line-height: 1.03;
  font-weight: 900;
  letter-spacing: 0;
}

.cover-panel .eyebrow {
  position: absolute;
  top: -1px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(180deg, #1fbee3 0%, #0882c1 68%, #066aa6 100%);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 7px 16px rgba(3, 91, 151, 0.32);
  font-size: 15px;
  font-weight: 800;
}

.cover-panel .description {
  color: #31576c;
  font-size: clamp(13px, 3.6vw, 15px);
  line-height: 1.55;
}

.description p {
  margin: 0;
}

.description p + p {
  margin-top: 0.28em;
}

.survey-hero h1,
.admin-header h1 {
  margin: 6px 0 12px;
  font-size: clamp(26px, 8vw, 40px);
  line-height: 1.16;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  font-weight: 700;
  color: var(--primary);
}

.survey-hero .eyebrow,
.admin-header .eyebrow {
  color: rgba(255, 255, 255, 0.86);
}

.description {
  margin: 0;
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-line;
}

.survey-hero .description {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 1px rgba(0, 34, 64, 0.12);
}

.cover-notes {
  display: grid;
  gap: 10px;
  margin: 4px 0 2px;
}

.cover-notes div {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cover-notes strong {
  color: var(--primary);
  font-size: 15px;
}

.cover-notes span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.survey-form {
  margin-top: 16px;
}

.section {
  margin-top: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 33, 50, 0.05);
}

.section h2,
.admin-section h2 {
  margin: 0 0 14px;
  font-size: 19px;
  line-height: 1.35;
}

.question {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.question + .question {
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.question legend {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  font-weight: 700;
  line-height: 1.55;
}

.required {
  color: var(--accent);
}

.hint,
.muted,
.stat-meta {
  display: block;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.option-list {
  display: grid;
  gap: 10px;
}

.option {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 9px;
  min-height: 44px;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.option:has(input:checked) {
  background: var(--surface-3);
  border-color: #80c9df;
}

.option input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.option:hover {
  border-color: #93d3e5;
}

select,
textarea,
input[type="date"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

.field-error,
.submit-message,
.error-text {
  color: var(--error);
  font-size: 14px;
}

.invalid select,
.invalid textarea,
.invalid .option {
  border-color: var(--error);
}

.submit-bar {
  position: sticky;
  bottom: 0;
  margin-top: 18px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 72%, rgba(237, 247, 251, 0));
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  background: linear-gradient(180deg, #24b8e2 0%, #087fc0 62%, #0567a5 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(8, 127, 192, 0.22);
}

.primary-button:hover {
  background: linear-gradient(180deg, #1aa9d5 0%, #056fae 64%, var(--primary-strong) 100%);
}

.cover-panel .primary-button {
  min-height: 54px;
  border-color: rgba(255, 239, 141, 0.6);
  box-shadow:
    0 18px 32px rgba(0, 31, 66, 0.42),
    inset 0 1px 0 rgba(255, 248, 180, 0.52);
  font-size: 19px;
}

.cover-panel .submit-message {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fff2a8;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 28, 56, 0.42);
}

.primary-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.ghost-button {
  background: #fff;
  color: var(--primary);
  border-color: #a9d6e6;
}

.hidden {
  display: none !important;
}

.success-panel {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  margin: 0;
  padding: 34px 24px;
  text-align: center;
  background: var(--surface);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.success-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #24b8e2 0%, #087fc0 100%);
  color: #fff;
  font-size: 34px;
  font-weight: 700;
}

.support-footer {
  height: auto;
  margin: 0;
  padding: 0 0 calc(5px + env(safe-area-inset-bottom));
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  line-height: 1.2;
  background: transparent;
}

body.cover-mode .support-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  width: min(100%, 760px);
  margin: 0 auto;
  text-shadow: 0 1px 5px rgba(0, 20, 45, 0.58);
  pointer-events: auto;
}

body.success-mode .support-footer {
  display: none;
}

.support-link {
  color: inherit;
  text-decoration: none;
  user-select: text;
}

.support-url {
  display: none;
  color: rgba(255, 255, 255, 0.54);
  user-select: text;
}

.support-link:hover {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: underline;
}

.admin-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.mobile-question-heading {
  display: none;
}

.admin-login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 14px;
}

.admin-login-card {
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
  padding: 26px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-login-card h1 {
  margin: -4px 0 4px;
  font-size: 28px;
  line-height: 1.2;
}

.admin-login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.admin-login-card input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pc-question-heading,
.pc-question-meta {
  display: block;
}

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

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

.mobile-admin-actions {
  display: none;
}

.admin-header h1 {
  font-size: clamp(24px, 4vw, 36px);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 1.5fr) repeat(2, minmax(150px, 1fr)) auto auto auto;
  gap: 10px;
  align-items: end;
  margin: 16px 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar .primary-button {
  width: auto;
}

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

.metric,
.admin-section,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 33, 50, 0.05);
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.admin-section {
  margin-top: 14px;
  padding: 18px;
}

.question-stats {
  display: grid;
  gap: 12px;
}

.stat-card {
  padding: 14px;
  box-shadow: none;
}

.stat-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.45;
}

.chart-switches {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.chart-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.chart-switch:hover,
.chart-switch.is-active {
  position: relative;
  z-index: 1;
  color: var(--primary);
  border-color: #9bb8de;
  background: #eef4ff;
}

.chart-switch.is-active .chart-icon {
  color: var(--primary);
}

.chart-switch + .chart-switch {
  margin-left: -1px;
}

.chart-switch:first-child {
  border-radius: 4px 0 0 4px;
}

.chart-switch:last-child {
  border-radius: 0 4px 4px 0;
}

.chart-icon {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #a9adb3;
}

.chart-icon-pie {
  border-radius: 50%;
  background: conic-gradient(currentColor 0 75%, transparent 75% 100%);
}

.chart-icon-pie::after {
  content: "";
  position: absolute;
  inset: 0 0 50% 50%;
  background: #fff;
  border-left: 1px solid #fff;
  border-bottom: 1px solid #fff;
}

.chart-icon-ring {
  border-radius: 50%;
  background: conic-gradient(currentColor 0 18%, transparent 18% 30%, currentColor 30% 62%, transparent 62% 74%, currentColor 74% 100%);
}

.chart-icon-ring::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff;
}

.chart-icon-bar::before,
.chart-icon-bar::after,
.chart-icon-hbar::before,
.chart-icon-hbar::after,
.chart-icon-line::before,
.chart-icon-line::after {
  content: "";
  position: absolute;
}

.chart-icon-bar {
  border-bottom: 2px solid currentColor;
}

.chart-icon-bar::before {
  left: 2px;
  bottom: 2px;
  width: 4px;
  height: 8px;
  background: currentColor;
  box-shadow: 6px -4px 0 currentColor, 12px -9px 0 currentColor;
}

.chart-icon-hbar::before {
  left: 1px;
  top: 4px;
  width: 16px;
  height: 3px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}

.chart-icon-line::before {
  left: 1px;
  top: 10px;
  width: 18px;
  height: 4px;
  background: currentColor;
  transform: rotate(-29deg);
  transform-origin: left center;
}

.chart-icon-line::after {
  left: 8px;
  top: 8px;
  width: 14px;
  height: 4px;
  background: currentColor;
  transform: rotate(36deg);
  transform-origin: left center;
}

.chart-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.chart-figure {
  display: grid;
  grid-template-columns: minmax(220px, 0.82fr) minmax(220px, 1fr);
  gap: 14px;
  align-items: center;
}

.chart-figure-wide {
  grid-template-columns: minmax(300px, 1.35fr) minmax(220px, 0.9fr);
}

.chart-svg {
  display: block;
  width: 100%;
  max-height: 320px;
}

.chart-pie-svg,
.chart-ring-svg {
  max-width: 280px;
  margin: 0 auto;
}

.chart-axis,
.chart-grid-line {
  fill: none;
  stroke: #d8e1ee;
  stroke-width: 1;
}

.chart-grid-line {
  stroke-dasharray: 4 5;
}

.chart-axis-label,
.chart-center-label,
.chart-value {
  fill: #64748b;
  font-size: 12px;
}

.chart-value {
  fill: #253044;
  font-weight: 700;
}

.chart-center-value {
  fill: #253044;
  font-size: 28px;
  font-weight: 800;
}

.chart-center-label {
  font-size: 13px;
}

.chart-legend {
  display: grid;
  gap: 7px;
  align-content: center;
}

.chart-legend-item {
  display: grid;
  grid-template-columns: 22px 12px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-height: 28px;
  color: var(--text);
  font-size: 13px;
}

.chart-legend-index {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.chart-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.chart-legend-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-legend-item strong {
  color: var(--text);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

.compact table {
  min-width: 420px;
}

th,
td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-2);
  font-weight: 700;
}

.sort-mark {
  display: none;
  width: 9px;
  height: 16px;
  margin-left: 3px;
  vertical-align: -3px;
  position: relative;
}

.sort-mark::before,
.sort-mark::after {
  content: "";
  position: absolute;
  left: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.sort-mark::before {
  top: 0;
  border-bottom: 6px solid #73777d;
}

.sort-mark::after {
  bottom: 0;
  border-top: 6px solid #73777d;
}

body.mobile-admin-mode.admin-page {
  background: #fff;
  color: #1f2329;
}

.mobile-admin-mode .desktop-admin {
  display: none !important;
}















.mobile-admin-mode .admin-shell {
  width: 100%;
  padding: 0 0 40px;
}

.mobile-admin-mode .mobile-admin-actions {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  background: rgba(237, 247, 251, 0.96);
  border-bottom: 1px solid var(--line);
}

.mobile-admin-mode .mobile-admin-actions .ghost-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.mobile-admin-mode .question-stats-section {
  margin: 0;
  padding: 24px 15px 34px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}

.mobile-admin-mode .question-stats-section > h2 {
  display: none;
}

.mobile-admin-mode .question-stats {
  display: block;
}

.mobile-admin-mode .text-stat-card {
  display: none;
}

.mobile-admin-mode .stat-card[data-question-id="basic_city_organization"] {
  display: none;
}

.mobile-admin-mode .stat-card[data-question-id="basic_city_organization"] + .stat-card {
  margin-top: 0;
}

.mobile-admin-mode .stat-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}

.mobile-admin-mode .stat-card + .stat-card {
  margin-top: 36px;
}

.mobile-admin-mode .pc-question-heading,
.mobile-admin-mode .pc-question-meta {
  display: none;
}

.mobile-admin-mode .mobile-question-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 12px;
  margin: 0 0 22px;
  color: #202328;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.35;
}

.mobile-admin-mode .mobile-question-heading .question-title-text {
  font-weight: 500;
}

.mobile-admin-mode .question-type {
  color: #96989c;
  font-weight: 500;
}

.mobile-admin-mode .table-wrap,
.mobile-admin-mode .table-wrap.compact {
  overflow-x: visible;
}

.mobile-admin-mode table,
.mobile-admin-mode .compact table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border: 1px solid #dedede;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.mobile-admin-mode th,
.mobile-admin-mode td {
  height: 42px;
  padding: 9px 10px;
  border: 0;
  border-right: 1px solid #dedede;
  border-bottom: 1px solid #dedede;
  color: #22262b;
  font-size: 18px;
  line-height: 1.28;
  vertical-align: middle;
}

.mobile-admin-mode th:last-child,
.mobile-admin-mode td:last-child {
  border-right: 0;
}

.mobile-admin-mode tbody tr:last-child td {
  border-bottom: 0;
}

.mobile-admin-mode th {
  height: 44px;
  background: #f4f4f4;
  font-size: 18px;
  font-weight: 700;
}

.mobile-admin-mode th:first-child,
.mobile-admin-mode td:first-child {
  width: 52%;
  text-align: left;
}

.mobile-admin-mode th:nth-child(2),
.mobile-admin-mode td:nth-child(2) {
  width: 23%;
  text-align: center;
}

.mobile-admin-mode th:nth-child(3),
.mobile-admin-mode td:nth-child(3) {
  width: 25%;
  text-align: center;
}

.mobile-admin-mode .sort-mark {
  display: inline-block;
}

.mobile-admin-mode .effective-row td {
  background: #f7f7f7;
  font-weight: 700;
}

.mobile-admin-mode .effective-row td:first-child {
  white-space: nowrap;
  font-size: 17px;
}

.mobile-admin-mode .chart-switches {
  display: flex;
  justify-content: flex-end;
  margin: 14px 0 0 auto;
  max-width: calc(100% - 72px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.mobile-admin-mode .chart-switches::-webkit-scrollbar {
  display: none;
}

.mobile-admin-mode .chart-switch {
  flex: 0 0 auto;
  height: 39px;
  padding: 0 8px;
  gap: 3px;
  border-color: #e5e5e5;
  color: #2a2d31;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  background: #fff;
}

.mobile-admin-mode .chart-switch:hover,
.mobile-admin-mode .chart-switch.is-active {
  color: #1769a8;
  border-color: #c9dced;
  background: #f4f9ff;
}

.mobile-admin-mode .chart-icon {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
  color: #b6b8bc;
}

.mobile-admin-mode .chart-panel {
  margin-top: 14px;
  padding: 12px 0 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.mobile-admin-mode .chart-figure,
.mobile-admin-mode .chart-figure-wide {
  grid-template-columns: 1fr;
  gap: 10px;
}

.mobile-admin-mode .chart-svg {
  max-height: 260px;
}

.mobile-admin-mode .chart-pie-svg,
.mobile-admin-mode .chart-ring-svg {
  max-width: 240px;
}

.mobile-admin-mode .chart-legend {
  gap: 6px;
}

.mobile-admin-mode .chart-legend-item {
  grid-template-columns: 22px 12px minmax(0, 1fr) auto;
  font-size: 14px;
}

.mobile-admin-mode .chart-legend-label {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

@media (max-width: 820px) {
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .toolbar .primary-button,
  .toolbar .ghost-button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .cover-panel {
    height: 100vh;
    height: 100dvh;
    padding: clamp(180px, 26.6vh, 226px) 24px calc(34px + env(safe-area-inset-bottom));
  }

  .survey-hero,
  .section,
  .admin-section {
    padding-inline: 14px;
  }
}

@media (max-width: 720px) {
  body.admin-page:not(.pc-admin-mode) {
    background: #fff;
    color: #1f2329;
  }

  body.admin-page:not(.pc-admin-mode) .admin-shell {
    width: 100%;
    padding: 0 0 40px;
  }

  body.admin-page:not(.pc-admin-mode) .desktop-admin {
    display: none !important;
  }

  body.admin-page:not(.pc-admin-mode) .mobile-admin-actions {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    overflow-x: auto;
    background: rgba(237, 247, 251, 0.96);
    border-bottom: 1px solid var(--line);
  }

  body.admin-page:not(.pc-admin-mode) .mobile-admin-actions .ghost-button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    white-space: nowrap;
  }

  .mobile-admin-mode .question-stats-section,
  body.admin-page:not(.pc-admin-mode) .question-stats-section {
    margin: 0;
    padding: 24px 15px 34px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }

  .mobile-admin-mode .question-stats-section > h2,
  body.admin-page:not(.pc-admin-mode) .question-stats-section > h2 {
    display: none;
  }

  .mobile-admin-mode .question-stats,
  body.admin-page:not(.pc-admin-mode) .question-stats {
    display: block;
  }

  .mobile-admin-mode .stat-card,
  body.admin-page:not(.pc-admin-mode) .stat-card {
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }

  .mobile-admin-mode .stat-card + .stat-card,
  body.admin-page:not(.pc-admin-mode) .stat-card + .stat-card {
    margin-top: 36px;
  }

  .mobile-admin-mode .pc-question-heading,
  .mobile-admin-mode .pc-question-meta,
  body.admin-page:not(.pc-admin-mode) .pc-question-heading,
  body.admin-page:not(.pc-admin-mode) .pc-question-meta {
    display: none;
  }

  .mobile-admin-mode .mobile-question-heading,
  body.admin-page:not(.pc-admin-mode) .mobile-question-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 12px;
    margin: 0 0 22px;
    color: #202328;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.35;
  }

  .mobile-admin-mode .mobile-question-heading .question-title-text,
  body.admin-page:not(.pc-admin-mode) .mobile-question-heading .question-title-text {
    font-weight: 500;
  }

  .mobile-admin-mode .question-type,
  body.admin-page:not(.pc-admin-mode) .question-type {
    color: #96989c;
    font-weight: 500;
  }

  .mobile-admin-mode .table-wrap,
  .mobile-admin-mode .table-wrap.compact,
  body.admin-page:not(.pc-admin-mode) .table-wrap,
  body.admin-page:not(.pc-admin-mode) .table-wrap.compact {
    overflow-x: visible;
  }

  .mobile-admin-mode table,
  .mobile-admin-mode .compact table,
  body.admin-page:not(.pc-admin-mode) table,
  body.admin-page:not(.pc-admin-mode) .compact table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border: 1px solid #dedede;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
  }

  .mobile-admin-mode th,
  .mobile-admin-mode td,
  body.admin-page:not(.pc-admin-mode) th,
  body.admin-page:not(.pc-admin-mode) td {
    height: 42px;
    padding: 9px 10px;
    border: 0;
    border-right: 1px solid #dedede;
    border-bottom: 1px solid #dedede;
    color: #22262b;
    font-size: 18px;
    line-height: 1.28;
    vertical-align: middle;
  }

  .mobile-admin-mode th:last-child,
  .mobile-admin-mode td:last-child,
  body.admin-page:not(.pc-admin-mode) th:last-child,
  body.admin-page:not(.pc-admin-mode) td:last-child {
    border-right: 0;
  }

  .mobile-admin-mode tbody tr:last-child td,
  body.admin-page:not(.pc-admin-mode) tbody tr:last-child td {
    border-bottom: 0;
  }

  .mobile-admin-mode th,
  body.admin-page:not(.pc-admin-mode) th {
    height: 44px;
    background: #f4f4f4;
    font-size: 18px;
    font-weight: 700;
  }

  .mobile-admin-mode th:first-child,
  .mobile-admin-mode td:first-child,
  body.admin-page:not(.pc-admin-mode) th:first-child,
  body.admin-page:not(.pc-admin-mode) td:first-child {
    width: 52%;
    text-align: left;
  }

  .mobile-admin-mode th:nth-child(2),
  .mobile-admin-mode td:nth-child(2),
  body.admin-page:not(.pc-admin-mode) th:nth-child(2),
  body.admin-page:not(.pc-admin-mode) td:nth-child(2) {
    width: 23%;
    text-align: center;
  }

  .mobile-admin-mode th:nth-child(3),
  .mobile-admin-mode td:nth-child(3),
  body.admin-page:not(.pc-admin-mode) th:nth-child(3),
  body.admin-page:not(.pc-admin-mode) td:nth-child(3) {
    width: 25%;
    text-align: center;
  }

  .mobile-admin-mode .sort-mark,
  body.admin-page:not(.pc-admin-mode) .sort-mark {
    display: inline-block;
  }

  .mobile-admin-mode .effective-row td,
  body.admin-page:not(.pc-admin-mode) .effective-row td {
    background: #f7f7f7;
    font-weight: 700;
  }

  .mobile-admin-mode .effective-row td:first-child,
  body.admin-page:not(.pc-admin-mode) .effective-row td:first-child {
    white-space: nowrap;
    font-size: 17px;
  }

  .mobile-admin-mode .chart-switches,
  body.admin-page:not(.pc-admin-mode) .chart-switches {
    display: flex;
    justify-content: flex-end;
    margin: 14px 0 0 auto;
    max-width: calc(100% - 72px);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .mobile-admin-mode .chart-switches::-webkit-scrollbar,
  body.admin-page:not(.pc-admin-mode) .chart-switches::-webkit-scrollbar {
    display: none;
  }

  .mobile-admin-mode .chart-switch,
  body.admin-page:not(.pc-admin-mode) .chart-switch {
    flex: 0 0 auto;
    min-width: 0;
    height: 39px;
    padding: 0 8px;
    gap: 3px;
    border-color: #e5e5e5;
    color: #2a2d31;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    background: #fff;
  }

  .mobile-admin-mode .chart-switch:hover,
  .mobile-admin-mode .chart-switch.is-active,
  body.admin-page:not(.pc-admin-mode) .chart-switch:hover,
  body.admin-page:not(.pc-admin-mode) .chart-switch.is-active {
    color: #1769a8;
    border-color: #c9dced;
    background: #f4f9ff;
  }

  .mobile-admin-mode .chart-icon,
  body.admin-page:not(.pc-admin-mode) .chart-icon {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
    color: #b6b8bc;
  }

  .mobile-admin-mode .chart-panel,
  body.admin-page:not(.pc-admin-mode) .chart-panel {
    margin-top: 14px;
    padding: 12px 0 0;
    border: 0;
    border-radius: 0;
    background: #fff;
  }

  .mobile-admin-mode .chart-figure,
  .mobile-admin-mode .chart-figure-wide,
  body.admin-page:not(.pc-admin-mode) .chart-figure,
  body.admin-page:not(.pc-admin-mode) .chart-figure-wide {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .mobile-admin-mode .chart-svg,
  body.admin-page:not(.pc-admin-mode) .chart-svg {
    max-height: 260px;
  }

  .mobile-admin-mode .chart-pie-svg,
  .mobile-admin-mode .chart-ring-svg,
  body.admin-page:not(.pc-admin-mode) .chart-pie-svg,
  body.admin-page:not(.pc-admin-mode) .chart-ring-svg {
    max-width: 240px;
  }

  .mobile-admin-mode .chart-legend,
  body.admin-page:not(.pc-admin-mode) .chart-legend {
    gap: 6px;
  }

  .mobile-admin-mode .chart-legend-item,
  body.admin-page:not(.pc-admin-mode) .chart-legend-item {
    grid-template-columns: 22px 12px minmax(0, 1fr) auto;
    font-size: 14px;
  }

  .mobile-admin-mode .chart-legend-label,
  body.admin-page:not(.pc-admin-mode) .chart-legend-label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

@media (min-width: 721px) {
  body.admin-page.mobile-admin-mode .desktop-admin {
    display: block !important;
  }

  body.admin-page.mobile-admin-mode .mobile-admin-actions {
    display: none !important;
  }

  body.admin-page.mobile-admin-mode .admin-shell {
    width: min(1180px, calc(100% - 28px));
    padding: 24px 0 48px;
  }

  body.admin-page.mobile-admin-mode .question-stats-section {
    margin: 14px 0 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(17, 33, 50, 0.05);
    background: var(--surface);
  }

  body.admin-page.mobile-admin-mode .question-stats-section > h2 {
    display: block;
  }

  body.admin-page.mobile-admin-mode .question-stats {
    display: grid;
    gap: 12px;
  }

  body.admin-page.mobile-admin-mode .text-stat-card,
  body.admin-page.mobile-admin-mode .stat-card[data-question-id="basic_city_organization"] {
    display: block;
  }

  body.admin-page.mobile-admin-mode .stat-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    background: var(--surface);
  }

  body.admin-page.mobile-admin-mode .stat-card + .stat-card {
    margin-top: 0;
  }

  body.admin-page.mobile-admin-mode .pc-question-heading,
  body.admin-page.mobile-admin-mode .pc-question-meta {
    display: block;
  }

  body.admin-page.mobile-admin-mode .mobile-question-heading {
    display: none;
  }

  body.admin-page.mobile-admin-mode .table-wrap,
  body.admin-page.mobile-admin-mode .table-wrap.compact {
    overflow-x: auto;
  }

  body.admin-page.mobile-admin-mode table,
  body.admin-page.mobile-admin-mode .compact table {
    min-width: 560px;
    table-layout: auto;
    border-collapse: collapse;
  }
}
