@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap");

:root {
  /* Balkan Metrics–aligned tokens (https://balkanmetrics.com/) */
  --navy: #1b3a5f;
  --navy-dark: #0f2440;
  --navy-deeper: #0a1929;
  --accent: #4db6ac;
  --accent-hover: #80cbc4;
  --accent-glow: rgba(77, 182, 172, 0.15);
  --text: #e0e6ed;
  --text-muted: #8a99ab;
  --card: #162d4a;
  --card-border: rgba(255, 255, 255, 0.08);
  --success: #2ecc71;
  --danger: #e74c3c;

  --bg-app: var(--navy-deeper);
  --bg-card: var(--card);
  --bg-surface: rgba(255, 255, 255, 0.04);
  --bg-input: rgba(255, 255, 255, 0.04);
  --text-primary: var(--text);
  --text-secondary: var(--text-muted);
  --text-heading: #ffffff;
  --border-soft: var(--card-border);
  --focus-ring: rgba(77, 182, 172, 0.55);
  --shadow-card: 0 18px 45px rgba(0, 0, 0, 0.18);

  --brand-500: var(--accent);
  --brand-600: #3d9d94;
  --brand-700: #ffffff;

  --accent-teal: var(--success);
  --accent-violet: #6b7ea8;
  --danger-500: var(--danger);
  --link-color: var(--accent);
}

