@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500&display=swap');

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

/* ═══════════════════════════════════════════
   TEMAS
═══════════════════════════════════════════ */
:root {
  --bg:            #0f0f0f;
  --surface:       #161616;
  --border:        #2a2a2a;
  --border-soft:   #1e1e1e;
  --text:          #e8e6df;
  --muted:         #666;
  --accent:        #c8f135;
  --accent-hover:  #d8ff45;
  --accent-dim:    #9ab82a;
  --danger:        #ff4d4d;
  --btn-text:      #0f0f0f;
  --placeholder:   #2a2a2a;
  --selection-bg:  #c8f13530;
  --flash-bg:      #0f1a00;
  --overlay:       rgba(0,0,0,0.7);
  --mono: 'Space Mono', monospace;
  --sans: 'DM Sans', sans-serif;
}

[data-theme="light"] {
  --bg:            #fafafa;
  --surface:       #ffffff;
  --border:        #e0e0e0;
  --border-soft:   #eeeeee;
  --text:          #1a1a1a;
  --muted:         #888888;
  --accent:        #82a300;
  --accent-hover:  #98bf00;
  --accent-dim:    #637d00;
  --danger:        #e60000;
  --btn-text:      #ffffff;
  --placeholder:   #cccccc;
  --selection-bg:  #82a30030;
  --flash-bg:      #f4fce3;
  --overlay:       rgba(0,0,0,0.4);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

/* ═══════════════════════════════════════════
   ANIMAÇÕES
═══════════════════════════════════════════ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .2; }
}

@keyframes flash-sync-anim {
  from { background: var(--flash-bg); }
  to   { background: var(--bg); }
}

#notepad.flash-sync {
  animation: flash-sync-anim 0.4s ease-out;
}

/* ═══════════════════════════════════════════
   BOTÕES GLOBAIS
═══════════════════════════════════════════ */
.theme-btn {
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  min-width: 38px;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

.btn {
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  min-width: 38px;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

.help-btn {
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  width: 38px;
  height: 32px;
}
.help-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ═══════════════════════════════════════════
   HOME — BOTÕES FIXOS
   FIX #3: Trocado position:absolute → position:fixed.
   O absolute depende do contexto de posicionamento do flex pai (#home),
   o que causa comportamento inconsistente entre browsers mobile quando
   o flex container usa align-items:center. O fixed ancora ao viewport
   diretamente, funcionando em todos os navegadores.
═══════════════════════════════════════════ */
.home-fixed-actions {
  position: fixed;          /* era: position: absolute */
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

/* ═══════════════════════════════════════════
   HOME
═══════════════════════════════════════════ */
#home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.brand {
  font-family: var(--mono);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: .4rem;
}
.brand span { color: var(--accent); }

.tagline {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 3.5rem;
  font-family: var(--mono);
}

.url-box {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color .2s;
}
.url-box:focus-within { border-color: var(--accent); }

.url-prefix {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  padding: 0 0 0 16px;
  white-space: nowrap;
  user-select: none;
}

#route-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent);
  padding: 16px 12px;
  caret-color: var(--accent);
}
#route-input::placeholder { color: var(--placeholder); }

.go-btn {
  background: var(--accent);
  color: var(--btn-text);
  border: none;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  padding: 0 20px;
  height: 52px;
  cursor: pointer;
  transition: background .2s, transform .1s;
  white-space: nowrap;
  letter-spacing: .5px;
}
.go-btn:hover  { background: var(--accent-hover); }
.go-btn:active { transform: scale(.97); }

.info-row {
  display: flex;
  gap: 2rem;
  margin-top: 2.5rem;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}
.info-row span { display: flex; align-items: center; gap: 6px; }

.status-info {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--accent);
  padding: 3px;
}
.online-users { font-size: 14px; opacity: 0.85; font-weight: 500; }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

.footer {
  position: absolute;
  bottom: 24px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 16px;
  color: var(--muted);
  font-family: var(--mono);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer a { color: var(--accent); text-decoration: none; font-weight: 700; transition: color .2s; }
.footer a:hover { color: var(--accent-hover); text-decoration: underline; }
.footer .donate-text { color: var(--text); opacity: 0.8; font-size: 16px; }

/* ═══════════════════════════════════════════
   EDITOR — estrutura geral
═══════════════════════════════════════════ */
#editor-view {
  display: none;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.editor-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ══════════════════════════════════════════════════════════════
   TOPBAR
   FIX #1 (principal): Removido overflow:hidden.
   Esse era o bug raiz do menu hambúrguer: o dropdown
   (.mobile-menu) é position:absolute e fica ABAIXO da topbar,
   mas o overflow:hidden cortava qualquer conteúdo que saísse
   dos limites do elemento pai — tornando o menu invisível mesmo
   quando o JS adicionava a classe .active corretamente.

   Para conter o conteúdo horizontal sem bloquear o dropdown
   vertical, usamos overflow-x:clip (não cria scroll, só corta)
   + overflow-y:visible. Em browsers que não suportam clip,
   o fallback natural é visible, que também funciona.
══════════════════════════════════════════════════════════════ */
.topbar {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 52px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
  gap: 12px;
  flex-shrink: 0;
  overflow-x: clip;     /* era: overflow: hidden  — FIX #1 */
  overflow-y: visible;  /* permite o dropdown escapar para baixo */
  position: relative;
  z-index: 1000;
}

.topbar-brand {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s;
  white-space: nowrap;
}
.topbar-brand:hover { color: var(--accent); }

.topbar-sep { color: var(--border); font-family: var(--mono); }

.route-tag {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
}
.route-tag::-webkit-scrollbar       { height: 4px; }
.route-tag::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;   /* ancora o dropdown .mobile-menu */
  flex-shrink: 0;
}

.status-chip,
.users-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 4px 10px;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.status-dot.saving     { background: #f5a623; animation: blink .6s infinite; }
.status-dot.error      { background: var(--danger); }
.status-dot.connecting { background: #888; animation: blink .8s infinite; }

.conflict-badge {
  display: none;
  align-items: center;
  gap: 6px;
  background: #3a2a00;
  border: 1px solid #f5a623;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #f5a623;
  font-family: var(--mono);
  cursor: pointer;
  white-space: nowrap;
}
@keyframes badge-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.conflict-badge.visible { display: flex; animation: badge-pulse 1.5s infinite; }

.action-btn {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.action-btn:hover        { border-color: var(--accent); color: var(--accent); }
.action-btn.copied       { color: var(--accent); border-color: var(--accent); }
.action-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ══════════════════════════════════════════════════════════════
   MENU MOBILE
   O botão já estava correto (display:none → display:flex via
   media query). O dropdown também estava correto em CSS.
   O problema estava no overflow:hidden do .topbar que o cortava.
   Com o FIX #1 aplicado acima, o menu agora aparece corretamente.
══════════════════════════════════════════════════════════════ */
.mobile-menu-btn {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text);
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  position: relative;
  z-index: 201;
  min-height: 44px;
  min-width: 44px;
  display: none;
  align-items: center;
  justify-content: center;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 220px;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  flex-direction: column;
  gap: 0;
}
.mobile-menu.active { display: flex; }

.mobile-menu .action-btn {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  font-size: 13px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  color: var(--muted);
  font-size: 14px;
  padding: 3px 8px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  line-height: 1.4;
  flex-shrink: 0;
  position: relative;
  z-index: 201;
}
.sidebar-toggle-btn:hover { color: var(--text); border-color: var(--border); }

/* ── Sidebar ──────────────────────────────── */
#sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0 16px;
  flex-shrink: 0;
  transition: width 0.25s ease, min-width 0.25s ease, padding 0.25s ease;
  position: relative;
  z-index: 100;
}

#sidebar.collapsed {
  width: 0;
  min-width: 0;
  padding: 0;
  border-right: none;
  overflow: hidden;
}

.sidebar-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 8px;
  white-space: nowrap;
}

.sidebar-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  cursor: default;
}
.sidebar-node.ancestor,
.sidebar-node.child-node { cursor: pointer; }
.sidebar-node.ancestor:hover,
.sidebar-node.child-node:hover { background: var(--border-soft); color: var(--text); }
.sidebar-node.current { color: var(--accent); font-weight: 600; }
.node-icon  { font-size: 10px; flex-shrink: 0; opacity: 0.7; }
.node-label { overflow: hidden; text-overflow: ellipsis; }
.sidebar-children { margin-bottom: 4px; }
.sidebar-divider  { height: 1px; background: var(--border-soft); margin: 10px 12px; }

