:root {
  --primary: #18a058;
  --primary-dark: #0f7a43;
  --brand-dark: #0f172a;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1a1b23;
  --muted: #64748b;
  --soft-blue: #ecfdf3;
  --soft-green: #ecfdf5;
  --soft-amber: #fffbeb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(24, 160, 88, 0.24);
  outline-offset: 2px;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 0 28px;
}

.brand {
  min-height: 76px;
  padding: 0 16px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
}

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

.brand h1 {
  margin: 0;
  color: var(--primary);
  font-size: 20px;
  font-weight: 900;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.sidebar-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.sidebar-toggle:hover {
  color: var(--primary);
  border-color: #a7e0bd;
  background: #ecfdf3;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav a,
.nav button {
  min-height: 46px;
  padding: 0 16px;
  color: #475569;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  border-right: 4px solid transparent;
  font-size: 13px;
  font-weight: 700;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  text-align: left;
}

.nav-label {
  white-space: nowrap;
}

.nav a.active,
.nav button.active {
  color: var(--primary);
  background: var(--soft-blue);
  border-right-color: var(--primary);
}

.nav a:hover,
.nav button:hover {
  background: #f8fafc;
}

.nav a.active:hover,
.nav button.active:hover {
  color: var(--primary);
  background: var(--soft-blue);
  border-right-color: var(--primary);
}

.sidebar-account {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 12px;
}

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

.account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #ecfdf3;
  color: var(--primary);
}

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

.account-copy strong {
  display: block;
  color: var(--brand-dark);
  font-size: 13px;
  line-height: 1.25;
}

.account-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.logout-btn {
  width: 100%;
}

.sidebar-collapsed .brand {
  padding: 0 10px 18px;
  align-items: center;
  justify-content: center;
}

.sidebar-collapsed .brand-copy {
  display: none;
}

.sidebar-collapsed .sidebar-toggle {
  width: 42px;
  height: 42px;
}

.sidebar-collapsed .nav {
  padding: 0 8px;
}

.sidebar-collapsed .nav button {
  min-height: 50px;
  padding: 0;
  justify-content: center;
  gap: 0;
  border-right: 0;
  border-radius: 12px;
}

.sidebar-collapsed .nav button.active {
  border-right-color: transparent;
  background: var(--soft-blue);
}

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

.sidebar-collapsed .sidebar-account {
  padding: 12px 8px;
}

.sidebar-collapsed .sidebar-account-user {
  justify-content: center;
}

.sidebar-collapsed .account-copy,
.sidebar-collapsed .logout-label {
  display: none;
}

.sidebar-collapsed .logout-btn {
  width: 44px;
  min-height: 44px;
  padding: 0;
  justify-self: center;
}

.main {
  min-width: 0;
  background: var(--bg);
}

.workspace-topbar {
  min-height: 78px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.72);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.82));
  backdrop-filter: blur(18px) saturate(1.22);
  -webkit-backdrop-filter: blur(18px) saturate(1.22);
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.05);
}

.workspace-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 14px 4px 13px 0;
}

.workspace-tabs::-webkit-scrollbar {
  display: none;
}

.workspace-tab {
  position: relative;
  min-width: 116px;
  min-height: 50px;
  padding: 0;
  display: inline-grid;
  align-items: center;
  justify-items: center;
  border: 1px solid transparent;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.4);
  flex: 0 0 auto;
  overflow: hidden;
  isolation: isolate;
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.workspace-tab::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  pointer-events: none;
  z-index: -1;
}

.workspace-tab::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 5px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 180ms ease, transform 180ms ease;
}