body {
  font-family: "Montserrat", Arial, sans-serif;
  background: linear-gradient(160deg, var(--navy-deeper) 0%, var(--navy-dark) 42%, #0d2138 100%);
  background-attachment: fixed;
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

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

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

a.btn:hover {
  color: #fff;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}
.container-narrow {
  max-width: 500px;
}
.container-thanks {
  max-width: 700px;
}
.form-actions {
  margin-top: 14px;
}
.intro-back-actions {
  display: none;
  margin-bottom: 18px;
}
@media (min-width: 769px) {
  .intro-back-actions {
    display: block;
  }
}
.intro-back-actions .btn {
  justify-content: center;
}
.admin-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-nav-bar > form {
  margin: 0;
}
.admin-nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.intro-container {
  max-width: 980px;
}
/* Табло: еднакви вертикални отстояния между заглавие, мрежата с KPI и таблицата */
.admin-dashboard h1 {
  margin: 0 0 16px;
}
.admin-dashboard .row {
  gap: 16px;
  margin-bottom: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.admin-dashboard .row > .card {
  margin-bottom: 0;
}
.card {
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border-soft);
}
h1, h2, h3 {
  margin-top: 0;
  color: var(--text-heading);
}
h1 {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  line-height: 1.2;
}
label {
  display: block;
  font-weight: 600;
  margin: 8px 0 4px;
}
input, textarea, select, button {
  font: inherit;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-sizing: border-box;
  background: var(--bg-input);
  color: var(--text-primary);
}
input[type="range"] {
  accent-color: var(--brand-500);
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--brand-500);
  background: rgba(255, 255, 255, 0.06);
}
button, .btn {
  background: var(--brand-500);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.material-symbols-rounded {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
  line-height: 1;
  vertical-align: middle;
}
.icon-inline {
  font-size: 18px;
}
.icon-svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.btn:hover,
button:hover {
  background: var(--brand-600);
}
.btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}
.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.btn.secondary.nav-link-active {
  background: var(--accent-glow);
  border: 1px solid rgba(77, 182, 172, 0.35);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(77, 182, 172, 0.18);
}
.btn.danger {
  background: var(--danger-500);
}
.btn.btn-danger-outline {
  background: transparent;
  color: var(--danger-500);
  border: 1px solid var(--danger-500);
}
.btn.btn-danger-outline:hover {
  background: rgba(231, 76, 60, 0.12);
  color: #ffb4b0;
}
.btn.btn-edit {
  background: var(--brand-500);
}
.btn.btn-results {
  background: var(--accent-teal);
}
.btn.btn-archive {
  background: var(--accent-violet);
}
.btn.btn-results:hover {
  background: #26a85f;
  color: #fff;
}
.btn.btn-archive:hover {
  background: #5a6b90;
  color: #fff;
}
.btn.btn-more {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 10px 12px;
}
.btn.btn-more:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  position: relative;
}

/* Списък анкети: трите действия на един ред; padding 10px само тук */
.action-buttons.survey-table-actions {
  flex-wrap: nowrap;
}
.action-buttons.survey-table-actions > .btn.btn-edit,
.action-buttons.survey-table-actions > .btn.btn-results,
.action-buttons.survey-table-actions > .more-menu > summary.btn.btn-more {
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}
.action-buttons.survey-table-actions .icon-inline,
.action-buttons.survey-table-actions .icon-svg {
  display: block;
  margin: 0;
  flex-shrink: 0;
}
.action-buttons.survey-table-actions .material-symbols-rounded.icon-inline {
  width: 20px;
  height: 20px;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.more-menu {
  position: relative;
}
.more-menu summary {
  list-style: none;
}
.more-menu summary::-webkit-details-marker {
  display: none;
}
.more-menu-list {
  position: absolute;
  right: 0;
  left: auto;
  top: calc(100% + 6px);
  min-width: 190px;
  max-width: min(240px, calc(100vw - 24px));
  background: linear-gradient(180deg, rgba(22, 45, 74, 0.98), rgba(15, 30, 55, 0.98));
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  padding: 6px;
  z-index: 20;
  box-sizing: border-box;
}
.more-menu-list--floating {
  position: fixed;
  z-index: 1100;
  right: auto;
}
.more-menu-item {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.more-menu-item:hover {
  background: rgba(77, 182, 172, 0.12);
  color: #fff;
}
.more-menu-item-danger {
  color: var(--danger-500);
}
.more-menu-form {
  margin: 0;
}
.export-actions {
  display: flex;
  gap: 8px;
  margin-top: 0;
}
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.results-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 14px;
  padding-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
}
.results-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 10px;
  font-weight: 600;
  border-radius: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
.results-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.results-tab.is-active {
  color: #fff;
  background: var(--accent-glow);
  box-shadow: inset 0 0 0 1px rgba(77, 182, 172, 0.25);
}
.tab-panel {
  display: none;
}
.tab-panel.is-active {
  display: block;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.stat-card {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px;
  background: var(--bg-surface);
}
.stat-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--text-secondary);
}
.stat-card p {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}
.question-filter {
  max-width: 520px;
  margin-bottom: 10px;
}

/* Custom select (замества нативния dropdown на Windows) */
.custom-select {
  position: relative;
  width: 100%;
}
.custom-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.custom-select__trigger {
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 10px 36px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
  font: inherit;
}
.custom-select__trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  margin-top: -2px;
  border: 5px solid transparent;
  border-top-color: var(--text-primary);
}
.custom-select__trigger:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.2);
}
.custom-select.is-open .custom-select__trigger,
.custom-select__trigger:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--brand-500);
  background: rgba(255, 255, 255, 0.06);
}
.custom-select__trigger:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.custom-select__list {
  position: absolute;
  z-index: 200;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 280px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #ffffff;
  color: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
.custom-select__list[hidden] {
  display: none;
}
.custom-select__option {
  padding: 8px 12px;
  color: #1a1a1a;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.45;
}
.custom-select__option:hover,
.custom-select__option:focus {
  background: var(--brand-500);
  color: #ffffff;
}

/* Потвърдителен диалог */
.app-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 12, 24, 0.72);
  backdrop-filter: blur(2px);
}
.app-dialog-overlay[hidden] {
  display: none;
}
body.app-dialog-open {
  overflow: hidden;
}
.app-dialog {
  width: 100%;
  max-width: 460px;
  margin: 0;
}
.app-dialog__title {
  margin-bottom: 10px;
}
.app-dialog__message {
  margin: 0;
  line-height: 1.5;
}
.app-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.answers-list {
  display: grid;
  gap: 10px;
}
.answer-card {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px;
  background: var(--bg-surface);
}
.answer-card p {
  margin: 8px 0;
}
.answer-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
.person-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.person-nav-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}
.person-meta p {
  margin: 6px 0;
}
.record-id-hidden {
  display: none;
}
.btn.btn-outline {
  background: transparent;
  color: var(--brand-500);
  border: 1px solid rgba(77, 182, 172, 0.45);
}
.btn.btn-outline:hover {
  background: var(--accent-glow);
  color: #fff;
  border-color: rgba(77, 182, 172, 0.55);
}
.btn.btn-no-outline {
  background: transparent;
  color: var(--brand-600);
}
.gray-text{
  color:var(--text-secondary);
}
.align-center {
  text-align: center;
}
.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.page-header-row > div {
  min-width: 0;
}
.page-toggle-btn {
  margin-left: auto;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
  transform: translateY(1px);
}
.page-toggle-btn:hover {
  background: transparent;
  color: var(--accent-hover);
}

