:root {
  --brand-primary: #0073b5;
  --brand-sky: #00aeef;
  --brand-white: #ffffff;
  --brand-ink: #262828;
  --brand-slate: #31465e;
  --brand-coral: #f85e2f;
  --brand-mint: #21c7a8;
  --brand-yellow: #ffd166;
  --surface: #ffffff;
  --canvas: #fcfcfc;
  --soft-blue: #eef8fd;
  --line: #d9e2ea;
  --muted: #66737f;
  --text: #262828;
  --shadow: 0 14px 35px rgba(38, 40, 40, 0.11);
  --font-brand: Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-greek: Lato, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-xs: 14px;
  --text-sm: 16px;
  --text-md: 18px;
  --heading-sm: 22px;
  --heading-md: 28px;
  --heading-lg: 42px;
  --heading-xl: 62px;
  --topbar-height: 67px;
  --admin-bar-height: 46px;
  --sticky-offset: calc(var(--topbar-height) + var(--admin-bar-height));
  --z-tooltip: 2147483647;
  font-family: var(--font-brand);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-brand);
  font-size: var(--text-sm);
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.app-shell:lang(el) {
  font-family: var(--font-greek);
}

.app-shell:lang(el) .brand-title,
.app-shell:lang(el) .brand-subtitle,
.app-shell:lang(el) .tabs,
.app-shell:lang(el) .toolbar,
.app-shell:lang(el) .side-panel,
.app-shell:lang(el) .developer-panel {
  font-family: var(--font-brand);
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 14px 22px;
  position: sticky;
  top: 0;
  z-index: 20;
}

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

.brand-link {
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  border-radius: 6px;
  display: block;
  height: 38px;
  object-fit: contain;
  width: 42px;
}

.brand-title {
  color: var(--brand-primary);
  font-size: var(--text-sm);
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 500;
  margin-top: 2px;
}

.tabs,
.mode-pill,
.toolbar,
.inline-actions,
.question-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.mode-pill-button {
  cursor: pointer;
  font: inherit;
}

.toolbar {
  flex-wrap: nowrap;
  justify-self: end;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-self: end;
}

.tabs {
  background: #f9fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  gap: 0;
  justify-content: center;
  justify-self: center;
  overflow: hidden;
}

.tab,
.icon-button,
.ghost-button,
.primary-button,
.danger-button,
.mini-button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-flex;
  gap: 7px;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  text-decoration: none;
}

.primary-button:disabled,
.ghost-button:disabled,
.danger-button:disabled,
.mini-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tab,
.ghost-button,
.mini-button {
  background: #f9fbfd;
  color: var(--brand-slate);
}

.tab {
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  white-space: nowrap;
}

.tab:first-child {
  border-left: 0;
}

.tab.active,
.primary-button {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}

.danger-button {
  background: #fff5f4;
  border-color: #ffd1cb;
  color: #b5362e;
}

.icon-button {
  aspect-ratio: 1;
  background: #f9fbfd;
  color: var(--brand-slate);
  padding: 7px;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.icon-button.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}

.translation-button {
  background:
    linear-gradient(#f9fbfd, #f9fbfd) padding-box,
    conic-gradient(var(--brand-sky) var(--translation-progress, 0%), #d9e2ea 0) border-box;
  border: 2px solid transparent;
  color: var(--brand-slate);
  min-height: 36px;
}

.translation-button:hover {
  color: var(--brand-primary);
}

.compact-button {
  min-height: 34px;
  padding: 7px 10px;
}

.tooltip-anchor {
  position: relative;
  z-index: var(--z-tooltip);
}

.tooltip-anchor::after {
  background: var(--brand-ink);
  border-radius: 6px;
  color: white;
  content: attr(data-tooltip);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.2;
  opacity: 0;
  padding: 7px 9px;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  transform: translateY(-4px);
  transition: opacity 140ms, transform 140ms;
  white-space: nowrap;
  z-index: var(--z-tooltip);
}

.tooltip-anchor::before {
  border: 6px solid transparent;
  border-bottom-color: var(--brand-ink);
  content: "";
  opacity: 0;
  pointer-events: none;
  position: absolute;
  right: 11px;
  top: calc(100% - 3px);
  transform: translateY(-4px);
  transition: opacity 140ms, transform 140ms;
  z-index: var(--z-tooltip);
}

.tooltip-anchor:hover,
.tooltip-anchor:focus-visible {
  z-index: var(--z-tooltip);
}

.tooltip-anchor:hover::after,
.tooltip-anchor:focus-visible::after,
.tooltip-anchor:hover::before,
.tooltip-anchor:focus-visible::before {
  opacity: 1;
  transform: translateY(0);
}

.question-type-icon.tooltip-anchor::after,
.group-type-icon.tooltip-anchor::after,
.inspector-head-icon.tooltip-anchor::after {
  left: 0;
  right: auto;
}

.question-type-icon.tooltip-anchor::before,
.group-type-icon.tooltip-anchor::before,
.inspector-head-icon.tooltip-anchor::before {
  left: 11px;
  right: auto;
}

.ui-icon {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  width: 18px;
}

.mode-pill {
  background: var(--soft-blue);
  border: 1px solid #c4edf7;
  border-radius: 999px;
  color: var(--brand-slate);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 7px 10px;
  white-space: nowrap;
}

.avatar-button {
  align-items: center;
  background: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  width: 36px;
}

.avatar-button img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.user-menu {
  position: relative;
}

.user-menu-popover {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 190px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 70;
}

.user-menu-name {
  border-bottom: 1px solid var(--line);
  color: var(--brand-slate);
  font-size: var(--text-xs);
  font-weight: 800;
  margin-bottom: 6px;
  overflow: hidden;
  padding: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-popover button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--brand-slate);
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 9px 8px;
  text-align: left;
  width: 100%;
}

.user-menu-popover button:not(:disabled):hover {
  background: var(--soft-blue);
  color: var(--brand-primary);
}

.user-menu-popover button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.user-identity-button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-slate);
  display: inline-flex;
  gap: 8px;
  padding: 7px 10px;
}

.user-identity-button:hover {
  background: var(--soft-blue);
  border-color: #c4edf7;
}

.user-identity-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.user-identity-name {
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: 1.2;
}

.user-identity-email {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.user-identity-avatar {
  flex: 0 0 auto;
  height: 32px;
  width: 32px;
  font-size: 11px;
}

.user-identity-chevron {
  flex: 0 0 auto;
  height: 16px;
  opacity: 0.6;
  width: 16px;
}

.user-menu-link {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--brand-slate);
  display: flex;
  font-size: var(--text-xs);
  font-weight: 700;
  gap: 6px;
  justify-content: space-between;
  padding: 9px 8px;
  text-decoration: none;
  width: 100%;
}

.user-menu-link:hover {
  background: var(--soft-blue);
  color: var(--brand-primary);
}

.user-menu-external-icon {
  flex: 0 0 auto;
  height: 13px;
  opacity: 0.55;
  width: 13px;
}

.auth-page,
.landing-page {
  margin: 0 auto;
  max-width: 1180px;
  padding: 42px 22px;
}

.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 22px;
}

.auth-main {
  align-items: center;
  display: flex;
  flex: 1;
  justify-content: center;
}

.auth-description {
  color: var(--muted);
  font-size: var(--text-xs);
  margin: 8px 0 0;
}

.auth-status-card {
  text-align: center;
}

.auth-status-card h1 {
  margin-top: 14px;
}

.auth-status-card .auth-submit {
  margin-top: 18px;
}

.auth-error-card {
  text-align: center;
}

.error-illustration {
  color: var(--brand-primary);
  display: block;
  height: 120px;
  margin: 4px auto 14px;
  width: 120px;
}

.auth-error-card h2 {
  color: var(--brand-slate);
  font-size: var(--heading-sm);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 6px;
}

.error-message {
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.45;
  margin: 0 0 18px;
}

.error-action {
  min-width: 180px;
}