.workspace-tab:hover {
  color: #334155;
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(24, 160, 88, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 10px 24px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.workspace-tab.active {
  color: var(--primary);
  border-color: rgba(24, 160, 88, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(236, 253, 243, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -10px 24px rgba(24, 160, 88, 0.07),
    0 14px 30px rgba(24, 160, 88, 0.12);
}

.workspace-tab.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.workspace-tab-main {
  width: 100%;
  min-height: 36px;
  padding: 0 38px 2px;
  border: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.workspace-tab.active .workspace-tab-main {
  font-weight: 900;
}

.workspace-tab-close {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: inherit;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.82);
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.workspace-tab:hover .workspace-tab-close,
.workspace-tab:focus-within .workspace-tab-close {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.workspace-tab-close:hover {
  background: rgba(236, 253, 243, 0.94);
  color: var(--primary);
  box-shadow:
    inset 0 0 0 1px rgba(24, 160, 88, 0.16),
    0 8px 18px rgba(24, 160, 88, 0.12);
  transform: translateY(-50%) scale(1) rotate(90deg);
}

.workspace-tab-close .material-symbols-outlined {
  font-size: 16px;
  line-height: 1;
}

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

.workspace-actions .icon-btn {
  color: #64748b;
}

.account-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.account-menu-trigger.active {
  color: var(--primary);
  background: rgba(236, 253, 243, 0.95);
  box-shadow:
    inset 0 0 0 1px rgba(24, 160, 88, 0.18),
    0 10px 22px rgba(24, 160, 88, 0.12);
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 220px;
  padding: 12px;
  border: 1px solid rgba(187, 247, 208, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow:
    0 22px 48px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  z-index: 40;
  animation: accountMenuIn 160ms ease-out;
}

.account-menu-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 16px;
  width: 12px;
  height: 12px;
  border-left: 1px solid rgba(187, 247, 208, 0.92);
  border-top: 1px solid rgba(187, 247, 208, 0.92);
  background: rgba(255, 255, 255, 0.96);
  transform: rotate(45deg);
}

.account-menu-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.account-menu-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--primary);
  background: rgba(236, 253, 243, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.account-menu-avatar .material-symbols-outlined {
  font-size: 24px;
}

.account-menu-user span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.account-menu-user strong {
  display: block;
  margin-top: 2px;
  color: var(--brand-dark);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 900;
}

.account-menu-logout {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  color: #0f172a;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 900;
}

.account-menu-logout:hover {
  color: var(--primary);
  border-color: rgba(24, 160, 88, 0.28);
  background: rgba(236, 253, 243, 0.9);
  box-shadow: 0 10px 20px rgba(24, 160, 88, 0.1);
}

@keyframes accountMenuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.create-survey-btn {
  min-width: 112px;
  min-height: 42px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(24, 160, 88, 0.14), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #ecfdf3 100%);
}

.login-panel {
  width: min(430px, 100%);
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
}

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

.login-brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
}

.login-brand strong {
  display: block;
  color: var(--primary);
  font-size: 20px;
  font-weight: 900;
}

.login-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.login-copy h1 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 28px;
  line-height: 1.25;
  font-weight: 900;
}

.login-copy p {
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.login-form {
  display: grid;
  gap: 16px;
}

.auth-loading-panel {
  display: grid;
  gap: 14px;
}

.topbar {
  height: 64px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 18px;
  font-weight: 800;
}

.topbar-tabs {
  display: flex;
  gap: 24px;
}

.topbar-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  min-height: 44px;
  border-bottom: 2px solid transparent;
}

.topbar-tabs button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 800;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.page-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.35;
  font-weight: 800;
  color: var(--brand-dark);
}

.page-desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.btn {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.btn:hover {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-danger {
  color: var(--danger);
  border-color: #fecaca;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.toolbar {
  padding: 16px;
  display: grid;
  grid-template-columns: 180px minmax(220px, 1fr) auto;
  gap: 16px;
  margin-bottom: 16px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  color: var(--text);
}

.textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

.custom-dropdown {
  position: relative;
  width: 100%;
}

.custom-dropdown-trigger {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  font-weight: 700;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.custom-dropdown-trigger:disabled {
  cursor: not-allowed;
  color: #94a3b8;
  background: #f8fafc;
}

.custom-dropdown-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-dropdown-trigger.placeholder {
  color: #94a3b8;
}

.custom-dropdown.open .custom-dropdown-trigger,
.custom-dropdown-trigger:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(24, 160, 88, 0.12);
}

.custom-dropdown-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  max-height: 232px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.custom-dropdown-option {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  text-align: left;
  font-weight: 700;
}

.custom-dropdown-option:hover,
.custom-dropdown-option:focus-visible {
  background: #ecfdf3;
  color: var(--primary);
}

.custom-dropdown-option.selected {
  background: var(--primary);
  color: #fff;
}

.custom-dropdown-option.placeholder {
  color: #94a3b8;
}

.custom-dropdown-option:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.custom-dropdown-empty {
  padding: 12px 10px;
  color: #64748b;
  font-weight: 700;
}

.status-inline-select {
  position: relative;
  display: inline-flex;
  justify-content: center;
}

.status-clickable {
  border: 0;
  cursor: pointer;
  min-height: 32px;
  padding: 0 16px;
  box-shadow: 0 0 0 1px transparent;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.status-clickable:hover,
.status-clickable:focus-visible {
  box-shadow: 0 0 0 3px rgba(24, 160, 88, 0.14);
  outline: none;
  transform: translateY(-1px);
}

.status-clickable:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.status-inline-menu {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  z-index: 80;
  min-width: 136px;
  transform: translateX(-50%);
  padding: 8px;
  border: 1px solid rgba(187, 247, 208, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(14px);
}

.status-inline-option {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8px;
  cursor: pointer;
}

.status-inline-option:hover,
.status-inline-option:focus-visible {
  background: #ecfdf3;
  outline: none;
}

.status-inline-option .material-symbols-outlined {
  color: var(--primary);
  font-size: 18px;
}

.survey-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.survey-actions .btn {
  min-height: 40px;
  white-space: nowrap;
}

.survey-actions .btn-danger.confirming {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.multi-tag-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.multi-tag-trigger {
  min-height: 42px;
  min-width: 0;
}

.multi-tag-trigger-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-tag-trigger-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.multi-tag-count {
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #dcfce7;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.multi-tag-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(187, 247, 208, 0.94);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(14px);
}

.multi-tag-option {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.multi-tag-option:hover,
.multi-tag-option:focus-visible {
  background: #ecfdf3;
  outline: none;
}

.multi-tag-option.selected {
  background: #f0fdf4;
}

.multi-tag-check {
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #fff;
}

.multi-tag-check .material-symbols-outlined {
  font-size: 16px;
  font-weight: 900;
}

.multi-tag-option-pill {
  max-width: calc(100% - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-tag-menu-state {
  padding: 12px 10px;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
}

.error-text {
  color: #dc2626;
}

.multi-tag-menu-footer {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 900;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}

.link-button:hover,
.link-button:focus-visible {
  background: #ecfdf3;
  outline: none;
}

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

.pagination-bar {
  min-width: 860px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
}

.pagination-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.pagination-summary strong {
  color: var(--brand-dark);
  font-size: 14px;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-size {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pagination-size .custom-dropdown {
  width: 112px;
}

.pagination-size .custom-dropdown-trigger {
  min-height: 36px;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 13px;
}

.pagination-size .custom-dropdown-menu {
  top: auto;
  bottom: calc(100% + 8px);
}

.paged-table-shell {
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  min-height: 420px;
  overflow: hidden;
}

.paged-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.survey-table-shell .paged-table-scroll {
  position: relative;
  min-height: 606px;
}

.paged-table-scroll .table {
  min-width: 100%;
}

.paged-table-scroll .table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
}

.paged-table-shell .pagination-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.04);
  flex: 0 0 auto;
}

.table-spacer-row td {
  height: 84px;
  padding: 0;
  background: #fff;
  border-bottom: 1px solid rgba(226, 232, 240, 0.42);
}

.table-empty-row td {
  height: 520px;
  padding: 0;
  text-align: center;
  background: #fff;
}

.table-empty-state {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
}

.table-empty-state .material-symbols-outlined {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  background: #ecfdf3;
}

.table-empty-state strong {
  color: var(--brand-dark);
  font-size: 16px;
}

.table-loading-overlay {
  position: absolute;
  inset: 52px 0 0;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.72), rgba(248, 250, 252, 0.08) 36%, rgba(248, 250, 252, 0));
}

.table-loading-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 999px;
  color: var(--brand);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  font-size: 13px;
  font-weight: 800;
}

.table-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  animation: tableLoadingPulse 900ms ease-in-out infinite;
}

.table-inline-error {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: 12px;
  color: #991b1b;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
  font-size: 13px;
  font-weight: 700;
}

@keyframes tableLoadingPulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

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

.table th,
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.table th {
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.table tr:hover td {
  background: #fbfdff;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.tag-blue {
  color: var(--primary);
  background: var(--soft-blue);
}

.tag-ended {
  gap: 5px;
  color: #64748b;
  background: #f1f5f9;
}

.tag-ended::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #94a3b8;
  flex: 0 0 auto;
}

.tag-green {
  color: #047857;
  background: var(--soft-green);
}

.tag-amber {
  color: #b45309;
  background: var(--soft-amber);
}

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

.empty,
.error,
.success-panel,
.loading {
  padding: 28px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  color: var(--muted);
}

.error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
}

.skeleton {
  display: block;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e2e8f0, #f8fafc, #e2e8f0);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.admin-page {
  max-width: none;
  margin: 0;
}

.admin-hero {
  padding: 18px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 90% 10%, rgba(24, 160, 88, 0.12), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.overview-dashboard {
  display: grid;
  gap: 20px;
}

.overview-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.overview-header h1 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 900;
}

.overview-header p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.overview-header-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.overview-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.overview-metric-card {
  position: relative;
  min-height: 198px;
  padding: 20px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: space-between;
  gap: 18px;
  overflow: hidden;
  border-color: rgba(148, 163, 184, 0.26);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.overview-metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--metric-accent, var(--primary));
}

.overview-metric-card.blue {
  --metric-accent: #2563eb;
  --metric-soft: #eff6ff;
  --metric-text: #1d4ed8;
}

.overview-metric-card.green {
  --metric-accent: #16a34a;
  --metric-soft: #ecfdf5;
  --metric-text: #15803d;
}

.overview-metric-card.amber {
  --metric-accent: #f59e0b;
  --metric-soft: #fffbeb;
  --metric-text: #b45309;
}

.overview-metric-card.purple {
  --metric-accent: #8b5cf6;
  --metric-soft: #f5f3ff;
  --metric-text: #7c3aed;
}

.overview-metric-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.overview-metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--metric-text);
  background: var(--metric-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.overview-metric-icon.blue {
  color: #1d4ed8;
  background: #eff6ff;
}

.overview-metric-icon.green {
  color: #15803d;
  background: #ecfdf5;
}

.overview-metric-icon.amber {
  color: #b45309;
  background: #fffbeb;
}

.overview-metric-icon.purple {
  color: #7c3aed;
  background: #f5f3ff;
}

.overview-yesterday {
  width: 136px;
  max-width: 48%;
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--metric-soft);
  color: var(--metric-text);
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.14);
}

.overview-yesterday span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.overview-yesterday strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
  line-height: 1;
  font-weight: 900;
}

.overview-metric-copy p {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
}

.overview-metric-copy strong {
  color: #0f172a;
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
}

.overview-metric-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #eef2f7;
}