.editor-section-header .editor-section-heading {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--text-heading);
}
.editor-section-body {
  margin-top: 6px;
}
.editor-section-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.editor-section-header-actions .page-toggle-btn {
  margin-left: 0;
}
.btn.btn-sm {
  padding: 6px 12px;
  font-size: 0.875rem;
}
.intro-page-editor label {
  margin-top: 14px;
}
.intro-page-editor label:first-child {
  margin-top: 0;
}
.intro-preview-menu {
  position: relative;
}
.intro-preview-menu > summary {
  list-style: none;
}
.intro-preview-menu > summary::-webkit-details-marker {
  display: none;
}
.intro-preview-list {
  right: 0;
  left: auto;
  min-width: 220px;
}
.rich-text-field {
  margin-top: 14px;
}
.rich-text-shell {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-input);
}
.rich-text-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.15);
}
.rich-text-toolbar-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  line-height: 1;
}
.rich-text-toolbar-btn:hover,
.rich-text-toolbar-btn:focus-visible {
  color: var(--text-heading);
  border-color: rgba(77, 182, 172, 0.35);
  background: rgba(77, 182, 172, 0.1);
}
.rich-text-toolbar-btn .material-symbols-rounded {
  font-size: 20px;
}
.rich-text-surface {
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  padding: 14px 16px;
  color: var(--text-primary);
  line-height: 1.55;
  outline: none;
}
.rich-text-surface:focus {
  box-shadow: inset 0 0 0 1px rgba(77, 182, 172, 0.35);
}
.rich-text-surface p,
.rich-content p {
  margin: 0 0 12px;
}
.rich-text-surface ul,
.rich-text-surface ol,
.rich-content ul,
.rich-content ol {
  margin: 0 0 12px;
  padding-left: 1.4rem;
}
.rich-text-surface img,
.rich-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px 0;
  border-radius: 10px;
}
.rich-content a {
  color: var(--brand-500);
}
.intro-images-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 0 auto 22px;
  max-width: 860px;
}
.intro-image-item {
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.intro-image-item img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
}

/* Select „Тип“: същата стрелка и отстояние като .page-toggle-btn (28×28 зона, 16px знак) */
#surveyForm select.editor-type-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 38px;
  background-color: var(--bg-input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%238A99AB' d='M2.5 5.5 8 11.5 13.5 5.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 16px 16px;
}
#surveyForm select.editor-type-select::-ms-expand {
  display: none;
}
#surveyForm select.editor-type-select:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--brand-500);
  background-color: rgba(255, 255, 255, 0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%234db6ac' d='M2.5 5.5 8 11.5 13.5 5.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 16px 16px;
}

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px 4px;
}
.table-scroll table {
  min-width: 100%;
}
.table-scroll--wide table {
  min-width: 640px;
}
.table-scroll--surveys table {
  min-width: 720px;
}
th, td {
  border-bottom: 1px solid var(--border-soft);
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}
thead th,
th {
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.error {
  color: var(--danger-500);
  font-size: 14px;
}
.success {
  color: var(--success);
}
.export-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}
.export-notice--success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.export-notice--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.export-notice--info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.muted {
  color: var(--text-secondary);
}
.break-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Публична анкета */
.public-survey-layout {
  max-width: 900px;
}