.auth-status-spinner {
  animation: auth-spin 900ms linear infinite;
  border: 3px solid var(--line);
  border-radius: 50%;
  border-top-color: var(--brand-primary);
  height: 44px;
  margin: 8px auto 0;
  width: 44px;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

.auth-card,
.selector-panel,
.landing-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-card {
  margin: 0 auto;
  max-width: 430px;
  padding: 28px;
  width: 100%;
}

.auth-brand {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-card h1,
.selector-head h1 {
  color: var(--brand-slate);
  font-size: var(--heading-md);
  line-height: 1.1;
  margin: 0;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.auth-form label,
.combo-field {
  color: var(--brand-slate);
  display: grid;
  font-size: var(--text-xs);
  font-weight: 800;
  gap: 7px;
}

.auth-form input,
.combo-field input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

.auth-submit {
  min-height: 42px;
  width: 100%;
}

.form-message {
  color: var(--muted);
  font-size: var(--text-xs);
  margin: 0;
  min-height: 20px;
}

.form-message[data-tone="error"],
.error-banner {
  color: #b5362e;
}

.landing-shell {
  background: linear-gradient(180deg, #f5fbfd 0, var(--canvas) 42%);
}

.landing-topbar {
  grid-template-columns: minmax(190px, 280px) minmax(0, 1fr) auto;
}

.landing-choice-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.landing-card {
  min-height: 150px;
  padding: 20px;
}

.landing-card h2 {
  color: var(--brand-slate);
  font-size: var(--heading-sm);
  margin: 12px 0 8px;
}

.landing-card p,
.selector-head p {
  color: var(--muted);
  font-size: var(--text-xs);
  margin: 0;
}

.landing-card-icon {
  align-items: center;
  background: var(--soft-blue);
  border: 1px solid #c4edf7;
  border-radius: 8px;
  color: var(--brand-primary);
  display: flex;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.disabled-card {
  opacity: 0.52;
}

.active-card {
  border-color: #9bdff3;
}

.selector-panel {
  padding: 20px;
}

.selector-head {
  align-items: start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

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

.combo-field {
  position: relative;
}

.combo-field input:disabled {
  background: #f6f8fa;
  color: var(--muted);
  cursor: not-allowed;
}

.combo-menu {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  left: 0;
  max-height: 290px;
  overflow: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
}

.combo-option {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--brand-slate);
  display: grid;
  gap: 3px;
  padding: 9px;
  text-align: left;
  width: 100%;
}

.combo-option:hover,
.combo-option.selected,
.combo-option.highlighted {
  background: var(--soft-blue);
  color: var(--brand-primary);
}

.combo-option span,
.combo-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.combo-counter {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  min-height: 16px;
}

.combo-empty {
  padding: 12px;
}

.error-banner {
  background: #fff5f4;
  border: 1px solid #ffd1cb;
  border-radius: 8px;
  font-size: var(--text-xs);
  font-weight: 700;
  margin-top: 16px;
  padding: 10px 12px;
}

.selector-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.workspace {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 360px;
  padding: 22px;
}

.workspace.developer-open {
  grid-template-columns: minmax(0, 1fr) 340px 460px;
}

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

.workspace.full-width-workspace.developer-open {
  grid-template-columns: minmax(0, 1fr) 460px;
}

.main-panel,
.side-panel,
.developer-panel,
.modal-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.main-panel {
  isolation: isolate;
  min-width: 0;
  padding: 18px;
}

.designer-main-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.designer-main-column > .main-panel {
  max-height: calc(100vh - var(--sticky-offset) - 65px);
  overflow: auto;
  overscroll-behavior: contain;
}

.questionnaire-admin-bar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 46px;
  padding: 5px 22px;
  position: sticky;
  top: var(--topbar-height);
  z-index: 19;
}

.admin-name-section {
  align-items: center;
  display: flex;
  gap: 6px;
  min-width: 0;
}

.admin-name-text {
  background: transparent;
  border: 0;
  color: var(--brand-slate);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 850;
  line-height: 1;
  min-width: 0;
  padding: 4px 0;
  text-align: left;
}

.admin-name-text:hover {
  color: var(--brand-primary);
}

.admin-name-input {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand-slate);
  font-size: var(--text-xs);
  font-weight: 800;
  min-height: 26px;
  padding: 4px 8px;
  width: min(360px, 100%);
}

.admin-name-edit {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.admin-name-section:hover .admin-name-edit,
.admin-name-edit.is-editing,
.admin-name-edit:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.id-chip {
  flex: 0 0 auto;
}

.side-panel {
  align-self: start;
  max-height: calc(100vh - var(--sticky-offset) - 33px);
  overflow: auto;
  padding: 16px;
  position: sticky;
  top: calc(var(--sticky-offset) + 31px);
}

.side-panel.expanded-inspector {
  bottom: auto;
  left: 50%;
  max-height: min(82vh, 860px);
  max-width: min(980px, calc(100vw - 44px));
  position: fixed;
  right: auto;
  top: calc(var(--sticky-offset) + 31px);
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 44px));
  z-index: 58;
}

.html-inspector.expanded-inspector .html-editor-shell {
  margin-top: 12px;
}

.html-inspector.expanded-inspector .html-textarea {
  min-height: 360px;
}

.html-inspector.expanded-inspector .ck-editor__editable {
  min-height: 360px;
}

.html-inspector.expanded-inspector .ck-editor__main {
  resize: vertical;
  overflow: auto;
}

.inspector-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.inspector-head-title {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.inspector-head-icon {
  align-items: center;
  background: var(--soft-blue);
  border: 1px solid #c4edf7;
  border-radius: 6px;
  color: var(--brand-primary);
  display: inline-flex;
  flex: 0 0 auto;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.inspector-actions {
  display: flex;
  gap: 6px;
}

.inspector-head .panel-title {
  margin: 0;
}

.compare-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

.compare-panel-head {
  border-bottom: 1px solid var(--line);
  color: var(--brand-ink);
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 6px;
}

.compare-panel input[disabled],
.compare-panel textarea[disabled] {
  background: var(--surface-2, #f4f4f6);
  border-color: transparent;
  color: var(--text-muted, #6b7280);
  cursor: default;
  font-style: italic;
}

.developer-panel {
  align-self: start;
  max-height: calc(100vh - var(--sticky-offset) - 24px);
  overflow: hidden;
  padding: 16px;
  position: sticky;
  top: calc(var(--sticky-offset) + 22px);
}

.settings-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - var(--sticky-offset) - 28px);
  overflow: auto;
  padding: 16px;
  position: fixed;
  right: 22px;
  top: calc(var(--sticky-offset) + 22px);
  width: min(360px, calc(100vw - 28px));
  z-index: 55;
}

.settings-list {
  display: grid;
  gap: 14px;
}

.settings-id-row {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.settings-id-row .id-chip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.developer-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.developer-meta {
  color: var(--muted);
  display: flex;
  font-size: var(--text-xs);
  font-weight: 800;
  gap: 8px;
  margin-bottom: 10px;
}

.developer-tools {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.copy-json-button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 9px;
}

.floating-toast {
  background: var(--soft-blue);
  border: 1px solid #c4edf7;
  border-radius: 6px;
  box-shadow: var(--shadow);
  color: var(--brand-slate);
  font-size: var(--text-xs);
  font-weight: 800;
  padding: 7px 10px;
  position: fixed;
  right: 22px;
  top: 78px;
  width: fit-content;
  z-index: 80;
}

.developer-meta span {
  background: var(--soft-blue);
  border: 1px solid #c4edf7;
  border-radius: 999px;
  padding: 4px 8px;
}

.json-view {
  background: var(--brand-ink);
  border-radius: 8px;
  color: #d9f6ff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: var(--text-xs);
  line-height: 1.55;
  margin: 0;
  max-height: calc(100vh - 178px);
  overflow: auto;
  padding: 14px;
  white-space: pre;
}

.panel-title {
  color: var(--brand-slate);
  font-size: var(--text-sm);
  font-weight: 800;
  margin: 0 0 12px;
}

.survey-header {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding-bottom: 16px;
  padding-right: 48px;
  position: relative;
}

.survey-header.selected {
  border-color: var(--brand-sky);
}

.survey-edit-button {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  transform: translateX(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.survey-header:hover .survey-edit-button,
.survey-header.selected .survey-edit-button {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.survey-title {
  color: var(--brand-primary);
  font-size: var(--heading-lg);
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
}

.survey-title-row {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.survey-chips {
  flex: 0 0 auto;
  margin-top: 7px;
}

.survey-description {
  color: var(--muted);
  font-size: var(--text-md);
  margin: 7px 0 0;
}

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

.field,
.wide-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

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

.field label,
.wide-field label {
  color: var(--brand-slate);
  font-size: var(--text-xs);
  font-weight: 800;
}

.field input,
.field select,
.wide-field input,
.wide-field textarea,
.wide-field select,
.html-textarea,
.value-editor-row input {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  min-height: 36px;
  padding: 8px 10px;
  width: 100%;
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--brand-primary);
  font-size: var(--text-xs);
  font-weight: 800;
  margin: 0 0 12px;
  padding: 0;
  text-align: left;
  width: fit-content;
}

.switch-row {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 8px;
  min-height: 36px;
}

.switch-row input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.switch {
  background: #d9e2ea;
  border-radius: 999px;
  display: inline-flex;
  height: 22px;
  position: relative;
  transition: background 140ms;
  width: 40px;
}

.switch::after {
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(38, 40, 40, 0.22);
  content: "";
  height: 18px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: transform 140ms;
  width: 18px;
}

.switch-row input:checked + .switch {
  background: var(--brand-sky);
}

.switch-row input:checked + .switch::after {
  transform: translateX(18px);
}

.theme-active-row {
  margin-bottom: 16px;
}

.theme-active-row .switch-row {
  color: var(--brand-slate);
  font-weight: 850;
}

.theme-columns {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr 1fr;
}

.theme-section {
  display: grid;
  gap: 12px;
}

.theme-section .panel-title {
  margin-bottom: 0;
}

.theme-images-row {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.theme-images-row .wide-field {
  grid-column: auto;
  margin-bottom: 0;
}

.theme-image-field {
  gap: 10px;
}

.theme-logo-group {
  display: grid;
  gap: 8px;
}

.theme-logo-group .theme-image-field,
.theme-logo-switch {
  margin-bottom: 0;
}

.theme-image-preview {
  align-items: flex-start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 220px) auto;
  width: fit-content;
}

.theme-image-preview img {
  aspect-ratio: 16 / 9;
  background: #f9fbfd;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: contain;
  width: 220px;
}

.theme-dropzone {
  align-items: center;
  background: #f9fbfd;
  border: 1px dashed #b8c8d6;
  border-radius: 8px;
  color: var(--brand-slate);
  cursor: pointer;
  display: flex;
  font-size: var(--text-xs);
  font-weight: 850;
  gap: 8px;
  justify-content: center;
  min-height: 86px;
  padding: 14px;
  text-align: center;
  transition: border-color 140ms, box-shadow 140ms, color 140ms;
  width: 100%;
}

.theme-dropzone:hover,
.theme-dropzone:focus-within {
  border-color: var(--brand-sky);
  box-shadow: 0 0 0 2px rgba(0, 174, 239, 0.14);
  color: var(--brand-primary);
}

.theme-dropzone input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.range-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 12px;
}

.side-label-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 12px;
}

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

.range-preview {
  border-radius: 6px;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  margin-top: 8px;
  overflow: hidden;
  position: relative;
}

.range-preview span {
  background: var(--soft-blue);
  border: 1px solid #c4edf7;
  border-radius: 4px;
  color: var(--brand-slate);
  font-size: 12px;
  font-weight: 800;
  min-height: 36px;
  padding: 8px 0 12px;
  text-align: center;
}

.theme-choice-group,
.segmented-control {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.theme-choice,
.segmented-control button {
  align-items: center;
  background: #f9fbfd;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand-slate);
  display: inline-flex;
  font-size: var(--text-xs);
  font-weight: 850;
  gap: 8px;
  justify-content: center;
  min-height: 38px;
  padding: 7px 9px;
}

.theme-choice {
  overflow: hidden;
  position: relative;
}

.theme-choice::before {
  background: var(--theme-gradient);
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.theme-choice.active,
.segmented-control button.active {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(0, 174, 239, 0.18);
}

.theme-swatch {
  background: var(--theme-gradient);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(38, 40, 40, 0.12);
  height: 14px;
  width: 42px;
}

.opinion-theme-choice::before {
  content: none;
}

.opinion-theme-swatch {
  align-items: center;
  display: inline-flex;
  gap: 4px;
}

.opinion-theme-dot {
  background: transparent;
  border: 1.5px solid var(--brand-slate);
  border-radius: 50%;
  display: inline-block;
  height: 9px;
  width: 9px;
}

.values-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.values-head .panel-title {
  margin: 0 0 8px;
}

.value-editor-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.value-editor-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.value-editor-row.with-number {
  grid-template-columns: 70px minmax(0, 1fr) auto;
}

.value-number-input {
  text-align: center;
}

.wide-field textarea,
.html-textarea {
  min-height: 110px;
  resize: vertical;
}

.stop-pages-panel {
  display: grid;
  gap: 16px;
  overflow: hidden;
}

.stop-page-tabs {
  background: #f9fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

.stop-page-tab {
  align-items: center;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--brand-slate);
  display: inline-flex;
  font-size: var(--text-xs);
  font-weight: 850;
  justify-content: center;
  min-height: 38px;
  padding: 9px 12px;
  text-align: center;
}

.stop-page-tab:first-child {
  border-left: 0;
}

.stop-page-tab.active {
  background: var(--brand-primary);
  color: white;
}

.stop-pages-grid {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.stop-pages-grid.with-html-assist {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
}

.stop-pages-grid.with-html-assist .stop-page-editor {
  grid-column: 1;
}

.stop-pages-grid.with-html-assist .html-assist-sidebar {
  grid-column: 2;
  grid-row: 1;
  margin-top: 24px;
}

.stop-page-editor {
  margin-bottom: 0;
  min-width: 0;
}

.stop-page-editor .html-textarea {
  min-height: 420px;
}

.stop-page-editor .ck-editor__editable {
  min-height: min(66vh, 740px);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stop-page-editor .ck-source-editing-area textarea {
  min-height: min(66vh, 740px);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.html-assist-launch-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.html-assist-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--brand-primary);
  border-radius: 8px;
  color: var(--brand-primary);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-brand);
  font-size: var(--text-xs);
  font-weight: 850;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.html-assist-button:hover,
.html-assist-button.is-open {
  background: var(--soft-blue);
  box-shadow: 0 0 0 2px rgba(0, 115, 181, 0.1);
}

.html-assist-button .ui-icon {
  height: 16px;
  width: 16px;
}

.html-assist-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  min-height: 0;
  overflow: hidden;
}

.html-assist-sidebar .html-assist-panel {
  height: min(66vh, 740px);
  margin-top: 0;
  min-height: 0;
  position: relative;
}

.html-assist-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  justify-content: space-between;
  min-height: 40px;
  padding: 6px 10px;
}

.html-assist-title {
  align-items: center;
  color: var(--brand-slate);
  display: flex;
  font-size: var(--text-xs);
  font-weight: 850;
  gap: 8px;
}

.html-assist-title .ui-icon {
  color: var(--brand-primary);
  height: 16px;
  width: 16px;
}

.beta-chip {
  background: #fff1f1;
  border: 1px solid #ffc9c9;
  border-radius: 999px;
  color: #b74444;
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  padding: 4px 6px;
  text-transform: uppercase;
}

.html-assist-messages {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 12px;
}

.html-assist-sidebar .html-assist-messages {
  bottom: 53px;
  flex: 1 1 auto;
  left: 0;
  max-height: none;
  min-height: 0;
  position: absolute;
  right: 0;
  top: 41px;
}

.html-assist-message {
  display: flex;
}

.html-assist-user {
  justify-content: flex-end;
}

.html-assist-bubble {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--brand-ink);
  font-size: var(--text-xs);
  line-height: 1.45;
  max-width: 92%;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.html-assist-user .html-assist-bubble {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-white);
  font-weight: 700;
}

.html-assist-thinking {
  align-items: center;
  display: inline-flex;
  gap: 4px;
  min-height: 18px;
}

.html-assist-thinking span {
  animation: agent-bounce 1.3s infinite ease-in-out;
  background: var(--muted);
  border-radius: 50%;
  display: inline-block;
  height: 6px;
  width: 6px;
}

.html-assist-thinking span:nth-child(2) { animation-delay: 0.2s; }
.html-assist-thinking span:nth-child(3) { animation-delay: 0.4s; }

.html-assist-input-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  padding: 8px 10px;
}

.html-assist-sidebar .html-assist-input-row {
  background: var(--surface);
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
}

.html-assist-input {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-ink);
  flex: 1;
  font-family: var(--font-brand);
  font-size: var(--text-xs);
  line-height: 1;
  min-height: 36px;
  padding: 8px 10px;
}

.html-assist-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(0, 115, 181, 0.12);
  outline: none;
}

.html-assist-send {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
}

.add-row,
.add-question-row {
  border: 1px dashed #aac7d6;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 0;
  padding: 10px;
}

.add-question-row {
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  margin: 12px 0 0;
}

.create-type-button {
  background: white;
  border-color: #c4edf7;
  color: var(--brand-slate);
  justify-content: flex-start;
  min-height: 42px;
}

.create-type-button:hover {
  border-color: var(--brand-sky);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.12);
}

.group {
  border: 1px solid transparent;
  border-radius: 8px;
  margin: 12px 0;
  padding: 10px;
  position: relative;
  transition: border-color 140ms, background 140ms, box-shadow 140ms;
}

.group:hover:not(:has(.question:hover)),
.group.grid-group,
.group.html-group {
  border-color: var(--line);
  background: #fbfcfe;
}

.group.selected {
  border-color: var(--brand-sky);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.16);
}

.group.drag-insert-before::before,
.group.drag-insert-after::after,
.question.drag-insert-before::before,
.question.drag-insert-after::after,
.question-list.drag-insert-end::after {
  background: var(--brand-sky);
  border-radius: 999px;
  content: "";
  height: 2px;
  left: 8px;
  pointer-events: none;
  position: absolute;
  right: 8px;
  z-index: 4;
}

.group.drag-insert-before::before,
.question.drag-insert-before::before {
  top: -7px;
}

.group.drag-insert-after::after,
.question.drag-insert-after::after {
  bottom: -7px;
}

.group-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 9px;
  min-height: 38px;
  padding-right: 4px;
}