.overview-metric-breakdown span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.overview-metric-breakdown em {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-metric-breakdown b {
  overflow: hidden;
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.overview-trend-card,
.overview-operation-card {
  padding: 24px;
}

.overview-trend-card {
  position: relative;
  overflow: hidden;
}

.overview-panel-head,
.operation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.overview-panel-head h2,
.operation-head h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 900;
}

.overview-panel-head p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.overview-trend-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.overview-trend-summary span {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #cfe9da;
  border-radius: 999px;
  background: #f7fffa;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}

.overview-trend-summary b {
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 900;
}

.overview-bars {
  min-height: 340px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: clamp(14px, 2.2vw, 28px);
  padding: 28px 10px 4px;
  border-radius: 18px;
  background:
    linear-gradient(to top, rgba(226, 232, 240, 0.7) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(180deg, rgba(248, 250, 252, 0.42), rgba(255, 255, 255, 0)),
    #fff;
}

.overview-bar-item {
  display: grid;
  grid-template-rows: 24px 1fr 22px;
  gap: 10px;
  justify-items: center;
  min-width: 0;
  position: relative;
}

.overview-bar-value {
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  color: #0f7a43;
  background: rgba(232, 247, 239, 0.92);
  border: 1px solid rgba(24, 160, 88, 0.16);
  opacity: 0;
  transform: translateY(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  transition: opacity 160ms ease, transform 160ms ease;
}

.overview-bar-track {
  position: relative;
  width: min(42px, 58%);
  height: 250px;
  border-radius: 999px;
  background: transparent;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.overview-bar-track::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.5), rgba(226, 232, 240, 0.72));
  border: 1px solid rgba(203, 213, 225, 0.62);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 160ms ease, background 160ms ease;
}

.overview-bar-item.has-value .overview-bar-track::before {
  opacity: 1;
}

.overview-bar-item.is-empty .overview-bar-track::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #dbe4f0;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
  transform: translateX(-50%);
}

.overview-bar-track span {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-height: 0;
  transition: height 220ms ease;
}

.overview-bar-track .done {
  background: linear-gradient(180deg, #22c55e 0%, #0f7a43 100%);
  border-radius: 999px;
  box-shadow:
    0 -10px 24px rgba(24, 160, 88, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.overview-bar-item.is-peak .overview-bar-track {
  width: min(48px, 64%);
}

.overview-bar-item.is-peak .overview-bar-track::before {
  background: linear-gradient(180deg, rgba(236, 253, 243, 0.88), rgba(209, 250, 229, 0.9));
  border-color: rgba(24, 160, 88, 0.18);
}

.overview-bar-item.is-peak .overview-bar-value {
  opacity: 1;
  transform: translateY(0);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(24, 160, 88, 0.12);
}

.overview-bar-item:hover .overview-bar-value {
  opacity: 1;
  transform: translateY(0);
}

.overview-bar-item:hover .overview-bar-track {
  filter: saturate(1.08);
}

.overview-bar-item:hover .overview-bar-track::before {
  opacity: 1;
  background: linear-gradient(180deg, rgba(236, 253, 243, 0.78), rgba(226, 232, 240, 0.62));
}

.overview-bar-item small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.operation-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.operation-tabs button {
  min-height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
}

.operation-tabs button.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.operation-table {
  min-width: 920px;
}

.operation-object {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.operation-object strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.operation-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.operation-icon.blue {
  color: #18a058;
  background: #e8f7ef;
}

.operation-icon.purple {
  color: #9333ea;
  background: #f7edff;
}

.status-pill {
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.success {
  background: #dcfce7;
  color: #16a34a;
}

.status-pill.processing {
  background: #e2e8f0;
  color: #475569;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.metric-card {
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 138px;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: #ecfdf3;
  flex: 0 0 auto;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--brand-dark);
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
}

.metric-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 16px;
}

.span-2 {
  grid-column: span 2;
}

.panel-card {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 16px;
  font-weight: 900;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.trend-bars {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding-top: 8px;
}

.trend-item {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.trend-track {
  height: 178px;
  border-radius: 12px;
  background: #f1f5f9;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
  padding: 8px 0;
}

.trend-track span {
  width: 12px;
  border-radius: 999px 999px 4px 4px;
  min-height: 6px;
}

.trend-track .users {
  background: var(--primary);
}

.trend-track .responses {
  background: var(--success);
}

.trend-item small {
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

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

.compact-row,
.task-row {
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfdff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact-row strong,
.task-row strong {
  display: block;
  color: var(--brand-dark);
  font-size: 14px;
}

.compact-row span,
.task-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.compact-row b,
.task-count b {
  color: var(--primary);
  font-size: 18px;
}

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

.admin-table {
  min-width: 760px;
}

.admin-toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
}

.admin-toolbar > .field:first-child {
  flex: 1 1 240px;
}

.admin-toolbar > .field:nth-child(2) {
  flex: 1 1 320px;
  max-width: 520px;
}

.admin-toolbar > .toolbar-actions {
  flex: 0 0 auto;
}

.tag-detail-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
}

.users-return-bar {
  min-height: 52px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.users-return-bar > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tag-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.tag-detail-actions > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.batch-selection-bar {
  min-height: 52px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, #f8fffb 0%, #fff 100%);
}

.batch-selection-bar.compact {
  min-height: 0;
  justify-content: flex-end;
  background: #fff;
}

.batch-selection-bar strong {
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 900;
}

.batch-selection-bar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.batch-selection-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-danger.confirming {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.select-col {
  width: 54px;
  text-align: center;
}

.select-col input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.link-count-button {
  border: 0;
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--primary);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.link-count-button:hover,
.link-count-button:focus-visible {
  background: #dcfce7;
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.14);
  outline: none;
  transform: translateY(-1px);
}

.survey-response-count {
  min-width: 40px;
  font-size: 15px;
}

.user-response-return-bar {
  align-items: center;
}

.user-response-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.user-response-summary strong {
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 900;
}

.user-response-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.user-response-table {
  min-width: 860px;
}

.user-response-table th:last-child,
.user-response-table td:last-child {
  width: 150px;
  min-width: 150px;
  text-align: center;
}

.user-response-actions {
  white-space: nowrap;
}

.toolbar-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  min-width: max-content;
}

.user-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.admin-state {
  margin-bottom: 16px;
}

.tag-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.user-tags-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 180px;
}

.user-tags-cell .tag-list {
  min-width: 0;
}

.user-delete-btn {
  min-width: 40px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fff;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.user-delete-btn:hover {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #e11d48;
}

.user-delete-btn.confirming {
  min-width: 58px;
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.user-delete-btn:disabled {
  cursor: not-allowed;
  color: #cbd5e1;
  background: #f8fafc;
  border-color: transparent;
}

.user-delete-btn .material-symbols-outlined {
  font-size: 20px;
}

.user-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.user-detail-btn {
  width: 40px;
  height: 36px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.user-detail-btn:hover {
  background: #dbeafe;
  border-color: #bfdbfe;
}

.user-detail-btn:disabled {
  cursor: not-allowed;
  color: #cbd5e1;
  background: #f8fafc;
  border-color: transparent;
}

.user-detail-btn .material-symbols-outlined {
  font-size: 20px;
}

.tag-overflow-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 3;
}

.tag-overflow-wrap:hover,
.tag-overflow-wrap:focus-within {
  z-index: 30;
}

.tag-overflow-trigger {
  min-width: 38px;
  justify-content: center;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: var(--primary);
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.tag-overflow-trigger:hover,
.tag-overflow-trigger:focus-visible {
  border-color: #16a34a;
  background: #dcfce7;
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.16);
  outline: none;
  transform: translateY(-1px);
}

.tag-overflow-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: max-content;
  min-width: 220px;
  max-width: 360px;
  padding: 12px;
  border: 1px solid rgba(187, 247, 208, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top left;
  transition: opacity 160ms ease, transform 160ms ease;
}

.tag-overflow-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 16px;
  width: 10px;
  height: 10px;
  border-left: 1px solid rgba(187, 247, 208, 0.92);
  border-top: 1px solid rgba(187, 247, 208, 0.92);
  background: rgba(255, 255, 255, 0.96);
  transform: rotate(45deg);
}

.tag-overflow-wrap:hover .tag-overflow-popover,
.tag-overflow-wrap:focus-within .tag-overflow-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.tag-overflow-title {
  display: block;
  margin-bottom: 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

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

.tag-overflow-pill {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-tag-edit-btn {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  color: #94a3b8;
}

.user-tag-edit-btn .material-symbols-outlined {
  font-size: 19px;
}

.user-tag-edit-btn:hover {
  color: var(--primary);
  background: #ecfdf3;
}

.tag-management-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.tag-form-card {
  padding: 18px;
  position: sticky;
  top: 88px;
}

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

.tag-form-head h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 20px;
  font-weight: 900;
}

.tag-form-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.tag-form-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: #ecfdf3;
  flex: 0 0 auto;
}

.tag-search-toolbar {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.color-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, 24px);
  gap: 10px;
  width: 100%;
  align-items: center;
  justify-content: start;
}

.tag-color-field {
  width: 100%;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border: 2px solid transparent;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 6px 14px rgba(15, 23, 42, 0.12);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.color-swatch:hover {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42), 0 10px 22px rgba(15, 23, 42, 0.18);
  transform: translateY(-1px);
}

.color-swatch:focus-visible {
  outline: 3px solid rgba(24, 160, 88, 0.24);
  outline-offset: 3px;
}

.color-swatch.active {
  border-color: #0f172a;
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45), 0 12px 26px rgba(15, 23, 42, 0.22);
}

.color-swatch .material-symbols-outlined {
  font-size: 16px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.16);
}

.inline-success {
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  background: #f0fdf4;
  color: #15803d;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

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

.tag-card {
  padding: 18px;
  display: grid;
  align-content: start;
  border-top: 4px solid var(--primary);
}

.tag-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand-dark);
}

.tag-card-head strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.tag-card-head .material-symbols-outlined {
  color: currentColor;
}

.tag-delete-btn {
  width: 38px;
  height: 38px;
  border: 1px solid #fee2e2;
  border-radius: 12px;
  background: #fff7f7;
  color: #ef4444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.tag-delete-btn:hover {
  background: #fee2e2;
  border-color: #fecaca;
  transform: translateY(-1px);
}

.tag-delete-btn.confirming {
  width: 58px;
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.tag-delete-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.tag-delete-btn .material-symbols-outlined {
  font-size: 20px;
}

.tag-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tag-emoji {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 22px;
  flex: 0 0 auto;
}

.tag-color-pill {
  border: 1px solid currentColor;
}

.tag-emoji-empty {
  background: #ecfdf3;
  color: var(--primary);
}

.tag-emoji .material-symbols-outlined {
  color: inherit;
}

.tag-meta-line {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tag-description {
  min-height: 42px;
  margin: 14px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.6;
}

.tag-card-metrics {
  margin: 18px 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.tag-card-metrics span {
  min-height: 70px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
  display: grid;
  align-content: center;
  gap: 4px;
}

.tag-card-metrics b {
  color: var(--brand-dark);
  font-size: 24px;
}

.push-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.wide-btn {
  width: 100%;
}

.inline-error {
  padding: 12px;
  margin-bottom: 14px;
  display: block;
  text-align: left;
}

.task-list {
  max-height: 560px;
  overflow: auto;
  padding-right: 2px;
}

.task-row {
  align-items: flex-start;
}

.task-count {
  min-width: 92px;
  text-align: right;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .workspace-topbar {
    gap: 14px;
    padding: 0 18px;
  }

  .workspace-tabs {
    gap: 16px;
  }

  .metric-grid,
  .overview-metric-grid,
  .tag-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .overview-main-grid,
  .tag-management-layout,
  .push-layout {
    grid-template-columns: 1fr;
  }

  .tag-form-card {
    position: static;
  }

  .span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .survey-respondents-modal {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
  }

  .survey-respondents-layout.has-detail {
    grid-template-columns: 1fr;
  }

  .survey-respondents-layout.has-detail .respondents-summary {
    min-height: 104px;
  }

  .response-detail-panel {
    min-height: 420px;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .nav button {
    border-right: 0;
    border-radius: 10px;
  }

  .workspace-topbar {
    position: static;
    min-height: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 12px;
  }

  .workspace-tabs {
    grid-column: 1 / -1;
    order: 3;
    gap: 18px;
  }

  .workspace-tab {
    min-height: 44px;
  }

  .workspace-actions {
    justify-content: flex-end;
  }

  .workspace-actions .icon-btn {
    display: none;
  }

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

  .overview-header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .overview-header-actions .btn {
    flex: 1 1 140px;
  }

  .overview-metric-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .overview-trend-card,
  .overview-operation-card {
    padding: 16px;
  }

  .overview-panel-head,
  .operation-head {
    flex-direction: column;
  }

  .overview-bars {
    gap: 10px;
    min-height: 240px;
    padding-inline: 0;
  }

  .overview-bar-track {
    height: 190px;
  }

  .create-survey-btn {
    min-width: 104px;
  }

  .topbar {
    position: static;
    height: auto;
    padding: 12px;
    align-items: flex-start;
    gap: 12px;
  }

  .topbar-title,
  .topbar-tabs,
  .page-header {
    flex-wrap: wrap;
  }

  .metric-grid,
  .tag-grid,
  .admin-toolbar,
  .tag-search-toolbar {
    grid-template-columns: 1fr;
  }

  .pagination-bar {
    min-width: 0;
    align-items: stretch;
    flex-direction: column;
  }

  .paged-table-shell {
    max-height: calc(100vh - 180px);
    min-height: 360px;
  }

  .pagination-actions {
    justify-content: space-between;
  }

  .pagination-size {
    margin-right: auto;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal {
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.modal-header {
  flex: 0 0 auto;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-body {
  padding: 20px;
  display: grid;
  gap: 18px;
  min-height: 0;
  overflow: auto;
}

.user-tag-editor-modal {
  width: min(680px, 100%);
}

.channel-create-modal {
  width: min(560px, 100%);
}

.channel-create-body {
  gap: 16px;
}

.user-tag-editor-modal .modal-header h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 900;
}

.user-tag-editor-modal .modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.user-tag-editor-body {
  gap: 20px;
}

.user-detail-modal {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

.user-detail-body {
  max-height: calc(100vh - 156px);
  overflow: auto;
  padding-right: 4px;
  display: grid;
  gap: 18px;
}

.user-detail-body.loading {
  min-height: 220px;
  align-content: start;
}

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

.user-detail-section h3 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 16px;
  font-weight: 900;
}

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

.user-detail-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-source-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.user-source-subtitle {
  margin: 4px 0 10px;
  color: #475569;
  font-size: 14px;
  font-weight: 950;
}

.detail-item {
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  display: grid;
  align-content: center;
  gap: 6px;
}

.detail-item span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.detail-item strong {
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 900;
  word-break: break-word;
}

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

.user-source-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.user-source-item strong {
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 900;
}

.user-source-item span,
.user-source-item small {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.survey-respondents-modal {
  width: min(1880px, calc(100vw - 72px));
  height: min(1060px, calc(100vh - 64px));
  max-height: none;
}

.survey-respondents-modal .modal-header h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 950;
}

.survey-respondents-modal .modal-header p {
  margin: 6px 0 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.survey-respondents-body {
  flex: 1 1 auto;
  gap: 16px;
  overflow: hidden;
}

.survey-respondents-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.survey-respondents-layout.has-detail {
  grid-template-columns: minmax(0, 1fr) minmax(520px, 600px);
}

.respondents-list-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 16px;
}

.respondents-summary {
  min-height: 104px;
  border: 1px solid rgba(187, 247, 208, 0.92);
  border-radius: 14px;
  background: linear-gradient(135deg, #f0fdf4, #fff);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.survey-respondents-layout.has-detail .respondents-summary {
  min-height: 260px;
}

.respondents-summary span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.respondents-summary strong {
  color: var(--primary);
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
}

.respondents-table-shell {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-height: none;
}

.respondents-table-shell .paged-table-scroll {
  min-height: 0;
}

.respondents-table th,
.respondents-table td {
  white-space: nowrap;
}

.respondents-table th:last-child,
.respondents-table td:last-child {
  width: 150px;
  min-width: 150px;
  text-align: center;
}

.respondents-table .respondent-tags-cell {
  min-width: 190px;
  max-width: 260px;
  white-space: normal;
}

.respondents-table tr.selected-row td {
  background: #f0fdf4;
}

.respondent-tags-cell .tag-list {
  align-items: center;
}

.respondent-tags-editor-cell {
  min-width: 0;
}

.btn-compact {
  min-height: 36px;
  min-width: 86px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
}

.respondent-detail-inline-error {
  margin-top: -4px;
}

.survey-respondents-modal {
  position: relative;
}

.response-detail-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: none;
  border: 1px solid rgba(187, 247, 208, 0.92);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.response-detail-standalone-modal {
  width: min(760px, calc(100vw - 48px));
  height: min(860px, calc(100vh - 48px));
}

.response-detail-standalone-modal .response-detail-panel {
  height: 100%;
}

.response-detail-placeholder {
  border-style: dashed;
  background: linear-gradient(135deg, #f8fafc, #fff);
}

.response-detail-placeholder-content {
  height: 100%;
  min-height: 360px;
  padding: 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.response-detail-placeholder-content .material-symbols-outlined {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #f0fdf4;
  color: var(--primary);
  font-size: 24px;
}

.response-detail-placeholder-content strong {
  color: var(--brand-dark);
  font-size: 18px;
  font-weight: 950;
}

.response-detail-placeholder-content span {
  max-width: 260px;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 800;
}

.response-detail-panel-header {
  flex: 0 0 auto;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f0fdf4, #fff);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.response-detail-panel-header h3 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 950;
}

.response-detail-panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 800;
}

.response-detail-body {
  min-height: 0;
  overflow: auto;
  padding: 16px;
  display: grid;
  gap: 16px;
}

.response-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.response-detail-meta > div {
  min-height: 62px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  align-content: center;
}

.response-detail-meta span,
.response-detail-tags-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.response-detail-meta strong {
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.response-detail-tags {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.response-detail-tags-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.response-detail-tags-head .btn {
  min-height: 32px;
  padding: 0 10px;
}

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

.response-answer-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 13px 14px;
  display: grid;
  gap: 8px;
}

.response-answer-question {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.response-answer-question span {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
}

.response-answer-question strong {
  color: var(--brand-dark);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 900;
}

.response-answer-item p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.user-tag-section h3 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 900;
}

.editable-tag-list,
.tag-suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editable-tag-pill,
.tag-suggestion {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 900;
}

.editable-tag-pill {
  padding: 6px 8px 6px 12px;
}

.editable-tag-pill button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.editable-tag-pill button:hover {
  background: rgba(15, 23, 42, 0.08);
}

.editable-tag-pill .material-symbols-outlined {
  font-size: 16px;
}

.tag-suggestion {
  padding: 6px 12px;
  cursor: pointer;
}

.tag-suggestion:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.batch-user-modal {
  width: min(760px, 100%);
}

.batch-user-search {
  padding: 16px 20px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.batch-user-list {
  min-height: 280px;
  max-height: 430px;
  overflow: auto;
  padding: 16px 20px;
  display: grid;
  gap: 10px;
}

.batch-user-row {
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) minmax(120px, auto);
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.batch-user-row:hover {
  border-color: #bbf7d0;
  background: #f8fffb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.batch-user-row.disabled {
  cursor: default;
  background: #f8fafc;
  color: #94a3b8;
}

.batch-user-row.disabled:hover {
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

.batch-user-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.batch-user-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.batch-user-main strong {
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 900;
}

.batch-user-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.batch-user-summary {
  margin-right: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.operation-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
}

.operation-modal {
  position: relative;
  width: min(420px, 100%);
  padding: 30px 28px 26px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.24);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
}

.operation-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.operation-modal-close:hover {
  background: #ecfdf3;
  color: var(--primary);
}

.operation-modal-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: grid;
  place-items: center;
}

.operation-modal-icon .material-symbols-outlined {
  font-size: 34px;
}

.operation-modal.success .operation-modal-icon {
  color: #16a34a;
  background: #dcfce7;
}

.operation-modal.error .operation-modal-icon {
  color: #ef4444;
  background: #fee2e2;
}

.operation-modal.info .operation-modal-icon {
  color: var(--primary);
  background: #ecfdf3;
}

.operation-modal h2 {
  margin: 2px 0 0;
  color: var(--brand-dark);
  font-size: 22px;
  line-height: 1.3;
  font-weight: 900;
}

.operation-modal p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.65;
  font-weight: 700;
}

.operation-modal-action {
  min-width: 132px;
  margin-top: 6px;
}

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

.question-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfdff;
}

.h5-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 28%),
    linear-gradient(180deg, #ecfdf3 0%, #f8fafc 42%, #ffffff 100%);
}

.mobile-frame {
  width: min(100%, 480px);
  margin: 0 auto;
  min-height: 100vh;
  padding: 18px 16px 96px;
}

.hero {
  background: var(--brand-dark);
  color: #fff;
  border-radius: 18px;
  padding: 22px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  right: -48px;
  top: -42px;
  background: rgba(34, 197, 94, 0.18);
  border-radius: 32px;
  transform: rotate(18deg);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 12px 0 8px;
  font-size: 26px;
  line-height: 1.25;
}

.hero p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.65;
}

.reward-strip {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.reward-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.progress {
  margin: 18px 0;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--success);
  width: var(--value, 0%);
  transition: width 220ms ease;
}

.question-card {
  padding: 18px;
  margin-top: 14px;
}

.question-title {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 800;
}

.required-star {
  margin-left: 4px;
  color: var(--danger);
  font-weight: 900;
}

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

.option {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
}

.option input {
  width: 18px;
  height: 18px;
}

.info-block,
.info-preview,
.upload-input,
.upload-preview {
  min-height: 52px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-weight: 700;
}

.info-preview.collapse,
.info-detail {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  color: #475569;
}

.info-detail summary {
  cursor: pointer;
  font-weight: 800;
}

.info-detail p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.mini-field-grid {
  display: grid;
  gap: 10px;
}

.upload-input {
  cursor: pointer;
}

.upload-input input {
  display: none;
}

.slider-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
}

.slider-input.compact {
  min-width: 220px;
}

.slider-input input[type="range"],
.matrix-input input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.ranking-input,
.ranking-preview,
.carousel-input,
.carousel-preview {
  display: grid;
  gap: 10px;
}

.ranking-input button,
.ranking-preview li,
.carousel-input button,
.carousel-preview span {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  font-weight: 800;
}

.ranking-input button span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.ranking-input button.ranked,
.carousel-input button.active {
  border-color: var(--primary);
  background: var(--soft-blue);
  color: var(--primary);
}

.ranking-input button.ranked span {
  background: var(--primary);
  color: #fff;
}

.sticky-submit {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  z-index: 80;
}

.sticky-submit-inner {
  width: min(100%, 480px);
  margin: 0 auto;
}

.sticky-submit .btn {
  width: 100%;
  min-height: 48px;
}

.builder-page {
  height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.builder-topbar {
  flex: 0 0 64px;
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.builder-title-wrap,
.builder-actions,
.builder-tool-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.builder-title-wrap {
  border-radius: 8px;
  transition: background 160ms ease, box-shadow 160ms ease, outline-color 160ms ease;
}

.builder-title-wrap.needs-attention {
  background: #fff7f7;
  outline: 2px solid #ef4444;
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.1);
}

.builder-title-stack {
  display: grid;
  gap: 2px;
}

.builder-title-stack span {
  color: var(--muted);
  font-size: 12px;
}

.builder-title-wrap.needs-attention .builder-title-stack span {
  color: #dc2626;
  font-weight: 800;
}

.builder-title-input {
  width: min(460px, 42vw);
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font-size: 18px;
  font-weight: 800;
  padding: 0;
}

.builder-title-input:focus {
  outline: 0;
}

.builder-title-wrap.needs-attention .builder-title-input,
.builder-title-wrap.needs-attention .builder-title-input::placeholder {
  color: #b91c1c;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.icon-btn:hover {
  background: #f8fafc;
  color: var(--primary);
}

.icon-btn:disabled {
  cursor: not-allowed;
  color: #cbd5e1;
  background: transparent;
  box-shadow: none;
}

.builder-tool-icons {
  gap: 8px;
  padding-right: 12px;
  border-right: 1px solid var(--border);
}

.builder-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr) 320px;
  overflow: hidden;
}

.builder-palette,
.builder-canvas,
.builder-settings {
  background: #fff;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.builder-palette {
  border-right: 1px solid var(--border);
  padding: 16px;
}

.palette-section {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.palette-section h3 {
  margin: 0 0 8px;
  padding: 0 8px;
  color: #64748b;
  font-size: 14px;
  font-weight: 900;
}

.palette-btn {
  min-height: 42px;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.palette-btn[draggable="true"] {
  cursor: grab;
}

.palette-btn[draggable="true"]:active {
  cursor: grabbing;
}

.palette-btn .material-symbols-outlined {
  color: #94a3b8;
}

.palette-btn:hover,
.palette-btn.active {
  border-color: var(--primary);
  background: var(--soft-blue);
  color: var(--primary);
}

.palette-btn:hover .material-symbols-outlined,
.palette-btn.active .material-symbols-outlined {
  color: var(--primary);
}

.builder-canvas {
  background: #f8fafc;
  padding: 40px 24px;
}

.canvas-inner {
  width: min(100%, 768px);
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.drop-zone {
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  min-height: 104px;
  background: transparent;
  color: #94a3b8;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  font-weight: 700;
}

.drop-zone:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--soft-blue);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(24, 160, 88, 0.18);
}

.builder-title-alert {
  width: 100%;
  min-height: 96px;
  border: 2px solid #ef4444;
  border-radius: 12px;
  background: #fff7f7;
  color: #b91c1c;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 24px;
  text-align: left;
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.12);
  cursor: pointer;
}

.builder-title-alert:hover,
.builder-title-alert:focus-visible {
  background: #fef2f2;
  outline: 3px solid rgba(239, 68, 68, 0.22);
  outline-offset: 2px;
}

.builder-title-alert .material-symbols-outlined {
  color: #ef4444;
  font-size: 28px;
}

.builder-title-alert span {
  display: grid;
  gap: 4px;
}

.builder-title-alert strong {
  color: #b91c1c;
  font-size: 16px;
  font-weight: 900;
}

.builder-title-alert small {
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
}

.preview-card {
  position: relative;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  background: #fff;
  padding: 28px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: transform 180ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.preview-card.active {
  border: 2px solid var(--primary);
}

.preview-card.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 160, 88, 0.12), 0 16px 32px rgba(15, 23, 42, 0.08);
}

.preview-card.drag-over::after {
  content: "松手后在此题后新增";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: -16px;
  min-height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  z-index: 2;
}

.preview-card.dragging {
  opacity: 0.46;
  cursor: grabbing;
  border-color: rgba(24, 160, 88, 0.28);
  background: rgba(236, 253, 243, 0.5);
  box-shadow: inset 0 0 0 1px rgba(24, 160, 88, 0.12);
}

.canvas-inner.sorting-active .preview-card:not(.dragging) {
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.preview-card.reorder-animating {
  z-index: 3;
  pointer-events: none;
  will-change: transform;
}

.preview-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.preview-title-area {
  min-width: 0;
  flex: 1;
}

.q-number {
  color: #94a3b8;
  font-weight: 900;
  margin-right: 8px;
}

.q-number.active {
  color: var(--primary);
}

.question-title-display {
  width: calc(100% - 48px);
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
  word-break: break-word;
}

.preview-title-area p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.preview-tools {
  display: flex;
  gap: 4px;
}

.preview-tools button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.preview-tools button:hover {
  color: var(--primary);
  background: var(--soft-blue);
}

.preview-tools button[aria-label="拖拽排序"] {
  cursor: grab;
}

.preview-tools button[aria-label="拖拽排序"]:active {
  cursor: grabbing;
}

.choice-preview {
  display: grid;
  gap: 10px;
}

.choice-preview label {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0 12px;
  color: #334155;
  background: #fff;
}

.choice-preview.multi {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-preview input {
  width: 18px;
  height: 18px;
}

.rating-preview,
.rating-input {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rating-preview button,
.rating-input button {
  min-height: 44px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fff;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  font-weight: 800;
}

.rating-preview button.filled,
.rating-input button.active {
  background: #fffbeb;
  color: var(--warning);
}

.rating-preview button.filled .material-symbols-outlined,
.rating-input button.active .material-symbols-outlined {
  font-variation-settings: "FILL" 1, "wght" 600, "GRAD" 0, "opsz" 24;
}

.matrix-preview,
.matrix-input {
  overflow-x: scroll;
  overflow-y: hidden;
  padding-bottom: 8px;
  scrollbar-color: #94a3b8 #e2e8f0;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.matrix-preview::-webkit-scrollbar,
.matrix-input::-webkit-scrollbar {
  height: 8px;
}

.matrix-preview::-webkit-scrollbar-track,
.matrix-input::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 999px;
}

.matrix-preview::-webkit-scrollbar-thumb,
.matrix-input::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

.matrix-preview::-webkit-scrollbar-thumb:hover,
.matrix-input::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.matrix-preview table,
.matrix-input table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.matrix-preview th,
.matrix-preview td,
.matrix-input th,
.matrix-input td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
  color: #334155;
  font-size: 14px;
}

.matrix-preview th:first-child,
.matrix-preview td:first-child,
.matrix-input th:first-child,
.matrix-input td:first-child {
  text-align: left;
}

.matrix-preview th,
.matrix-input th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 800;
}

.matrix-cell-input {
  width: 100%;
  min-width: 96px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  text-align: center;
}

.builder-success {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #047857;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.builder-success a {
  color: var(--primary);
  font-weight: 800;
}

.builder-settings {
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-tabs {
  flex: 0 0 auto;
  display: grid;
  border-bottom: 1px solid #f1f5f9;
}

.settings-tab-title {
  min-height: 52px;
  background: #fff;
  color: var(--primary);
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-weight: 900;
}

.settings-body {
  flex: 1;
  min-height: 0;
  padding: 20px;
  display: grid;
  gap: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.settings-group {
  display: grid;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
}

.settings-group h4 {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.settings-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-title-line button {
  border: 0;
  background: transparent;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
}

.settings-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.switch-row {
  min-height: 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  color: #334155;
  font-size: 14px;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-ui {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #e2e8f0;
  position: relative;
  transition: background 180ms ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  transition: transform 180ms ease;
}

.switch-row input:checked + .switch-ui {
  background: var(--primary);
}

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

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

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

.option-editor button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #cbd5e1;
}

.option-editor button:hover {
  color: var(--danger);
  background: #fef2f2;
}

.dotted-btn {
  min-height: 36px;
  border: 2px dotted #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.dotted-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.settings-footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 18px 20px;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}

.builder-fab {
  position: fixed;
  right: 340px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 32px rgba(24, 160, 88, 0.26);
  z-index: 30;
  transition: transform 160ms ease;
}

.builder-fab:hover {
  transform: scale(1.08);
}

/* H5 filling page polish */
.h5-body {
  background: #f3fbf6;
  color: #123524;
}

.h5-body .mobile-frame {
  width: min(100%, 560px);
  padding: 18px 14px 144px;
}

.h5-body .hero {
  background: #18a058;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(24, 160, 88, 0.18);
}

.h5-body .hero::after {
  display: none;
}

.hero-eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-code {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #cfeede;
  font-size: 12px;
  font-weight: 800;
}

.h5-body .hero h1 {
  margin: 16px 0 10px;
  font-size: 25px;
  letter-spacing: 0;
}

.h5-body .hero p {
  color: #cfeede;
}

.h5-body .reward-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.h5-body .reward-pill {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  justify-content: center;
}

.progress-panel {
  margin: 14px 0 12px;
  border: 1px solid #cfeede;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  align-items: center;
  box-shadow: 0 10px 28px rgba(24, 160, 88, 0.08);
}

.progress-copy {
  display: grid;
  gap: 2px;
}

.progress-copy span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.progress-copy strong,
.progress-percent {
  color: #18a058;
  font-size: 14px;
  font-weight: 900;
}

.h5-body .progress {
  grid-column: 1 / -1;
  margin: 0;
  height: 10px;
  background: #cfeede;
}

.h5-body .progress span {
  background: #18a058;
}

.h5-body .question-card {
  margin-top: 12px;
  padding: 18px;
  border: 1px solid #cfeede;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(24, 160, 88, 0.07);
}

.h5-body .question-card.answered {
  border-color: #8fd8ad;
}

.h5-body .question-card.has-error {
  border-color: #fca5a5;
  background: #fffafa;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.question-index,
.answered-pill {
  min-height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.question-index {
  background: #18a058;
  color: #fff;
}

.answered-pill {
  background: #ecfdf3;
  color: #18a058;
  margin-left: auto;
}

.answered-pill .material-symbols-outlined {
  font-size: 16px;
}

.h5-body .question-title {
  margin-bottom: 14px;
  color: #111827;
  font-size: 18px;
  line-height: 1.45;
}

.h5-body .required-star {
  margin-left: 6px;
  color: #e11d48;
  font-weight: 900;
}

.h5-body .input,
.h5-body .textarea,
.h5-body .select {
  min-height: 50px;
  border-color: #cfeede;
  border-radius: 12px;
  background: #fbfdff;
  color: #123524;
}

.h5-body .textarea {
  min-height: 112px;
}

.h5-body .label {
  color: #475569;
  font-size: 13px;
}

.h5-body .option {
  min-height: 54px;
  border-color: #cfeede;
  border-radius: 14px;
  padding: 0 14px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.h5-body .option:hover {
  border-color: #8fd8ad;
  background: #ecfdf3;
}

.h5-body .option:has(input:checked) {
  border-color: #18a058;
  background: #ecfdf3;
  color: #18a058;
  font-weight: 800;
}

.h5-body .option input,
.h5-body input[type="radio"],
.h5-body input[type="checkbox"] {
  accent-color: #18a058;
}

.h5-body .rating-input button,
.h5-body .carousel-input button,
.h5-body .ranking-input button {
  min-height: 48px;
  border-color: #cfeede;
  border-radius: 14px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.h5-body .rating-input button:hover,
.h5-body .carousel-input button:hover,
.h5-body .ranking-input button:hover {
  border-color: #8fd8ad;
  background: #ecfdf3;
}

.h5-body .rating-input button.active,
.h5-body .carousel-input button.active,
.h5-body .ranking-input button.ranked {
  border-color: #18a058;
  background: #18a058;
  color: #fff;
}

.h5-body .rating-input button.active .material-symbols-outlined {
  color: #fff;
}

.h5-body .custom-dropdown-trigger {
  min-height: 52px;
  border-color: #cfeede;
  border-radius: 14px;
  color: #123524;
  box-shadow: none;
}

.h5-body .custom-dropdown.open .custom-dropdown-trigger {
  border-color: #18a058;
  box-shadow: 0 0 0 4px rgba(24, 160, 88, 0.14);
}

.h5-body .custom-dropdown-menu {
  border-color: #cfeede;
  box-shadow: 0 18px 38px rgba(24, 160, 88, 0.16);
}

.h5-body .custom-dropdown-option:hover,
.h5-body .custom-dropdown-option:focus-visible {
  background: #ecfdf3;
  color: #18a058;
}

.h5-body .custom-dropdown-option.selected {
  background: #18a058;
  color: #fff;
}

.h5-body .matrix-input {
  border: 1px solid #cfeede;
  border-radius: 14px;
  background: #fff;
  padding: 0 0 8px;
}

.h5-body .matrix-input table {
  min-width: 620px;
}

.h5-body .matrix-input th {
  background: #ecfdf3;
  color: #475569;
}

.h5-body .matrix-input td:first-child,
.h5-body .matrix-input th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
}

.h5-body .matrix-input th:first-child {
  background: #ecfdf3;
}

.h5-body .matrix-cell-input {
  min-height: 40px;
  border-color: #cfeede;
}

.h5-body .slider-input strong {
  color: #18a058;
  text-align: right;
}

.h5-body .upload-input {
  border-color: #8fd8ad;
  background: #ecfdf3;
  color: #18a058;
}

.h5-body .field-error {
  margin: 12px 0 0;
  min-height: 36px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.h5-body .field-error .material-symbols-outlined {
  font-size: 18px;
}

.h5-body .sticky-submit {
  padding-top: 10px;
  background: #f3fbf6;
  box-shadow: 0 -12px 28px rgba(24, 160, 88, 0.10);
}

.h5-body .sticky-submit-inner {
  width: min(100%, 560px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.sticky-submit-status {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.h5-body .sticky-submit .btn {
  min-height: 52px;
  border-radius: 14px;
  background: #18a058;
  border-color: #18a058;
  box-shadow: 0 12px 28px rgba(24, 160, 88, 0.24);
}

.h5-body .success-panel {
  min-height: 420px;
  border-radius: 22px;
}

@media (max-width: 420px) {
  .h5-body .reward-strip {
    grid-template-columns: 1fr;
  }

  .h5-body .sticky-submit-inner {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sticky-submit-status {
    text-align: center;
  }
}

/* H5 filling page restored to the pre-polish baseline. */
.h5-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 28%),
    linear-gradient(180deg, #ecfdf3 0%, #f8fafc 42%, #ffffff 100%);
  color: var(--text);
}

.h5-body .mobile-frame {
  width: min(100%, 480px);
  margin: 0 auto;
  min-height: 100vh;
  padding: 18px 16px 96px;
}

.h5-body .hero {
  background: var(--brand-dark);
  color: #fff;
  border: 0;
  border-radius: 18px;
  padding: 22px;
  box-shadow: none;
  overflow: hidden;
  position: relative;
}

.h5-body .hero::after {
  display: block;
}

.h5-body .hero h1 {
  margin: 12px 0 8px;
  color: #fff;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0;
}

.h5-body .hero p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.65;
}

.h5-body .reward-strip {
  margin-top: 16px;
  display: flex;
  grid-template-columns: none;
  gap: 10px;
  flex-wrap: wrap;
}

.h5-body .reward-pill {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  justify-content: flex-start;
}

.h5-body .progress {
  margin: 18px 0;
  height: 8px;
  background: #e2e8f0;
}

.h5-body .progress span {
  background: var(--success);
}

.h5-body .question-card {
  padding: 18px;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.h5-body .question-card.has-error {
  border-color: #fecaca;
  background: var(--surface);
}

.h5-body .question-title {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
}

.h5-body .required-star {
  margin-left: 4px;
  color: var(--danger);
}

.h5-body .input,
.h5-body .textarea,
.h5-body .select {
  min-height: 40px;
  border-color: var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.h5-body .textarea {
  min-height: 88px;
}

.h5-body .label {
  color: #475569;
  font-size: 12px;
}

.h5-body .option {
  min-height: 48px;
  border-color: var(--border);
  border-radius: 10px;
  padding: 0 12px;
  cursor: pointer;
  transition: none;
}

.h5-body .option:hover {
  border-color: var(--border);
  background: #fff;
}

.h5-body .option:has(input:checked) {
  border-color: var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 400;
}

.h5-body .option input,
.h5-body input[type="radio"],
.h5-body input[type="checkbox"] {
  accent-color: var(--primary);
}

.h5-body .rating-input button,
.h5-body .carousel-input button,
.h5-body .ranking-input button {
  min-height: 44px;
  border-color: var(--border);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  transition: none;
}

.h5-body .rating-input button:hover,
.h5-body .carousel-input button:hover,
.h5-body .ranking-input button:hover {
  border-color: var(--border);
  background: #fff;
}

.h5-body .rating-input button.active,
.h5-body .carousel-input button.active,
.h5-body .ranking-input button.ranked {
  border-color: var(--primary);
  background: var(--soft-blue);
  color: var(--primary);
}

.h5-body .rating-input .material-symbols-outlined {
  color: #334155;
}

.h5-body .rating-input button.active .material-symbols-outlined {
  color: var(--primary);
}

.h5-body .custom-dropdown-trigger {
  min-height: 48px;
  border-color: var(--border);
  border-radius: 12px;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.h5-body .custom-dropdown.open .custom-dropdown-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(24, 160, 88, 0.12);
}

.h5-body .custom-dropdown-menu {
  border-color: #dbe4f0;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.h5-body .custom-dropdown-option:hover,
.h5-body .custom-dropdown-option:focus-visible {
  background: #ecfdf3;
  color: var(--primary);
}

.h5-body .custom-dropdown-option.selected {
  background: var(--primary);
  color: #fff;
}

.h5-body .matrix-input {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding-bottom: 8px;
}

.h5-body .matrix-input table {
  min-width: 520px;
}

.h5-body .matrix-input th {
  background: #f8fafc;
  color: #64748b;
}

.h5-body .matrix-input td:first-child,
.h5-body .matrix-input th:first-child {
  position: static;
  z-index: auto;
  background: transparent;
}

.h5-body .matrix-input th:first-child {
  background: #f8fafc;
}

.h5-body .matrix-cell-input {
  min-height: 36px;
  border-color: var(--border);
}

.h5-body .followup-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.h5-body .followup-label {
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.h5-body .followup-textarea {
  min-height: 92px;
  resize: vertical;
}

.h5-body .slider-input strong {
  color: var(--primary);
}

.h5-body .upload-input {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.h5-body .field-error {
  margin: 10px 0 0;
  min-height: auto;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.h5-body .sticky-submit {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

.h5-body .sticky-submit-inner {
  width: min(100%, 480px);
  display: block;
}

.h5-body .sticky-submit .btn {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: none;
}

.h5-body .success-panel {
  min-height: auto;
  border-radius: 12px;
}

.miniapp-jump-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 18% 12%, rgba(24, 160, 88, 0.18), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #ecfdf3 100%);
}

.miniapp-jump-panel {
  width: min(100%, 430px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  padding: 26px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.miniapp-jump-badge,
.miniapp-jump-success,
.miniapp-jump-alert {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.miniapp-jump-badge {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  background: #ecfdf3;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.miniapp-jump-panel h1 {
  margin: 18px 0 10px;
  color: #0f172a;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: 0;
}

.miniapp-jump-panel p {
  margin: 0;
  color: #475569;
  font-size: 16px;
  line-height: 1.7;
}

.miniapp-jump-meta {
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px 12px;
  background: #f8fafc;
}

.miniapp-jump-meta span {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.miniapp-jump-meta strong {
  min-width: 0;
  color: #1e293b;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.miniapp-jump-alert,
.miniapp-jump-success {
  width: 100%;
  min-height: 42px;
  margin-bottom: 12px;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.miniapp-jump-alert {
  background: #fef2f2;
  color: #b91c1c;
}

.miniapp-jump-success {
  background: #ecfdf5;
  color: #047857;
}

.miniapp-jump-btn {
  width: 100%;
  min-height: 50px;
  border-radius: 10px;
}

.miniapp-jump-btn .material-symbols-outlined {
  animation: none;
}

.miniapp-jump-btn:disabled .material-symbols-outlined {
  animation: spin 900ms linear infinite;
}

.miniapp-jump-fallback {
  min-height: 44px;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 10px;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.miniapp-jump-fallback:hover {
  background: #ecfdf3;
}

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

@media (max-width: 860px) {
  .builder-page {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

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

  .sidebar {
    position: static;
    height: auto;
    padding-bottom: 8px;
  }

  .nav {
    grid-auto-flow: column;
    overflow-x: auto;
    padding: 0 12px;
  }

  .nav a {
    white-space: nowrap;
    border-right: 0;
    border-bottom: 3px solid transparent;
  }

  .nav a.active {
    border-bottom-color: var(--primary);
  }

  .topbar {
    align-items: flex-start;
    height: auto;
    padding: 12px 16px;
    gap: 12px;
    flex-direction: column;
  }

  .page {
    padding: 16px;
  }

  .page-header {
    flex-direction: column;
  }

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

  .builder-topbar {
    flex: 0 0 auto;
    height: auto;
    min-height: 64px;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
  }

  .builder-title-input {
    width: 100%;
  }

  .builder-main {
    grid-template-columns: 1fr;
    overflow: visible;
    min-height: auto;
  }

  .builder-palette,
  .builder-canvas,
  .builder-settings {
    max-height: none;
    overflow: visible;
    border: 0;
  }

  .builder-palette {
    display: none;
  }

  .builder-canvas {
    padding: 20px 16px;
  }

  .builder-settings {
    border-top: 1px solid var(--border);
  }

  .builder-fab {
    right: 20px;
  }

  .choice-preview.multi {
    grid-template-columns: 1fr;
  }
}

.settings-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.logic-rule-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.logic-rule-list {
  display: grid;
  gap: 12px;
}

.logic-rule-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.logic-quick-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.logic-add-btn {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 10px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.dotted-btn.danger {
  color: #dc2626;
  border-color: #fecaca;
  background: #fff;
}

.terminate-panel {
  display: grid;
  gap: 8px;
  border-color: #fecaca;
  background: #fff7ed;
  color: #9a3412;
}

@media (max-width: 860px) {
  .settings-grid-2,
  .logic-rule-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
