* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Jua", sans-serif;

  /* Chrome and Opera */
  user-select: none;

  /* Safari */
  -webkit-user-select: none;

  /* Konqueror HTML */
  -khtml-user-select: none;

  /* Firefox */
  -moz-user-select: none;

  /* Internet Explorer/Edge */
  -ms-user-select: none;
}

:link {
  color: #6f6;
}

:visited {
  color: #66f;
}

:root,
[data-theme="classic"] {
  --brand: #ccffcc;
  --brand-dark: #99ee99;
  --brand-text: #1a3d1a;
  --bg: #e8ffe8;
  --bg-secondary: #d4fad4;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-border: rgba(204, 255, 204, 0.6);
  --text: #1a2e1a;
  --text-muted: #4a6b4a;
  --text-faint: #7a9b7a;
  --shadow: rgba(100, 160, 100, 0.12);
  --shadow-strong: rgba(100, 160, 100, 0.22);
  --danger: #e05555;
  --danger-soft: rgba(224, 85, 85, 0.1);
  --success: #2d8a2d;
  --success-soft: rgba(45, 138, 45, 0.12);
  --warn: #b87820;
}

[data-theme="ng1"] {
  --brand: #ffcccc;
  --brand-dark: #ee9999;
  --brand-text: #3d1a1a;
  --bg: #ffe8e8;
  --bg-secondary: #fad4d4;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-border: rgba(255, 204, 204, 0.6);
  --text: #2e1a1a;
  --text-muted: #6b4a4a;
  --text-faint: #9b7a7a;
  --shadow: rgba(160, 100, 100, 0.12);
  --shadow-strong: rgba(160, 100, 100, 0.22);
}

[data-theme="ng2"] {
  --brand: #ccccff;
  --brand-dark: #9999ee;
  --brand-text: #1a1a3d;
  --bg: #e8e8ff;
  --bg-secondary: #d4d4fa;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-border: rgba(204, 204, 255, 0.6);
  --text: #1a1a2e;
  --text-muted: #4a4a6b;
  --text-faint: #7a7a9b;
  --shadow: rgba(100, 100, 160, 0.12);
  --shadow-strong: rgba(100, 100, 160, 0.22);
}

[data-theme="ng3"] {
  --brand: #ffffcc;
  --brand-dark: #eeee99;
  --brand-text: #3d3d1a;
  --bg: #ffffe8;
  --bg-secondary: #fafad4;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-border: rgba(255, 255, 204, 0.6);
  --text: #2e2e1a;
  --text-muted: #6b6b4a;
  --text-faint: #9b9b7a;
  --shadow: rgba(160, 160, 100, 0.12);
  --shadow-strong: rgba(160, 160, 100, 0.22);
}

[data-theme="ng4"] {
  --brand: #ffccff;
  --brand-dark: #ee99ee;
  --brand-text: #3d1a3d;
  --bg: #ffe8ff;
  --bg-secondary: #fad4fa;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-border: rgba(255, 204, 255, 0.6);
  --text: #2e1a2e;
  --text-muted: #6b4a6b;
  --text-faint: #9b7a9b;
  --shadow: rgba(160, 100, 160, 0.12);
  --shadow-strong: rgba(160, 100, 160, 0.22);
}

[data-theme="ng5"] {
  --brand: #ccffff;
  --brand-dark: #99eeee;
  --brand-text: #1a3d3d;
  --bg: #e8ffff;
  --bg-secondary: #d4fafa;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-border: rgba(204, 255, 255, 0.6);
  --text: #1a2e2e;
  --text-muted: #4a6b6b;
  --text-faint: #7a9b9b;
  --shadow: rgba(100, 160, 160, 0.12);
  --shadow-strong: rgba(100, 160, 160, 0.22);
}

[data-theme="light"] {
  --brand: #e8e8e8;
  --brand-dark: #cccccc;
  --brand-text: #1a1a1a;
  --bg: #f5f5f5;
  --bg-secondary: #ebebeb;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-border: rgba(220, 220, 220, 0.6);
  --text: #111111;
  --text-muted: #555555;
  --text-faint: #888888;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-strong: rgba(0, 0, 0, 0.16);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  font-family: 'Jua', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.5;
}

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

a:hover {
  text-decoration: underline;
}

input,
textarea,
button,
select {
  font-family: 'Jua', sans-serif;
}

/* ===== GLASS UTILITY ===== */
.glass {
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1.5px solid var(--surface-border);
  box-shadow: 0 4px 24px var(--shadow), 0 1px 4px var(--shadow);
}

