:root {
  --bg-base: #090a0f;
  --bg-surface: #11131a;
  --bg-surface-elevated: #161922;
  --bg-surface-hover: #1e2230;
  --bg-input: #0d0f15;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-active: #6366f1;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --primary-dim: rgba(99, 102, 241, 0.12);
  --cyan: #06b6d4;
  --cyan-dim: rgba(6, 182, 212, 0.12);
  --emerald: #10b981;
  --emerald-dim: rgba(16, 185, 129, 0.12);
  --rose: #f43f5e;
  --rose-dim: rgba(244, 63, 94, 0.12);
  --amber: #f59e0b;
  --text-white: #ffffff;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-subtle);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);
}

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

html {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 45%), var(--bg-base);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

svg {
  display: block;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 68px;
  background: rgba(9, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-group {
  display: flex;
  align-items: center;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.brand-glow {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.brand-logo-text {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--text-white);
}

.brand-version {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
}

.hub-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
}

.hub-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}

.hub-tab svg {
  width: 16px;
  height: 16px;
}

.hub-tab:hover {
  color: var(--text-white);
  background: var(--bg-surface-hover);
}

.hub-tab.is-active {
  color: var(--text-white);
  background: var(--primary);
  box-shadow: 0 2px 10px var(--primary-glow);
}

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

.btn-ghost-danger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--rose);
  background: var(--rose-dim);
  border: 1px solid rgba(244, 63, 94, 0.25);
  transition: var(--transition);
}

.btn-ghost-danger:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--rose);
  box-shadow: 0 0 12px var(--rose-dim);
}

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

.btn-ghost {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.btn-ghost:hover {
  color: var(--text-white);
  border-color: var(--border-medium);
  background: var(--bg-surface-hover);
}

.btn-ghost svg {
  width: 15px;
  height: 15px;
}

.btn-ghost-sm {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.btn-ghost-sm:hover {
  color: var(--text-white);
  border-color: var(--border-medium);
}

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

.btn-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.btn-profile:hover {
  border-color: var(--border-medium);
  background: var(--bg-surface-hover);
}

.avatar-ring {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-white);
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  box-shadow: 0 0 15px var(--primary-glow);
  transition: var(--transition);
}

.btn-cta:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn-cta svg {
  width: 15px;
  height: 15px;
}

.app-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 80px;
  flex: 1;
}

.app-view {
  display: none;
}

.app-view.is-active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.feed-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.feed-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.feed-title-wrap h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.02em;
}

.feed-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--emerald);
  background: var(--emerald-dim);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.feed-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.feed-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-wrap {
  flex: 1;
  min-width: 260px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap svg {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 42px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-white);
  font-size: 13px;
  transition: var(--transition);
}

.search-input-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.search-input-wrap.wide {
  max-width: 600px;
}

.feed-sub-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.segmented-control {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
}

.seg-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.seg-btn.is-active {
  background: var(--bg-surface-elevated);
  color: var(--text-white);
  border: 1px solid var(--border-medium);
}

.sort-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sort-select-wrap svg {
  position: absolute;
  left: 12px;
  width: 14px;
  height: 14px;
  color: var(--text-dim);
  pointer-events: none;
}

.sort-select-wrap select {
  height: 42px;
  padding: 0 28px 0 34px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  transition: var(--transition);
}

.sort-select-wrap select:focus {
  outline: none;
  border-color: var(--primary);
}

.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 24px;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  transition: var(--transition);
}

.cat-pill:hover {
  color: var(--text-white);
  border-color: var(--border-medium);
  background: var(--bg-surface-hover);
}

.cat-pill.is-active {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 10px var(--primary-glow);
}

.threads-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.spin-icon {
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
  color: var(--primary);
}

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

.thread {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.thread:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
  background: var(--bg-surface-elevated);
}

.thread.is-highlighted {
  border-color: var(--primary);
  box-shadow: 0 0 25px var(--primary-glow);
}

.thread .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
}