.survey-title-header {
  margin-bottom: 16px;
  scroll-margin-top: 12px;
}
.survey-main-title {
  margin: 0;
  font-size: clamp(1.45rem, 3.8vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #fff;
}

/* Визуален stepper: градиентна лента + текст за стъпката */
.survey-stepper {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 0 0 rgba(77, 182, 172, 0.28);
  scroll-margin-top: 12px;
}

.survey-stepper-track-wrap {
  margin-bottom: 14px;
  outline: none;
}
.survey-stepper-track-wrap:focus-visible {
  box-shadow: 0 0 0 2px var(--navy-deeper), 0 0 0 4px var(--focus-ring);
  border-radius: 999px;
}

.survey-stepper-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.survey-stepper-fill {
  height: 100%;
  width: 0%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #3d5a8c 0%, #4a7eb0 100%);
  box-shadow:
    0 0 18px rgba(61, 90, 140, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: width 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}

@media (prefers-reduced-motion: reduce) {
  .survey-stepper-fill {
    transition: none;
  }
}

.survey-stepper-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.survey-step-indicator {
  margin: 0;
  font-size: 0.88rem;
}

.survey-current-page-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  scroll-margin-top: 12px;
}

.survey-current-page-title {
  margin: 0 0 8px;
  font-size: 1.28rem;
  line-height: 1.25;
  color: var(--text-heading);
}

.survey-current-page-desc {
  margin: 0;
  line-height: 1.55;
}

.survey-public-form {
  margin: 0;
  padding-top: 2px;
}

.survey-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 20px;
}
.survey-form-actions #backBtn,
.survey-form-actions > .btn.secondary:first-child {
  margin-right: auto;
}
.survey-form-actions .btn {
  width: auto;
  flex: 0 0 auto;
}
.intro-details-actions {
  margin-top: 20px;
}

.field-line-likert {
  display: flex;
  flex-direction: column;
}
.likert-scale-hint {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 4px 0 14px;
}

.likert-value-row {
  position: relative;
  height: 2.75rem;
  margin-bottom: 10px;
}

.likert-live-value {
  position: absolute;
  left: var(--likert-pct, 50%);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  padding: 4px 14px;
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text-heading);
  background: rgba(77, 182, 172, 0.15);
  border: 1px solid rgba(77, 182, 172, 0.35);
  border-radius: 8px;
}