/* ===== TOPBAR ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.01em;
}

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

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: 'Jua', sans-serif;
  font-size: 0.92rem;
  transition: all 0.18s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-text);
  border: 1.5px solid var(--brand-dark);
}

.btn-primary:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow-strong);
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--surface-border);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid transparent;
  padding: 8px 10px;
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--surface-border);
  color: var(--text);
  text-decoration: none;
}

.btn-icon {
  border-radius: 10px;
}

.btn-icon .btn-label {
  font-size: 0.85rem;
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1.5px solid rgba(224, 85, 85, 0.25);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  text-decoration: none;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}

.modal-overlay[hidden] {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-box {
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border: 1.5px solid var(--surface-border);
  border-radius: 18px;
  box-shadow: 0 16px 48px var(--shadow-strong);
  width: 100%;
  max-width: 440px;
  animation: slideUp 0.22s ease;
  overflow: hidden;
}

.modal-box-wide {
  max-width: 560px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--surface-border);
}

.modal-title {
  font-size: 1.1rem;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-close:hover {
  color: var(--text);
}

/* ===== THEME MODAL ===== */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 20px 22px;
}

.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 8px 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: 'Jua', sans-serif;
}

.theme-swatch:hover,
.theme-swatch.active {
  border-color: var(--brand-dark);
  background: var(--bg-secondary);
}

.swatch-color {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--surface-border);
}

.swatch-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

/* ===== PUBLISH MODAL ===== */
.publish-body {
  padding: 20px 22px;
}

.publish-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.slug-preview {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--surface-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-secondary);
  margin-bottom: 10px;
}

.slug-base {
  padding: 10px 12px;
  color: var(--text-faint);
  font-size: 0.85rem;
  white-space: nowrap;
  border-right: 1.5px solid var(--surface-border);
}

.slug-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-family: 'Jua', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
}

.slug-hint {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-bottom: 20px !important;
}

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

/* ===== CREATE MODAL ===== */
.create-body {
  padding: 20px 22px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--surface-border);
  border-radius: 10px;
  font-family: 'Jua', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus {
  border-color: var(--brand-dark);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.feature-checkboxes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.feature-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--surface-border);
  transition: border-color 0.15s;
}

.feature-check input {
  accent-color: var(--brand-dark);
  cursor: pointer;
}

.feature-check:hover {
  border-color: var(--brand-dark);
}

/* ===== AUTH VIEW ===== */
.view {
  min-height: calc(100vh - 60px);
}

.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  border-radius: 20px;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 28px 16px;
  text-align: center;
}

.auth-logo svg {
  width: 48px;
  height: 48px;
}

.auth-title {
  font-size: 1.6rem;
  color: var(--text);
}

.auth-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.auth-tabs {
  display: flex;
  border-bottom: 1.5px solid var(--surface-border);
}

.auth-tab {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Jua', sans-serif;
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: all 0.15s;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
}

.auth-tab.active {
  color: var(--brand-text);
  border-bottom-color: var(--brand-dark);
}

.auth-form {
  padding: 24px 28px 28px;
}

.auth-form .form-group:last-of-type {
  margin-bottom: 20px;
}

/* ===== DASHBOARD ===== */
.dashboard {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

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

.dashboard-title {
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 4px;
}

.dashboard-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.stages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.stages-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.stages-empty svg {
  width: 80px;
  height: 80px;
  opacity: 0.5;
}

/* Stage card */
.stage-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--surface-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
  animation: slideUp 0.2s ease;
}

.stage-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow-strong);
  border-color: var(--brand-dark);
}

.stage-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.stage-card-title {
  font-size: 1rem;
  color: var(--text);
  flex: 1;
  padding-right: 10px;
}

.stage-live-badge {
  background: #ff4444;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.stage-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.stage-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stage-features {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.feature-pill {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: var(--brand);
  color: var(--brand-text);
  border-radius: 20px;
  border: 1px solid var(--brand-dark);
}

.stage-date {
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ===== EDITOR LAYOUT ===== */
.editor-layout {
  display: flex;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.editor-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  overflow-y: auto;
  border-right: 1.5px solid var(--surface-border);
  border-radius: 0;
}

.sidebar-stage-info {
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 14px;
}

.sidebar-stage-info h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 6px;
  word-break: break-word;
}

.stage-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
}

.stage-status.live {
  background: rgba(255, 68, 68, 0.15);
  color: #cc2222;
}