.thread-body {
  flex: 1;
  min-width: 0;
}

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

.thread-meta strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-white);
}

.thread-meta span {
  font-size: 12px;
  color: var(--text-dim);
}

.thread-meta .tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(6, 182, 212, 0.2);
  padding: 1px 7px;
  border-radius: 4px;
}

.thread h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 8px;
  line-height: 1.4;
}

.thread p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-line;
  word-break: break-word;
}

.reply-preview {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border-left: 2px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  color: var(--text-muted);
}

.reply-preview svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.thread-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.thread-actions button,
.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  transition: var(--transition);
}

.thread-actions button:hover,
.action-btn:hover {
  color: var(--text-white);
  background: var(--bg-surface-hover);
}

.thread-actions button.is-liked,
.action-btn.is-liked {
  color: var(--rose);
}

.thread-actions button.is-liked svg,
.action-btn.is-liked svg {
  fill: var(--rose);
}

.thread-actions button.is-saved,
.action-btn.is-saved {
  color: var(--amber);
}

.thread-actions button.is-saved svg,
.action-btn.is-saved svg {
  fill: var(--amber);
}

.thread-actions button svg,
.action-btn svg {
  width: 14px;
  height: 14px;
}

.view-header {
  margin-bottom: 28px;
}

.view-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.view-header h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.view-header p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 680px;
}

.reperes-filter-bar {
  margin-bottom: 24px;
}

.reperes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.repere-card {
  padding: 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.repere-card:hover {
  border-color: rgba(6, 182, 212, 0.4);
  transform: translateY(-2px);
  background: var(--bg-surface-elevated);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--cyan-dim);
}

.repere-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.repere-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
}

.repere-tag {
  font-size: 11px;
  color: var(--text-dim);
}

.repere-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.4;
}

.repere-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.repere-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
}

.repere-action svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.repere-card:hover .repere-action svg {
  transform: translateX(4px);
}

.decodeur-container {
  max-width: 820px;
}

.preset-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.preset-pill {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.preset-pill:hover {
  color: var(--text-white);
  border-color: var(--cyan);
  background: var(--cyan-dim);
}

.preset-pill.is-active {
  color: #ffffff;
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 15px var(--cyan-dim);
}

.decodeur-form-card {
  margin-bottom: 24px;
}

.input-with-button {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 16px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.input-with-button:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.input-prefix {
  color: var(--text-dim);
  margin-right: 12px;
}

.input-prefix svg {
  width: 18px;
  height: 18px;
}

.input-with-button input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-white);
  font-size: 14px;
  outline: none;
}

.input-with-button input::placeholder {
  color: var(--text-dim);
}

.decodeur-result-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.decode-box {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.decode-box.surface {
  border-left: 3px solid var(--cyan);
}

.decode-box.covert {
  border-left: 3px solid var(--rose);
  background: rgba(244, 63, 94, 0.04);
}

.decode-box.response {
  border-left: 3px solid var(--emerald);
  background: rgba(16, 185, 129, 0.04);
}

.box-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.decode-box.surface .box-label { color: var(--cyan); }
.decode-box.covert .box-label { color: var(--rose); }
.decode-box.response .box-label { color: var(--emerald); }

.box-label svg {
  width: 14px;
  height: 14px;
}

.box-text {
  font-size: 14px;
  color: var(--text-white);
  line-height: 1.6;
}

.decode-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.quiz-box {
  max-width: 680px;
}

.quiz-card {
  padding: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.quiz-track {
  height: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 20px;
}

.quiz-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  box-shadow: 0 0 10px var(--cyan);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.quiz-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.quiz-step {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
}

.quiz-note {
  font-size: 11px;
  color: var(--text-dim);
}

.quiz-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.5;
  margin-bottom: 24px;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: var(--transition);
}

.quiz-opt svg {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.quiz-opt:hover:not([disabled]) {
  background: var(--bg-surface-hover);
  border-color: var(--primary);
  color: var(--text-white);
  transform: translateX(3px);
}

.quiz-opt:hover:not([disabled]) svg {
  color: var(--primary);
  transform: translateX(2px);
}

.quiz-opt.is-selected {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 15px var(--primary-glow);
}

.quiz-result {
  padding: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.quiz-result-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
}

.quiz-result-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.app-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 24px 0;
  margin-top: auto;
}

.footer-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: 0.05em;
  display: block;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-dim);
}