.sidebar-new { display: flex; align-items: center; gap: 6px; padding: 0 10px; }

.sidebar-input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
  padding: 5px 8px;
  outline: none;
  min-width: 0;
  transition: border-color 0.2s;
}
.sidebar-input::placeholder { color: var(--muted); }
.sidebar-input:focus        { border-color: var(--accent); }

.sidebar-add-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 3px 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}
.sidebar-add-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Painel principal ─────────────────────── */
.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Barra de anexos ──────────────────────── */
.attachments-bar {
  display: none;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  overflow-x: auto;
  flex-shrink: 0;
}
.attachments-bar::-webkit-scrollbar       { height: 4px; }
.attachments-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  min-width: 220px;
  max-width: 280px;
  flex-shrink: 0;
}
.file-icon { font-size: 20px; }
.file-info { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.file-name {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.file-size { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 2px; }
.file-actions { display: flex; gap: 4px; }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 6px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover        { background: var(--border-soft); color: var(--accent); }
.icon-btn.delete:hover { color: var(--danger); }

/* ── Textarea ─────────────────────────────── */
#notepad {
  flex: 1;
  background: var(--bg);
  border: none;
  outline: none;
  resize: none;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  padding: 32px 40px;
  caret-color: var(--accent);
  overflow-y: auto;
  transition: background-color 0.3s;
}
#notepad::placeholder { color: var(--placeholder); }
#notepad::selection   { background: var(--selection-bg); }
#notepad:disabled     { opacity: .5; cursor: not-allowed; }
#notepad::-webkit-scrollbar       { width: 4px; }
#notepad::-webkit-scrollbar-track { background: transparent; }
#notepad::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Bottombar ────────────────────────────── */
.bottombar {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 32px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
  flex-shrink: 0;
  gap: 16px;
  position: relative;
  z-index: 50;
}
.stat       { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.last-saved { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--muted); }
[data-theme="dark"] .last-saved { color: var(--accent); }

/* ═══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
#toast {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: var(--btn-text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 9999;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════
   MODAL DE UPLOAD / FEEDBACK
═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.modal-overlay.active .modal-content { transform: translateY(0); }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-header h3 { font-size: 16px; font-weight: 500; }

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
}
.close-modal-btn:hover { color: var(--danger); }

.modal-desc { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 24px; line-height: 1.5; }
.modal-desc span { color: var(--accent); }

.feedback-textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 12px;
  font-family: var(--sans);
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
}
.feedback-textarea::placeholder { color: var(--muted); }

/* ═══════════════════════════════════════════════════════════════
   MODAL DE CONFLITO
   FIX #2: Trocado display:flex fixo → display:none por padrão.
   O problema original: o modal usava opacity:0 + visibility:hidden
   para ficar "invisível", mas mantinha display:flex — isso significa
   que ele existia no DOM como um bloco position:fixed de tela cheia.
   Em alguns browsers mobile (iOS Safari, WebView Android), o elemento
   permanecia interceptando eventos de toque e em certos casos o
   backdrop-filter causava artefatos visuais aparecendo na tela.
   
   Com display:none o elemento é completamente removido do layout
   e da árvore de renderização. O .active adiciona display:flex,
   tornando-o visível. A transição de opacidade é substituída por
   uma animação CSS simples para preservar o efeito de entrada.
═══════════════════════════════════════════════════════════════ */
@keyframes conflict-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes conflict-slide-in {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

#conflict-modal {
  display: none;           /* era: display:flex com opacity/visibility — FIX #2 */
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.75);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#conflict-modal.active {
  display: flex;           /* agora ativado com display, não apenas opacity */
  animation: conflict-fade-in 0.2s ease forwards;
}