.stage-status.draft {
  background: var(--bg-secondary);
  color: var(--text-faint);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Jua', sans-serif;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: left;
  width: 100%;
  transition: all 0.15s;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

.nav-item.active {
  background: var(--brand);
  color: var(--brand-text);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--surface-border);
  padding-top: 14px;
}

.live-link-box {
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 12px;
}

.live-link-label {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.live-link-url {
  font-size: 0.8rem;
  color: var(--brand-text);
  word-break: break-all;
  display: block;
  margin-bottom: 8px;
}

.editor-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ===== EDITOR PANELS ===== */
.editor-panel {
  animation: slideUp 0.2s ease;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-title {
  font-size: 1.2rem;
  color: var(--text);
}

.panel-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--surface-border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px var(--shadow);
  animation: slideUp 0.18s ease;
}

.empty-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-panel svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

/* Poll specific */
.poll-question {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 12px;
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.poll-option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 8px 12px;
  border: 1.5px solid var(--surface-border);
}

.poll-option-text {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text);
}

.poll-bar {
  height: 6px;
  background: var(--brand);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.poll-bar-wrap {
  flex: 1;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

.poll-count {
  font-size: 0.78rem;
  color: var(--text-faint);
  min-width: 28px;
  text-align: right;
}

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

.toggle-pill {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--surface-border);
  background: var(--bg-secondary);
  font-family: 'Jua', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.toggle-pill.on {
  background: var(--brand);
  border-color: var(--brand-dark);
  color: var(--brand-text);
}

/* Q&A specific */
.qa-item {
  display: flex;
  gap: 12px;
}

.qa-votes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.vote-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
  font-family: 'Jua', sans-serif;
}

.vote-btn svg {
  width: 16px;
  height: 16px;
}

.vote-btn:hover {
  color: var(--brand-text);
}

.vote-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.qa-content {
  flex: 1;
}

.qa-question-text {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 6px;
}

.qa-meta {
  font-size: 0.75rem;
  color: var(--text-faint);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.qa-answered {
  color: var(--success);
}

/* Word cloud specific */
.wordcloud-canvas {
  width: 100%;
  height: 220px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1.5px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px;
  margin-bottom: 14px;
  overflow: hidden;
}

.cloud-word {
  cursor: default;
  font-family: 'Jua', sans-serif;
  color: var(--brand-text);
  transition: transform 0.2s;
}

.cloud-word:hover {
  transform: scale(1.1);
}

/* Reactions */
.reactions-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.reaction-btn-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--surface-border);
  border-radius: 14px;
  padding: 16px 20px;
  cursor: pointer;
  font-family: 'Jua', sans-serif;
  transition: all 0.18s;
}

.reaction-btn-big:hover {
  background: var(--brand);
  border-color: var(--brand-dark);
  transform: translateY(-2px);
}

.reaction-icon svg {
  width: 32px;
  height: 32px;
}

.reaction-count {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Chat */
.chat-messages {
  height: 280px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1.5px solid var(--surface-border);
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg {
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 12px;
}

.chat-msg-author {
  font-size: 0.75rem;
  color: var(--brand-text);
  margin-bottom: 2px;
}

.chat-msg-text {
  font-size: 0.88rem;
  color: var(--text);
}

.chat-msg-time {
  font-size: 0.7rem;
  color: var(--text-faint);
  float: right;
}

/* ===== AUTH AREA ===== */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1.5px solid var(--surface-border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.user-chip:hover {
  border-color: var(--brand-dark);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  border: 1.5px solid var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--brand-text);
  flex-shrink: 0;
  overflow: hidden;
}

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

.user-name {
  font-size: 0.85rem;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--surface-border);
  box-shadow: 0 4px 20px var(--shadow-strong);
  font-size: 0.9rem;
  color: var(--text);
  animation: slideUp 0.2s ease;
  pointer-events: all;
  max-width: 320px;
}

.toast.success {
  border-color: var(--success);
  color: var(--success);
}

.toast.error {
  border-color: var(--danger);
  color: var(--danger);
}

.toast.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--brand-dark);
  border-radius: 3px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .topbar {
    padding: 0 14px;
  }

  .btn-icon .btn-label {
    display: none;
  }

  .editor-layout {
    flex-direction: column;
    height: auto;
  }

  .editor-sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1.5px solid var(--surface-border);
  }

  .editor-main {
    padding: 16px;
  }

  .feature-checkboxes {
    grid-template-columns: 1fr;
  }

  .theme-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}