.survey-questions .step.active .field-line:first-of-type {
  scroll-margin-top: 16px;
}
.field-line {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
  background: var(--bg-surface);
}
.intro-card {
  padding: 56px;
}
.intro-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.intro-icon {
  font-size: 56px;
  color: var(--brand-500);
}
.intro-icon-svg {
  display: block;
  flex-shrink: 0;
}
.intro-page-header {
  text-align: center;
  padding: 4px 0 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 0 0 rgba(77, 182, 172, 0.28);
}
.intro-page-header .intro-title {
  margin-bottom: 12px;
}
.intro-page-header .intro-subtitle {
  margin: 0 auto 0;
  max-width: 760px;
}
.intro-title {
  text-align: center;
  font-size: clamp(1.75rem, 6vw, 2.875rem);
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 55%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text-heading);
}
.intro-subtitle {
  font-size: 16px;
  line-height: 1.45;
  margin: 0 auto 18px;
  max-width: 760px;
}
.learn-more-link {
  display: inline-block;
  margin: 4px 0 20px;
  color: var(--brand-500);
  font-weight: 700;
  text-decoration: underline;
}
.intro-start-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 18px 22px;
  text-decoration: none;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.intro-start-btn:hover {
  color: var(--text-primary);
  border-color: rgba(77, 182, 172, 0.35);
  box-shadow: 0 8px 28px rgba(77, 182, 172, 0.12);
  transform: translateY(-1px);
}
.intro-start-btn strong {
  display: block;
  font-size: clamp(1.1rem, 3.5vw, 1.375rem);
  color: #fff;
  margin-bottom: 4px;
}
.intro-start-btn .material-symbols-rounded {
  font-size: 36px;
  color: var(--brand-500);
}
.home-hero {
  margin-bottom: 20px;
}
.home-surveys-section {
  margin-top: 4px;
}
.home-surveys-heading {
  margin: 0 0 14px;
  font-size: 1.15rem;
  color: var(--text-heading);
}
.home-survey-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-survey-list li {
  margin: 0;
}
.home-survey-card {
  margin: 0;
}
.home-empty {
  text-align: center;
}
.home-survey-card__arrow {
  font-size: 28px;
}
.details-content {
  white-space: pre-line;
}
.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}
.editor-actions-danger-row {
  margin-top: 8px;
}
.structure-detail-root {
  margin-top: 1rem;
}

.component-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.component-tabs .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.component-tab-active {
  font-weight: 600;
}

.survey-pillar-label {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.component-results-block {
  margin-top: 1rem;
}

.component-results-block h4 {
  margin: 0 0 0.5rem;
}

.editor-hint {
  margin-bottom: 1rem;
}

.field-line-radio label {
  display: block;
  margin: 0.35rem 0;
  font-weight: normal;
}

.field-line-radio label input {
  margin-right: 0.5rem;
}

.survey-current-page-desc.profile-note {
  font-style: italic;
}

.pages-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  justify-content: flex-end;
}
.form-actions-right {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.form-actions-right .btn,
.form-actions-right button[type="submit"] {
  justify-content: center;
}
.page-card {
  cursor: default;
}
.page-card-active {
  border-color: rgba(77, 182, 172, 0.45);
  box-shadow: var(--shadow-card), 0 0 0 2px rgba(77, 182, 172, 0.2);
}
.step {
  display: none;
}
.step.active {
  display: block;
}
.scale {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}
.scale label {
  text-align: center;
  font-weight: 400;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}
.likert-slider-wrap {
  --likert-thumb-half: 9px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 6.5rem;
  margin-top: 0;
  padding-left: var(--likert-thumb-half);
  padding-right: var(--likert-thumb-half);
  box-sizing: border-box;
}
.likert-slider-rail {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 3rem;
}

.likert-thumb-marker {
  position: absolute;
  left: var(--likert-pct, 50%);
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-500);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(77, 182, 172, 0.28);
  pointer-events: none;
  z-index: 1;
}

.field-line-likert .likert-slider-wrap input[type="range"] {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 2.75rem;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.field-line-likert .likert-slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--brand-500) 0%,
    var(--brand-500) var(--likert-pct, 50%),
    rgba(255, 255, 255, 0.14) var(--likert-pct, 50%),
    rgba(255, 255, 255, 0.14) 100%
  );
}

.field-line-likert .likert-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border-radius: 50%;
  background: transparent;
  border: none;
  box-shadow: none;
}

.field-line-likert .likert-slider-wrap input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--brand-500) 0%,
    var(--brand-500) var(--likert-pct, 50%),
    rgba(255, 255, 255, 0.14) var(--likert-pct, 50%),
    rgba(255, 255, 255, 0.14) 100%
  );
}