.group-heading,
.question-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.group-title {
  color: var(--brand-slate);
  font-size: var(--heading-sm);
  font-weight: 850;
  margin: 0;
  min-width: 0;
}

.group-type-icon {
  align-items: center;
  background: var(--soft-blue);
  border: 1px solid #c4edf7;
  border-radius: 6px;
  color: var(--brand-primary);
  display: inline-flex;
  flex: 0 0 auto;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.group-collapse-toggle {
  flex: 0 0 auto;
}

.group.collapsed {
  padding-bottom: 10px;
}

.group.collapsed .group-header {
  margin-bottom: 0;
}

.group-count-chip {
  background: #f0f4f8;
  border-color: var(--line);
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.group-toolbar {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-left: auto;
  min-height: 36px;
  position: relative;
}

.group-chips {
  flex: 0 0 auto;
}

.chip {
  background: var(--soft-blue);
  border: 1px solid #c4edf7;
  border-radius: 999px;
  color: var(--brand-slate);
  font-size: var(--text-xs);
  font-weight: 800;
  padding: 3px 8px;
}

.chip.warn {
  background: #fff8e5;
  border-color: #ffe2a4;
}

.chip.ai-badge {
  background: #effbf8;
  border-color: #b7eee4;
  color: #137f70;
}

.chip.translation-human-chip {
  background: #f9fbfd;
  border-color: var(--line);
  color: var(--muted);
}

.group-controls {
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  transform: translateX(6px);
  z-index: 3;
}

.group:hover:not(:has(.question:hover)) .group-controls,
.group.selected .group-controls {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.remove-group-button {
  transition: color 140ms, border-color 140ms, background 140ms, width 140ms;
}

.remove-group-button.confirming {
  aspect-ratio: auto;
  background: #fff5f4;
  border-color: #ffd1cb;
  color: #b5362e;
  font-weight: 800;
  width: auto;
}

.remove-group-button.confirming span {
  display: flex;
  white-space: nowrap;
}

.question {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: grab;
  margin: 8px 0;
  padding: 12px;
  position: relative;
}

.question-list {
  position: relative;
}

.question-list.drag-insert-end::after {
  bottom: 4px;
}

.question.disabled-question {
  background: #f4f6f8;
  opacity: 0.66;
}

.question.disabled-question .question-type-icon,
.question.disabled-question .question-title,
.question.disabled-question .preview {
  filter: grayscale(1);
}

.question:active {
  cursor: grabbing;
}

.question.selected {
  border-color: var(--brand-sky);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.16);
}

.question-top {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.question-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.question-toolbar {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  min-height: 34px;
}

.question-type-icon {
  align-items: center;
  background: var(--soft-blue);
  border: 1px solid #c4edf7;
  border-radius: 6px;
  color: var(--brand-primary);
  display: inline-flex;
  flex: 0 0 auto;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.question-title {
  color: var(--text);
  font-size: var(--text-md);
  font-weight: 700;
  margin: 0;
}

.question-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(6px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 3;
}

.question:hover .question-actions,
.question.selected .question-actions,
.question.confirm-remove .question-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.remove-question-button.confirming {
  aspect-ratio: auto;
  background: #fff5f4;
  border-color: #ffd1cb;
  color: #b5362e;
  font-weight: 800;
  width: auto;
}

.remove-question-button.confirming span {
  display: flex;
  white-space: nowrap;
}

.required-chip {
  background: #fff0ee;
  border-color: #f85e2f;
  color: #b5362e;
}

.active-eye {
  color: var(--brand-primary);
}

.warning-note {
  background: #fff8e5;
  border: 1px solid #ffe2a4;
  border-radius: 6px;
  color: #8a5b00;
  font-size: var(--text-xs);
  font-weight: 800;
  margin-bottom: 12px;
  padding: 9px 10px;
}

.preview {
  margin-top: 12px;
}

.scale {
  border-radius: 6px;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
  overflow: hidden;
  position: relative;
}

.scale span {
  background: var(--soft-blue);
  border: 1px solid #c4edf7;
  border-radius: 5px;
  color: var(--brand-slate);
  font-size: var(--text-xs);
  font-weight: 800;
  min-height: 38px;
  padding: 9px 0 13px;
  text-align: center;
}

.gradient-scale {
  box-shadow: inset 0 0 0 1px rgba(38, 40, 40, 0.12);
}

.gradient-scale::after {
  background: var(--scale-gradient);
  bottom: 0;
  content: "";
  height: 8px;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  z-index: 2;
}

.gradient-scale span {
  background: var(--soft-blue);
  border: 1px solid #c4edf7;
  border-radius: 0;
  color: var(--brand-slate);
}

.gradient-scale span:first-child {
  border-left: 0;
}

.scale-labels {
  color: var(--muted);
  display: flex;
  font-size: var(--text-xs);
  justify-content: space-between;
  margin-top: 6px;
}

.option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option {
  align-items: center;
  background: #f9fbfd;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  display: inline-flex;
  gap: 8px;
  min-height: 40px;
  padding: 9px 12px;
}

.option input {
  accent-color: var(--brand-sky);
}

.faux-input {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  min-height: 80px;
  padding: 10px;
}

.emoji-row,
.boolean-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emoji-row span,
.boolean-row span {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 800;
  padding: 8px 10px;
}

.opinion-scale {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: center;
  padding: 6px 0;
}

.opinion-circle {
  background: transparent;
  border: 2px solid var(--line);
  border-radius: 50%;
  display: inline-block;
  height: 28px;
  width: 28px;
}

.opinion-circle.negative {
  border-color: #ff5a3c;
}

.opinion-circle.neutral {
  border-color: #b8c2cc;
}

.opinion-circle.positive {
  border-color: #1f3a5f;
}

.opinion-circle.filled {
  background: #1f3a5f;
  border-color: #1f3a5f;
}

.icon-choice-row span {
  align-items: center;
  display: inline-flex;
  flex-direction: column;
  gap: 7px;
  min-width: 92px;
  padding: 10px 12px;
  text-align: center;
}

.icon-choice-row img {
  display: block;
  height: 38px;
  object-fit: contain;
  width: 38px;
}

.boolean-row.icon-choice-row img {
  height: 42px;
  width: 42px;
}

.icon-choice-row strong {
  font-size: var(--text-xs);
}

.html-render {
  border-left: 4px solid var(--brand-sky);
  margin: 6px 0;
  padding: 10px 12px;
}

.html-placeholder {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 800;
}

.html-expand-note {
  margin-top: 4px;
}

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

.translation-missing {
  border-color: var(--brand-coral);
}

.translation-note {
  color: #b5362e;
  font-size: var(--text-xs);
  font-weight: 800;
}

.progress {
  background: #e7edf3;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress > span {
  background: var(--brand-sky);
  display: block;
  height: 100%;
}

.language-list {
  display: grid;
  gap: 9px;
  max-height: 520px;
  overflow: auto;
}

.language-item {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  text-align: left;
}

.language-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
}

.modal-backdrop {
  align-items: center;
  background: rgba(23, 35, 49, 0.36);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 22px;
  position: fixed;
  z-index: 50;
}

.modal-panel {
  max-height: 88vh;
  max-width: 760px;
  overflow: auto;
  padding: 18px;
  width: min(760px, 100%);
}

.translation-list-panel {
  max-width: 1040px;
  width: min(1040px, 100%);
}

.modal-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.translation-list-head {
  align-items: flex-start;
  gap: 14px;
}

.translation-head-title {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.translation-head-title .panel-title {
  margin-bottom: 3px;
}

.translation-head-title p {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 800;
  margin: 0;
}

.translation-modal-toolbar {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.translation-filter-group {
  background: #f9fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0;
  min-width: 0;
  overflow: hidden;
}

.translation-filter-group button {
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  flex: 0 0 auto;
  gap: 5px;
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}

.translation-filter-group button:first-child {
  border-left: 0;
}

.translation-filter-group button.active {
  background: var(--brand-primary);
  color: white;
}

.translation-filter-group span {
  color: inherit;
  font-size: var(--text-xs);
  font-weight: 900;
  opacity: 0.72;
}

.translation-search-field {
  align-items: center;
  background: #f9fbfd;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  flex: 1 1 260px;
  gap: 7px;
  min-height: 34px;
  min-width: 180px;
  padding: 6px 9px;
}

.translation-search-field .ui-icon {
  flex: 0 0 auto;
  height: 16px;
  width: 16px;
}

.translation-search-field input {
  background: transparent;
  border: 0;
  color: var(--text);
  min-width: 0;
  outline: 0;
  padding: 0;
  width: 100%;
}

.translation-field-list {
  display: grid;
  gap: 10px;
  max-height: min(66vh, 720px);
  overflow: auto;
  padding-right: 4px;
}

.translation-field-row {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.translation-field-row.is-ai-translated {
  border-color: #b7eee4;
  box-shadow: inset 3px 0 0 var(--brand-mint);
}

.translation-row-head {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.translation-row-head strong {
  color: var(--brand-slate);
  display: block;
  font-size: var(--text-xs);
}

.translation-row-head span:not(.chip) {
  color: var(--muted);
  display: block;
  font-size: var(--text-xs);
  font-weight: 800;
  margin-top: 2px;
}

.translation-row-content {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.translation-row-content > div {
  border-top: 1px solid var(--line);
  min-width: 0;
  padding-top: 8px;
}

.translation-row-content span {
  color: var(--muted);
  display: block;
  font-size: var(--text-xs);
  font-weight: 900;
  margin-bottom: 4px;
}

.translation-copy {
  color: var(--text);
  font-size: var(--text-xs);
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
}

.translation-copy :first-child {
  margin-top: 0;
}

.translation-copy :last-child {
  margin-bottom: 0;
}

.translation-edit-cell {
  display: grid;
  gap: 4px;
}

.translation-list-input,
.translation-list-textarea,
.translation-html-editor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  min-width: 0;
  padding: 8px 9px;
  width: 100%;
}

.translation-list-textarea,
.translation-html-editor {
  min-height: 92px;
  resize: vertical;
}

.translation-edit-cell .ck-editor__editable {
  min-height: 120px;
}

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

.ai-translated-input,
.html-editor-ai .ck-editor__editable {
  border-color: var(--brand-mint) !important;
  box-shadow: 0 0 0 2px rgba(33, 199, 168, 0.14);
}

.ai-asterisk {
  color: var(--brand-mint);
  font-weight: 900;
  margin-left: 4px;
}

.ai-translation-legend {
  color: #137f70;
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: 1.45;
  margin: 4px 0 0;
}

.ai-translation-legend span {
  color: var(--brand-mint);
  font-weight: 900;
}

.translation-agent-dialog {
  align-items: center;
  display: grid;
  gap: 12px;
  margin: 58px auto;
  max-width: 430px;
  min-height: 300px;
  place-content: center;
  text-align: center;
}

.translation-agent-dialog .panel-title {
  margin: 0;
}

.translation-agent-dialog p {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 800;
  margin: 0;
}

.translation-agent-dialog .progress {
  width: 100%;
}

.modal-actions {
  align-items: center;
  display: flex;
  gap: 9px;
  justify-content: center;
  margin-top: 2px;
}

.translation-loader {
  align-items: center;
  background: var(--soft-blue);
  border: 1px solid #c4edf7;
  border-radius: 999px;
  color: var(--brand-primary);
  display: inline-flex;
  height: 52px;
  justify-content: center;
  justify-self: center;
  width: 52px;
}

.translation-loader.success {
  background: #effbf8;
  border-color: #b7eee4;
  color: #137f70;
}

.translation-loader.error {
  background: #fff5f4;
  border-color: #ffd1cb;
  color: var(--brand-coral);
}

.translation-loader .ui-icon {
  animation: translationPulse 1200ms ease-in-out infinite;
}

.translation-loader.success .ui-icon,
.translation-loader.error .ui-icon {
  animation: none;
}

.translation-donut {
  align-items: center;
  background:
    radial-gradient(circle at center, var(--surface) 0 54%, transparent 55%),
    conic-gradient(var(--brand-mint) var(--translation-report-percent, 0%), #e7edf3 0);
  border-radius: 50%;
  color: #137f70;
  display: inline-flex;
  font-size: var(--text-xs);
  font-weight: 900;
  height: 70px;
  justify-content: center;
  justify-self: center;
  width: 70px;
}

.translation-donut span {
  align-items: center;
  background: var(--surface);
  border-radius: 50%;
  display: inline-flex;
  height: 43px;
  justify-content: center;
  width: 43px;
}

@keyframes translationPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

@media (max-width: 1050px) {
  .workspace,
  .workspace.developer-open,
  .workspace.full-width-workspace,
  .workspace.full-width-workspace.developer-open {
    grid-template-columns: 1fr;
  }

  .designer-main-column > .main-panel {
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
  }

  .stop-pages-grid.with-html-assist {
    grid-template-columns: 1fr;
  }

  .stop-pages-grid.with-html-assist .stop-page-editor,
  .stop-pages-grid.with-html-assist .html-assist-sidebar {
    grid-column: auto;
    grid-row: auto;
  }

  .html-assist-sidebar .html-assist-panel {
    height: auto;
    max-height: none;
    min-height: 0;
  }

  .stop-pages-grid.with-html-assist .html-assist-sidebar {
    margin-top: 0;
  }

  .html-assist-sidebar .html-assist-messages,
  .html-assist-sidebar .html-assist-input-row {
    bottom: auto;
    left: auto;
    position: static;
    right: auto;
    top: auto;
  }

  .tabs {
    border-radius: 6px;
    justify-content: center;
    overflow: hidden;
  }

  .tab-label {
    display: none;
  }

  .tab {
    aspect-ratio: 1;
    min-width: 38px;
    padding: 7px;
  }

  .developer-panel {
    border-radius: 12px 12px 0 0;
    bottom: 0;
    box-shadow: 0 -18px 40px rgba(38, 40, 40, 0.18);
    left: 0;
    max-height: min(60vh, 480px);
    overflow: auto;
    position: fixed;
    right: 0;
    top: auto;
    z-index: 46;
  }

  .side-panel {
    display: none;
  }

  .side-panel.is-open {
    bottom: 0;
    display: block;
    box-shadow: 0 -18px 40px rgba(38, 40, 40, 0.18);
    left: 0;
    max-height: min(78vh, 720px);
    overflow: auto;
    position: fixed;
    right: 0;
    top: auto;
    transform: translateY(0);
    z-index: 45;
  }

  .side-panel.is-open {
    border-radius: 12px 12px 0 0;
  }

  .side-panel.expanded-inspector {
    bottom: auto;
    left: 50%;
    max-height: min(82vh, 760px);
    right: auto;
    top: calc(var(--sticky-offset) + 16px);
    transform: translateX(-50%);
    width: min(940px, calc(100vw - 24px));
    z-index: 58;
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-height: 57px;
  }

  .topbar {
    gap: 8px;
    padding: 10px;
  }

  .workspace {
    padding: 14px;
  }

  .main-panel {
    padding: 14px;
  }

  .stop-pages-panel {
    gap: 14px;
    overflow: clip;
  }

  .stop-pages-grid {
    gap: 16px;
  }

  .brand {
    gap: 0;
  }

  .brand-title,
  .brand-subtitle,
  .mode-text,
  .compact-label {
    display: none;
  }

  .brand-mark {
    height: 34px;
    width: 36px;
  }

  .tabs,
  .toolbar,
  .topbar-actions {
    flex-wrap: nowrap;
  }

  .topbar-actions {
    gap: 6px;
  }

  .translation-modal-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .translation-search-field {
    flex-basis: 100%;
  }

  .landing-page {
    padding: 20px 12px;
  }

  .landing-choice-grid,
  .selector-grid {
    grid-template-columns: 1fr;
  }

  .translation-filter-group {
    max-width: 100%;
    overflow-x: auto;
  }

  .questionnaire-admin-bar {
    top: var(--topbar-height);
  }

  .theme-columns {
    grid-template-columns: 1fr;
  }

  .compact-button {
    aspect-ratio: 1;
    min-width: 36px;
    padding: 7px;
  }

  .publish-button {
    aspect-ratio: auto;
    min-height: 34px;
    padding: 7px 11px;
  }

  .topbar-actions {
    align-items: center;
  }

  .mode-pill {
    aspect-ratio: 1;
    min-height: 36px;
    padding: 7px;
  }

  .mode-pill .mode-text,
  .mode-pill .progress {
    display: none;
  }

  .stop-page-editor .ck-editor__editable,
  .stop-page-editor .ck-source-editing-area textarea,
  .stop-page-editor .html-textarea {
    min-height: min(38vh, 320px);
  }

  .field-grid,
  .add-row,
  .translation-row-content,
  .two-column {
    grid-template-columns: 1fr;
  }

  .survey-title {
    font-size: 38px;
  }

  .survey-description,
  .question-title {
    font-size: var(--text-sm);
  }

  .group-title {
    font-size: 20px;
  }
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding: 18px 0 4px;
  text-align: center;
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  justify-content: center;
  margin-bottom: 10px;
}

.site-footer-nav a {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-decoration: none;
}

.site-footer-nav a:hover {
  color: var(--brand-primary);
}

.site-footer-copy {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.recent-panel {
  margin-top: 18px;
  padding: 0;
}

.recent-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 20px;
  text-align: left;
  width: 100%;
}

.recent-head-text h1 {
  color: var(--brand-slate);
  font-size: var(--heading-md);
  line-height: 1.1;
  margin: 0;
}

.recent-head-text p {
  color: var(--muted);
  font-size: var(--text-xs);
  margin: 4px 0 0;
}

.recent-chevron {
  color: var(--brand-slate);
  flex: 0 0 auto;
  height: 20px;
  transition: transform 140ms ease;
  width: 20px;
}

.recent-toggle:hover .recent-chevron {
  color: var(--brand-primary);
}

.recent-table {
  border-collapse: collapse;
  border-top: 1px solid var(--line);
  table-layout: fixed;
  width: 100%;
}

.recent-table th,
.recent-table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: middle;
}

.recent-table th {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.recent-table tbody tr {
  border-bottom: 1px solid var(--line);
}

.recent-table tbody tr:last-child {
  border-bottom: 0;
}

.recent-table tbody tr:hover {
  background: #f9fbfd;
}

.recent-table td strong {
  color: var(--brand-slate);
  display: block;
  font-size: var(--text-xs);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-table td span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-action-cell {
  text-align: right !important;
  white-space: nowrap;
  width: 1%;
}

.landing-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding-top: 14px;
}

.landing-footer .site-footer-nav {
  justify-content: flex-start;
  margin-bottom: 0;
}

.landing-footer .site-footer-copy {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* ─── Design Agent ─────────────────────────────────────────── */

.agent-chat {
  bottom: 24px;
  position: fixed;
  right: 24px;
  z-index: 200;
}

.agent-bubble-inline {
  display: flex;
  justify-content: center;
  margin: 28px 0 16px;
  width: 100%;
}

.agent-bubble {
  align-items: center;
  background: var(--brand-primary);
  border: none;
  border-radius: 24px;
  box-shadow: 0 4px 18px rgba(0, 115, 181, 0.35);
  color: var(--brand-white);
  cursor: pointer;
  display: flex;
  font-family: var(--font-brand);
  font-size: var(--text-xs);
  font-weight: 800;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.agent-bubble:hover {
  background: var(--brand-slate);
  box-shadow: 0 6px 24px rgba(0, 115, 181, 0.42);
  transform: translateY(-2px);
}

.agent-bubble .ui-icon {
  height: 20px;
  width: 20px;
}

.agent-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  max-height: 680px;
  width: 460px;
}

.agent-panel-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  justify-content: space-between;
  padding: 14px 14px 14px 16px;
}

.agent-panel-title {
  align-items: center;
  color: var(--brand-slate);
  display: flex;
  font-size: var(--text-xs);
  font-weight: 800;
  gap: 8px;
}

.agent-panel-actions {
  align-items: center;
  display: flex;
  gap: 4px;
}

.agent-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  overflow-y: auto;
  padding: 16px;
}

.agent-welcome {
  padding: 4px 0 8px;
  text-align: center;
}

.agent-welcome p {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 14px;
}

.agent-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-suggestion {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-slate);
  cursor: pointer;
  font-family: var(--font-brand);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 8px 12px;
  text-align: left;
  transition: background 120ms ease, border-color 120ms ease;
}

.agent-suggestion:hover {
  background: var(--soft-blue);
  border-color: var(--brand-sky);
}

.agent-message {
  align-items: flex-end;
  display: flex;
  gap: 8px;
}

.agent-message-user {
  flex-direction: row-reverse;
}

.agent-message-avatar {
  align-items: center;
  background: var(--brand-primary);
  border-radius: 50%;
  color: var(--brand-white);
  display: flex;
  flex-shrink: 0;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.agent-message-avatar .ui-icon {
  height: 15px;
  width: 15px;
}

.agent-message-bubble {
  border-radius: 12px;
  font-size: var(--text-xs);
  line-height: 1.55;
  max-width: calc(100% - 40px);
  padding: 9px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent-message-assistant .agent-message-bubble {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  color: var(--brand-ink);
}

.agent-message-user .agent-message-bubble {
  background: var(--brand-primary);
  border-bottom-right-radius: 4px;
  color: var(--brand-white);
  font-weight: 700;
}

.agent-system-note {
  align-items: center;
  align-self: center;
  background: #f3eefc;
  border: 1px dashed #cebcf3;
  border-radius: 999px;
  color: #6c34c9;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  padding: 6px 12px;
  text-align: center;
}

.agent-system-note .ui-icon {
  height: 13px;
  width: 13px;
}

.agent-thinking {
  align-items: center;
  display: flex;
  gap: 4px;
  min-height: 20px;
  padding: 4px 4px !important;
}

.agent-thinking span {
  animation: agent-bounce 1.3s infinite ease-in-out;
  background: var(--muted);
  border-radius: 50%;
  display: inline-block;
  height: 6px;
  width: 6px;
}

.agent-thinking span:nth-child(2) { animation-delay: 0.2s; }
.agent-thinking span:nth-child(3) { animation-delay: 0.4s; }

@keyframes agent-bounce {
  0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.agent-input-row {
  align-items: stretch;
  border-top: 1px solid var(--line);
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  padding: 12px 14px;
}

.agent-input {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-sizing: border-box;
  color: var(--brand-ink);
  flex: 1;
  font-family: var(--font-brand);
  font-size: var(--text-xs);
  line-height: 1.5;
  min-height: 64px;
  padding: 10px 12px;
  resize: none;
}

.agent-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(0, 115, 181, 0.12);
  outline: none;
}

.agent-input:disabled {
  opacity: 0.6;
}

.agent-send-button {
  align-items: center;
  align-self: stretch;
  box-sizing: border-box;
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  justify-content: center;
  min-height: 64px;
  padding: 0 18px;
}

/* Agent-modified field indicator (coral, distinct from mint AI translation) */

.agent-modified-input {
  border-color: var(--brand-coral) !important;
  box-shadow: 0 0 0 2px rgba(248, 94, 47, 0.12);
}

.chip.agent-badge {
  align-items: center;
  background: #f3eefc;
  border-color: #cebcf3;
  color: #6c34c9;
  display: inline-flex;
  gap: 4px;
}

.chip.agent-badge .ui-icon {
  height: 12px;
  width: 12px;
}

@media (max-width: 640px) {
  .agent-panel {
    max-height: 520px;
    width: calc(100vw - 32px);
  }
  .agent-chat {
    bottom: 16px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .workspace {
    padding: 10px;
  }

  .main-panel {
    padding: 12px;
  }

  .stop-page-editor .ck-editor__editable,
  .stop-page-editor .ck-source-editing-area textarea {
    min-height: min(38vh, 320px);
  }
}

/* ============================================================
   Publish button & modal
   ============================================================ */

.publish-button {
  flex-shrink: 0;
}

.publish-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.publish-modal-panel {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  max-width: 800px;
  overflow: hidden;
  width: min(800px, 100%);
}

.publish-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 0 4px;
}

.publish-modal-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 14px;
}

.publish-footer-spinner {
  align-items: center;
  display: flex;
  margin-right: auto;
}

.publish-footer-spinner .auth-status-spinner {
  border-width: 2px;
  height: 16px;
  margin: 0;
  width: 16px;
}

.publish-state-block {
  padding: 4px 0 2px;
}

.publish-state-centered {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
  text-align: center;
}

.publish-state-centered .publish-icon {
  flex-shrink: 0;
}

.publish-state-centered .publish-changelog,
.publish-state-centered .publish-progress {
  text-align: left;
  width: 100%;
}

.publish-state-centered .publish-changelog {
  align-self: stretch;
}

.publish-spinner-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.publish-progress-left {
  text-align: left;
}

.publish-state-title {
  font-size: var(--text-sm);
  font-weight: 800;
  margin: 0 0 8px;
}

.publish-summary {
  font-size: var(--text-xs);
  margin-bottom: 4px;
}

.publish-progress {
  margin: 10px 0 4px;
}

.publish-icon {
  align-items: center;
  border-radius: 50%;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  margin-bottom: 10px;
  width: 44px;
}

.publish-icon .ui-icon {
  height: 22px;
  width: 22px;
}

.publish-icon-ok {
  background: #dff4e9;
  color: #1a7f3c;
}

.publish-icon-warn {
  background: #fff8e5;
  color: #b45309;
}

.publish-icon-error {
  background: #fee2e2;
  color: #b91c1c;
}

.publish-out-of-sync-list {
  font-size: var(--text-xs);
  margin: 8px 0;
  padding-left: 18px;
}

.publish-out-of-sync-list li {
  margin-bottom: 4px;
}

.publish-note {
  color: var(--muted);
  font-size: var(--text-xs);
  margin-top: 10px;
}

.publish-changelog {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 14px;
  overflow: hidden;
}

.publish-changelog-toggle {
  align-items: center;
  background: none;
  border: 0;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  font-size: var(--text-xs);
  font-weight: 700;
  gap: 8px;
  justify-content: space-between;
  padding: 9px 12px;
  text-align: left;
  width: 100%;
}

.publish-changelog-toggle:hover {
  background: #f7f9fb;
}

.publish-changelog-list {
  border-top: 1px solid var(--line);
  max-height: 300px;
  overflow-y: auto;
}

.publish-changelog-table {
  border-collapse: collapse;
  font-size: var(--text-xs);
  width: 100%;
}

.publish-changelog-table thead th {
  background: #f7f9fb;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.publish-changelog-table tbody tr {
  border-bottom: 1px solid var(--line);
}

.publish-changelog-table tbody tr:last-child {
  border-bottom: 0;
}

.publish-changelog-table tbody tr.row-done {
  background: #f9fefb;
}

.publish-changelog-table tbody tr.row-error {
  background: #fff8f8;
}

.publish-changelog-table td {
  padding: 6px 10px;
  vertical-align: middle;
}

.publish-changelog-table .col-entity {
  max-width: 260px;
}

.publish-entity-type {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.publish-item-label {
  display: block;
  font-size: var(--text-xs);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publish-changelog-table .col-operation {
  white-space: nowrap;
  width: 90px;
}

.publish-changelog-table .col-changes {
  min-width: 120px;
}

.publish-changelog-table .col-changes > * {
  display: inline-block;
  margin: 1px 2px;
}

.publish-changelog-table .col-status {
  white-space: nowrap;
  width: 80px;
}

.publish-changes-new {
  background: #e0eaff;
  border: 1px solid #b4c9ff;
  border-radius: 4px;
  color: #1e40af;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
}

.publish-changes-delete {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  color: #b91c1c;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
}

.publish-changes-empty {
  color: var(--muted);
}

.publish-change-tag {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  color: #475569;
  font-size: 10px;
  padding: 1px 5px;
  white-space: nowrap;
}

.chip.chip-create {
  background: #dff4e9;
  border-color: #a7e3c0;
  color: #1a7f3c;
  white-space: nowrap;
}

.chip.chip-update {
  background: #e0eaff;
  border-color: #b4c9ff;
  color: #1e40af;
  white-space: nowrap;
}

.chip.chip-done {
  background: #dff4e9;
  border-color: #a7e3c0;
  color: #1a7f3c;
}

.chip.chip-error {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.chip.chip-pending {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

.chip.chip-delete {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
  white-space: nowrap;
}

.chip.chip-upload {
  background: #f3e8ff;
  border-color: #d8b4fe;
  color: #7e22ce;
  white-space: nowrap;
}

.publish-error-toggle {
  cursor: pointer;
  font-size: inherit;
  line-height: inherit;
}

.publish-error-detail-row td {
  padding: 0;
}

.publish-error-detail {
  background: #fff8f8;
  border-top: 1px solid #fca5a5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
}

.publish-error-summary {
  color: #b91c1c;
  font-size: var(--text-xs);
  font-weight: 600;
}

.publish-error-body {
  background: #1e1e1e;
  border-radius: 5px;
  color: #f8f8f2;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.5;
  margin: 0;
  max-height: 200px;
  overflow: auto;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

.publish-state-centered .publish-changelog-table {
  text-align: left;
}

.publish-state-centered .publish-changelog-table th,
.publish-state-centered .publish-changelog-table td {
  text-align: left;
}

.flow-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flow-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.flow-toolbar-info {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.flow-panel-title {
  margin: 0;
}

.flow-toolbar-meta {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
}

.flow-legend {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.flow-legend-item {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: var(--text-xs);
  font-weight: 700;
  gap: 6px;
}

.flow-legend-swatch {
  border-radius: 2px;
  display: inline-block;
  height: 3px;
  width: 22px;
}

.flow-legend-sequence {
  background: var(--line);
}

.flow-legend-jump {
  background: var(--brand-coral);
}

.flow-canvas {
  background: linear-gradient(180deg, var(--soft-blue) 0%, var(--surface) 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: calc(100vh - var(--sticky-offset) - 160px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px;
  position: relative;
}

.flow-nodes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 680px;
  position: relative;
  z-index: 1;
}

.flow-edges {
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.85));
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.flow-edge {
  transition: stroke-width 0.15s ease;
}

.flow-edge.is-selected {
  filter: drop-shadow(0 0 4px rgba(248, 94, 47, 0.4));
}

.flow-node {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(38, 40, 40, 0.02);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.flow-node.is-editor-source {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(0, 115, 181, 0.12);
}

.flow-node-head {
  align-items: center;
  display: flex;
  gap: 10px;
}

.flow-node-index {
  align-items: center;
  background: var(--soft-blue);
  border-radius: 50%;
  color: var(--brand-primary);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: var(--text-xs);
  font-weight: 800;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.flow-node-icon {
  color: var(--brand-slate);
  display: inline-flex;
  flex: 0 0 auto;
}

.flow-node-titles {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.flow-node-group {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.flow-node-title {
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-add-jump-button {
  flex: 0 0 auto;
}

.flow-jump-list {
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 -4px -4px;
  padding: 6px 4px 0;
}

.flow-jump-row {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 6px 8px;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.flow-jump-row:hover {
  background: rgba(0, 115, 181, 0.06);
}

.flow-jump-row.selected {
  background: rgba(248, 94, 47, 0.07);
  border-color: rgba(248, 94, 47, 0.35);
}

.flow-jump-row-line {
  align-items: center;
  display: flex;
  font-size: var(--text-xs);
  font-weight: 700;
  gap: 6px;
  grid-column: 1;
  min-width: 0;
}

.flow-jump-arrow {
  color: var(--brand-coral);
  font-weight: 900;
}

.flow-jump-target {
  color: var(--brand-slate);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-jump-conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  grid-column: 1;
  min-width: 0;
}

.flow-condition-chip {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand-slate);
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  gap: 4px;
  padding: 2px 8px;
}

.flow-condition-criteria {
  color: var(--brand-primary);
  font-weight: 800;
}

.flow-condition-value {
  color: var(--text);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-condition-empty {
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
}

.flow-jump-actions {
  display: flex;
  gap: 2px;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.flow-sequence-connector {
  align-items: center;
  display: flex;
  height: 18px;
  justify-content: flex-start;
  margin-left: 13px;
  padding-left: 12px;
  position: relative;
}

.flow-sequence-connector span {
  background: var(--line);
  border-radius: 2px;
  height: 100%;
  width: 2px;
}

.flow-empty {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 40px 20px;
  text-align: center;
}

.flow-empty-title {
  font-size: var(--text-md);
  font-weight: 800;
  margin: 0;
}

.flow-empty-sub {
  color: var(--muted);
  font-size: var(--text-xs);
  margin: 0;
}

.flow-jump-editor-panel {
  max-width: 640px;
  width: min(640px, 100%);
}

.flow-jump-editor-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flow-jump-editor-source {
  align-items: center;
  background: var(--soft-blue);
  border: 1px solid #cfe7f3;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  font-weight: 700;
  gap: 8px;
  padding: 8px 10px;
}

.flow-jump-editor-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flow-conditions-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-conditions-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.flow-conditions-head .panel-title {
  font-size: var(--text-sm);
  margin: 0;
}

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

.flow-condition-row {
  align-items: center;
  background: #fafcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1.4fr) auto;
  padding: 8px;
}

.flow-condition-criteria-field,
.flow-condition-value-field {
  min-width: 0;
}

.flow-condition-criteria-field select,
.flow-condition-value-field select,
.flow-condition-value-field input {
  appearance: none;
  background: #fbfcfe;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366737f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 36px;
  padding: 8px 32px 8px 10px;
  width: 100%;
}

.flow-condition-value-field input {
  background-image: none;
  padding-right: 10px;
}

.flow-condition-criteria-field select:focus,
.flow-condition-value-field select:focus,
.flow-condition-value-field input:focus {
  border-color: var(--brand-primary);
  outline: none;
}

.flow-condition-novalue {
  color: var(--muted);
  font-size: var(--text-xs);
  font-style: italic;
}

.flow-conditions-empty {
  color: var(--muted);
  font-size: var(--text-xs);
  margin: 0;
}

.flow-conditions-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

.flow-jump-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

.flow-jump-editor-panel .wide-field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366737f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  padding-right: 32px;
}

.flow-toolbar-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.flow-show-disabled-toggle {
  align-items: center;
  color: var(--brand-slate);
  display: inline-flex;
  font-size: var(--text-xs);
  font-weight: 700;
  gap: 6px;
  margin: 0;
}

.flow-node-meta {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.flow-node-chip-disabled {
  background: #f3f4f6;
  border-color: #d4d8de;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flow-node-chip-info {
  background: var(--soft-blue);
  border-color: #cfe7f3;
  color: var(--brand-primary);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flow-node-disabled {
  background: #f7f8fa;
  border-style: dashed;
}

.flow-node-disabled .flow-node-title,
.flow-node-disabled .flow-node-group,
.flow-node-disabled .flow-node-icon {
  color: var(--muted);
}

.flow-node-disabled .flow-node-index {
  background: #eef0f4;
  color: var(--muted);
}

.flow-node-jump-disabled {
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
  padding: 4px 8px;
}

.flow-node-enabled-toggle {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0;
  margin: 0;
  padding: 0;
}

.flow-node-disabled .flow-node-enabled-toggle {
  opacity: 1;
}

.flow-jump-row.confirm-remove {
  background: #fff5f4;
  border-color: #ffd1cb;
}

.remove-jump-button {
  transition: color 140ms, border-color 140ms, background 140ms, width 140ms;
}

.remove-jump-button.confirming {
  aspect-ratio: auto;
  background: #fff5f4;
  border-color: #ffd1cb;
  color: #b5362e;
  font-weight: 800;
  width: auto;
}

.remove-jump-button.confirming span {
  display: flex;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .flow-condition-row {
    grid-template-columns: 1fr;
  }
  .flow-condition-row > .icon-button {
    justify-self: end;
    width: 34px;
  }
  .flow-jump-actions {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-end;
  }
  .flow-jump-row {
    grid-template-columns: 1fr;
  }
}