#conflict-modal.active .conflict-box {
  animation: conflict-slide-in 0.25s ease forwards;
}

.conflict-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conflict-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.conflict-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #3a2a00;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.conflict-title    { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.2; }
.conflict-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }

.conflict-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  overflow: hidden;
}
.conflict-side {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-soft);
  overflow: hidden;
}
.conflict-side:last-child { border-right: none; }

.conflict-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.conflict-side-title         { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.conflict-side-title.mine    { color: var(--accent); }
.conflict-side-title.theirs  { color: #7eb3f7; }
.conflict-side-meta          { font-size: 11px; color: var(--muted); font-family: monospace; }

.conflict-preview {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  font-family: monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  margin: 0;
  min-height: 120px;
  max-height: 260px;
}
.conflict-preview::-webkit-scrollbar       { width: 3px; }
.conflict-preview::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.conflict-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.conflict-footer-tip { font-size: 11px; color: var(--muted); flex: 1; min-width: 160px; }

.conflict-btn {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid;
  border-radius: 5px;
  padding: 12px 18px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.3px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.conflict-btn:active { transform: scale(0.97); }

.conflict-btn.keep-mine {
  background: var(--accent);
  color: #0f0f0f;
  border-color: var(--accent);
}
.conflict-btn.keep-mine:hover { opacity: 0.88; }

.conflict-btn.accept-theirs {
  background: transparent;
  color: #7eb3f7;
  border-color: #7eb3f7;
}
.conflict-btn.accept-theirs:hover { background: rgba(126,179,247,0.08); }

/* ═══════════════════════════════════════════
   RESPONSIVO
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .hide-mobile     { display: none !important; }
  .mobile-menu-btn { display: flex; }
}

@media (max-width: 640px) {
  #sidebar {
    position: absolute;
    top: 0;
    left: -220px;
    bottom: 0;
    width: 220px !important;
    min-width: 220px !important;
    padding: 12px 0 16px !important;
    overflow: visible;
    z-index: 150;
    box-shadow: none;
    transition: left 0.25s ease, box-shadow 0.25s ease;
    border-right: 1px solid var(--border-soft);
  }

  #sidebar:not(.collapsed) {
    left: 0;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.5);
  }

  #sidebar.collapsed {
    left: -220px;
    box-shadow: none;
  }

  .conflict-compare { grid-template-columns: 1fr; }
  .conflict-side {
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
    max-height: 160px;
  }
  .conflict-side:last-child { border-bottom: none; }
  .conflict-footer { flex-direction: column; align-items: stretch; }
  .conflict-btn    { width: 100%; }
}

@media (max-width: 600px) {
  .url-box    { flex-wrap: wrap; }
  .url-prefix { padding: 12px 16px 0; }
  #route-input { padding: 8px 12px 12px; }
  .go-btn { width: 100%; height: 44px; }
  #notepad { padding: 20px; }
  .topbar  { padding: 0 12px; gap: 8px; }
  .route-tag { font-size: 11px; }
  .info-row  { font-size: 10px; gap: 0.8rem; margin-top: 1.5rem; }
  .status-info { gap: 8px; padding: 2px 4px; }
  .online-users { font-size: 11px; }
  .dot { width: 5px; height: 5px; }
  .footer { font-size: 12px; gap: 4px; padding: 0 16px; bottom: 16px; }
  .footer .donate-text { font-size: 11px; }
}