.footer-right {
  display: flex;
  gap: 10px;
}

.mobile-bottom-nav {
  display: none;
}

.modal-dialog {
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 0;
  max-width: 560px;
  width: calc(100% - 32px);
  margin: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-subtle);
}

.modal-dialog.modal-lg {
  max-width: 720px;
}

.modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 3px 8px;
  border-radius: 4px;
}

.modal-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-white);
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-white);
}

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

.modal-body {
  padding: 24px;
  max-height: calc(85vh - 70px);
  overflow-y: auto;
}

.modal-intro {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-field label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-white);
  font-size: 13px;
  transition: var(--transition);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.form-error {
  color: var(--rose);
  font-size: 12px;
  margin-top: 10px;
}

.dialogue-example-wrap {
  margin: 18px 0;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.dialogue-example-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.dialogue-example-title svg {
  width: 14px;
  height: 14px;
}

.chat-bubble-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
}

.chat-bubble.other {
  background: rgba(244, 63, 94, 0.08);
  border-left: 3px solid var(--rose);
  color: #fecdd3;
  align-self: flex-start;
  max-width: 90%;
}

.chat-bubble.me {
  background: rgba(16, 185, 129, 0.08);
  border-right: 3px solid var(--emerald);
  color: #a7f3d0;
  align-self: flex-end;
  max-width: 90%;
}

.tech-detail-section {
  margin-bottom: 14px;
}

.tech-detail-section h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-white);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.tech-detail-section p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.emergency-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.emergency-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.emergency-left strong {
  display: block;
  font-size: 14px;
  color: var(--text-white);
  margin-bottom: 2px;
}

.emergency-left span {
  font-size: 12px;
  color: var(--text-dim);
}

.btn-emergency-call {
  padding: 8px 14px;
  background: var(--rose);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.btn-soft {
  padding: 8px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-white);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-soft:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

.btn-main {
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-main:hover {
  background: var(--primary-hover);
}

.languages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 14px;
  max-height: 380px;
  overflow-y: auto;
}

@media (max-width: 860px) {
  .hub-tabs {
    display: none;
  }

  .header-actions .btn-ghost-danger span,
  .header-actions .btn-ghost span,
  .header-actions .btn-cta {
    display: none;
  }

  .app-container {
    padding: 20px 16px 90px;
  }

  .feed-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .feed-header-right {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(9, 10, 15, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
  }

  .mob-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    flex: 1;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dim);
    transition: var(--transition);
  }

  .mob-tab svg {
    width: 20px;
    height: 20px;
  }

  .mob-tab.is-active {
    color: var(--cyan);
  }

  .mob-create-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--cyan));
    color: #ffffff;
    display: grid;
    place-items: center;
    margin: 0;
    box-shadow: 0 0 15px var(--primary-glow);
    flex-shrink: 0;
    align-self: center;
  }

  .mob-create-btn svg {
    width: 20px;
    height: 20px;
  }

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

  .quiz-card {
    padding: 22px 18px;
  }
}
select option {
  background-color: #11131a;
  color: #ffffff;
}

.thread-body button[data-action="edit-thread"],
.thread-body button[data-action="delete-thread"] {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 11px;
  transition: var(--transition);
}

.thread-body button[data-action="edit-thread"]:hover,
.thread-body button[data-action="delete-thread"]:hover {
  color: var(--text-white);
  background: var(--bg-surface-hover);
}

.replies-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.reply-item {
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.reply-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}

.reply-meta strong {
  color: var(--text-white);
}

.reply-meta span {
  color: var(--text-dim);
}

.reply-item p {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}