.field-line-likert .likert-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}
.likert-slider-footer {
  position: relative;
  margin-top: 10px;
  flex-shrink: 0;
  min-height: 1.45rem;
}
.likert-footer-min,
.likert-footer-max {
  position: absolute;
  top: 0;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
.likert-footer-min {
  left: 0;
}
.likert-footer-max {
  right: 0;
}
@media (max-width: 1024px) {
  .admin-dashboard .row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .container {
    padding: 16px 14px;
  }
  .card {
    padding: 16px;
  }
  .form-actions .btn,
  .form-actions button {
    width: 100%;
    justify-content: center;
  }
  .card.intro-card {
      padding: 24px 14px;
  }
  .intro-icon-svg {
    width: 48px;
    height: 48px;
  }
  .intro-subtitle {
    font-size: 15px;
  }
  .intro-start-btn {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 12px;
    padding: 16px 18px;
  }
  .intro-start-btn .material-symbols-rounded {
    display: none;
  }
  .home-survey-card__arrow {
    display: none;
  }
  .intro-start-btn strong {
    font-size: 1.2rem;
  }
  .intro-details-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
  }
  .intro-details-actions .btn {
    width: auto;
    flex: 0 0 auto;
    justify-content: center;
    padding: 10px 18px;
  }
  .rich-text-toolbar-btn {
    min-width: 32px;
    height: 32px;
  }
  .row {
    grid-template-columns: 1fr;
  }
  .admin-dashboard .row {
    grid-template-columns: 1fr;
  }
  .admin-nav-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-nav-links {
    width: 100%;
  }
  .admin-nav-bar > form {
    width: 100%;
  }
  .admin-nav-bar > form .btn {
    width: 100%;
    justify-content: center;
  }
  .page-header-row {
    flex-wrap: wrap;
  }
  .results-header {
    flex-direction: column;
    align-items: stretch;
  }
  .results-header h1 {
    font-size: 1.35rem;
  }
  .export-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .export-actions form {
    flex: 1 1 100%;
    margin: 0;
  }
  .export-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .action-buttons.survey-table-actions {
    flex-wrap: wrap;
  }
  .col-hide-mobile {
    display: none;
  }
  .survey-current-page-title {
    font-size: 1.12rem;
  }
  .likert-live-value {
    font-size: 1.45rem;
    padding: 4px 12px;
  }
  .survey-form-actions {
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap;
  }
  .survey-form-actions .btn {
    width: auto;
    flex: 0 0 auto;
    justify-content: center;
    padding: 10px 18px;
  }
  .pages-actions,
  .editor-actions,
  .form-actions-right,
  .app-dialog__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .pages-actions .btn,
  .editor-actions .btn,
  .form-actions-right .btn,
  .form-actions-right button[type="submit"],
  .app-dialog__actions .btn {
    width: 100%;
    justify-content: center;
  }
  .person-nav {
    justify-content: center;
    flex-wrap: wrap;
  }
  .person-nav-controls {
    width: 100%;
    justify-content: center;
  }
  #deletePersonBtn {
    width: 100%;
    justify-content: center;
  }
  .answer-card-actions {
    justify-content: stretch;
  }
  .answer-card-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .scale {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  th, td {
    padding: 8px 6px;
    font-size: 0.92rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 12px 10px;
  }
  .card {
    padding: 14px;
  }
  .admin-nav-links .btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    min-width: 0;
  }
  .stat-card p {
    font-size: 1.35rem;
  }
  .app-dialog-overlay {
    padding: 12px;
  }
}

@media (hover: none) and (pointer: coarse) {
  button,
  .btn,
  .custom-select__trigger,
  .results-tab,
  .more-menu-item {
    min-height: 44px;
  }
  .page-toggle-btn {
    min-height: 44px;
    min-width: 44px;
  }
  .action-buttons.survey-table-actions > .btn.btn-edit,
  .action-buttons.survey-table-actions > .btn.btn-results,
  .action-buttons.survey-table-actions > .more-menu > summary.btn.btn-more {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}
