:root {
  --bg: #14171c;
  --panel: #1b1f26;
  --panel2: #232831;
  --borde: #313744;
  --texto: #e8ebf0;
  --tenue: #99a2b1;
  --acento: #3d7bff;
  --peligro: #e5484d;
  --radio: 8px;
  --nav-h: 58px;
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
  --seguro-arriba: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--texto);
  display: grid;
  grid-template-areas: "barra barra barra" "paleta lienzo props" "estado estado estado";
  grid-template-columns: 200px minmax(0, 1fr) 290px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
#i-mas circle, .ic circle { fill: currentColor; }
.solo-movil { display: none !important; }
.hoja-cab { display: none; }

/* ---------- Barra superior ---------- */
#barra {
  grid-area: barra; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--borde);
}
.marca { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.marca b { font-size: 15px; white-space: nowrap; }
.marca span { color: var(--tenue); font-size: 12px; }
.marca svg { color: var(--acento); flex: none; }
#barra button, .btn {
  background: var(--panel2); border: 1px solid var(--borde); border-radius: var(--radio); padding: 6px 10px;
  display: inline-flex; align-items: center; gap: 6px;
}
#barra button:hover, .btn:hover { border-color: var(--acento); }
#barra button.activo { background: var(--acento); border-color: var(--acento); color: #fff; }
.seg { display: inline-flex; }
#barra .seg button { border-radius: 0; margin-left: -1px; }
#barra .seg button:first-child { border-radius: var(--radio) 0 0 var(--radio); margin-left: 0; }
#barra .seg button:last-child { border-radius: 0 var(--radio) var(--radio) 0; }
.grupo { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#ajustes { display: contents; }
.opciones { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.opciones label { display: flex; align-items: center; gap: 5px; color: var(--tenue); font-size: 13px; }
select, input[type=number] {
  background: var(--panel2); border: 1px solid var(--borde); border-radius: 6px; padding: 5px 6px; color: var(--texto);
}
#inPlano { width: 64px; }
.con-unidad { display: inline-flex; align-items: center; gap: 6px; color: var(--tenue); }
.menu-cont { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel2); border: 1px solid var(--borde);
  border-radius: var(--radio); padding: 6px; display: flex; flex-direction: column; min-width: 230px; z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.menu[hidden] { display: none; }
#barra .menu button { background: transparent; border: 0; text-align: left; padding: 9px 10px; }
#barra .menu button:hover { background: var(--panel); }
.menu hr { border: 0; border-top: 1px solid var(--borde); margin: 4px 0; width: 100%; }
.btn-icono { background: transparent; border: 0; padding: 6px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--texto); }

/* ---------- Paleta de piezas ---------- */
#paleta { grid-area: paleta; background: var(--panel); border-right: 1px solid var(--borde); overflow: auto; padding: 10px; }
#paleta h4 { margin: 14px 4px 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--tenue); }
#listaModelos > h4:first-child { margin-top: 2px; }
.piezas { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pieza {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px;
  background: var(--panel2); border: 1px solid var(--borde); border-radius: var(--radio);
  font-size: 12px; line-height: 1.2; text-align: center; cursor: grab; user-select: none; -webkit-user-select: none;
}
.pieza:hover { border-color: var(--acento); }
.pieza.activa { border-color: var(--acento); background: rgba(61, 123, 255, .2); }
.icono { color: #c9d1dc; flex: none; }
.modelos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.modelo { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; background: var(--panel2); border: 1px solid var(--borde); border-radius: var(--radio); font-size: 12px; line-height: 1.2; text-align: center; }
.modelo:hover { border-color: var(--acento); }
.modelo svg { width: 44px; height: 36px; color: #c9d1dc; }
.modelo svg path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modelo small { color: var(--tenue); font-size: 10.5px; }
.icono path { fill: currentColor; stroke: currentColor; stroke-width: 1; stroke-linejoin: round; }
.icono-plancha path { fill: none; }
.icono-plancha circle { fill: currentColor; stroke: none; }
#chipAnchoCont[hidden] { display: none; }
#chipAncho { width: 70px; }

/* ---------- Área de trabajo ---------- */
#lienzo { grid-area: lienzo; position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #cfd6de; }
#lienzo canvas { display: block; }
.capa-etiquetas { position: absolute; inset: 0; pointer-events: none; }
.cota {
  background: rgba(255, 255, 255, .93); color: #1b1f26; border: 1px solid #c3c9d2; border-radius: 4px;
  padding: 1px 5px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.cota-prev { background: var(--acento); color: #fff; border-color: var(--acento); font-size: 12px; }
#cargando { position: absolute; inset: 0; display: grid; place-items: center; color: #4a5260; pointer-events: none; padding: 16px; text-align: center; }

#chip {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5;
  background: rgba(27, 31, 38, .94); border: 1px solid var(--borde); border-radius: 12px; padding: 8px;
  display: flex; flex-direction: column; gap: 6px; width: max-content; max-width: calc(100% - 20px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35); backdrop-filter: blur(6px);
}
#chip[hidden] { display: none; }
.chip-fila { display: flex; align-items: center; gap: 8px; }
#chipIcono { display: inline-flex; }
#chipIcono .icono { width: 26px; height: 26px; }
#chipMedida { flex: 1; min-width: 0; max-width: 240px; }
#chipLargo { width: 78px; }
.flechas { display: flex; gap: 4px; margin-left: auto; }
.flechas button { background: var(--panel2); border: 1px solid var(--borde); border-radius: 8px; padding: 5px; display: grid; place-items: center; }
.flechas button:active { background: var(--acento); }
#chipAyuda { font-size: 11.5px; color: var(--tenue); text-align: center; }

.flotantes { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 4; }
.flot { background: rgba(27, 31, 38, .9); border: 1px solid var(--borde); width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.flot.activo { background: var(--acento); border-color: var(--acento); color: #fff; }
.herramientas { position: absolute; left: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 4; }
.flot.herr { width: 64px; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; color: var(--texto); font-size: 10.5px; }
.flot.herr span { line-height: 1; }
.chip-tog { display: inline-flex; align-items: center; gap: 4px; background: var(--panel2); border: 1px solid var(--borde); border-radius: 8px; padding: 4px 7px; font-size: 12px; color: var(--tenue); }
.chip-tog .ic { width: 16px; height: 16px; }
.chip-tog.activo { background: var(--acento); border-color: var(--acento); color: #fff; }
.giro-fila { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.giro-fila .btn { justify-content: center; padding: 7px 0; }
.giro-libre { display: flex; gap: 6px; align-items: center; }
.giro-libre input { width: 80px; }
.giro-libre .btn { flex: 1; justify-content: center; }
#aviso {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 6; pointer-events: none;
  background: rgba(20, 23, 28, .92); color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 13px; max-width: 80%; text-align: center;
}

/* ---------- Panel de propiedades ---------- */
#props { grid-area: props; background: var(--panel); border-left: 1px solid var(--borde); overflow: auto; padding: 10px; }
.bloque { background: var(--panel2); border: 1px solid var(--borde); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.bloque h3 { margin: 0 0 10px; font-size: 13px; }
.campo { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 12px; color: var(--tenue); }
.campo select, .campo input[type=number] { width: 100%; }
.campo.fila { flex-direction: row; align-items: center; justify-content: space-between; }
.muestras { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 10px; }
.muestra { aspect-ratio: 1; border-radius: 6px; border: 2px solid var(--borde); background: var(--c); padding: 0; }
.muestra.activa { border-color: #fff; box-shadow: 0 0 0 2px var(--acento); }
input[type=color] { width: 44px; height: 28px; border: 1px solid var(--borde); border-radius: 6px; background: var(--panel); padding: 2px; }
.btn.ancho { width: 100%; justify-content: center; }
.acciones { display: flex; gap: 8px; }
.acciones .btn { flex: 1; justify-content: center; }
.btn.peligro { color: #ff8a8d; }
.btn.peligro:hover { border-color: var(--peligro); }
.ayuda { margin: 0 0 4px; padding-left: 18px; color: var(--tenue); font-size: 12.5px; }
.ayuda li { margin-bottom: 6px; }
.ayuda b { color: var(--texto); font-weight: 600; }
.nota { color: var(--tenue); font-size: 12px; margin: 0 0 8px; }
.dato { margin: 0 0 10px; font-size: 13px; }
.seg.chico { display: flex; }
.seg.chico button { padding: 6px 0; flex: 1; font-size: 12px; background: var(--panel); border: 1px solid var(--borde); margin-left: -1px; }
.seg.chico button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.seg.chico button:last-child { border-radius: 0 6px 6px 0; }
.seg.chico button.activo { background: var(--acento); border-color: var(--acento); color: #fff; }
kbd { background: var(--panel); border: 1px solid var(--borde); border-radius: 4px; padding: 0 4px; font-size: 11px; font-family: inherit; }
.resumen p { margin: 0 0 4px; font-size: 13px; }

/* ---------- Barra de estado ---------- */
#estado {
  grid-area: estado; display: flex; gap: 16px; align-items: center; padding: 6px 12px;
  background: var(--panel); border-top: 1px solid var(--borde); font-size: 12px; color: var(--tenue);
}
#hint { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#coords, #resumen { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* =================== Móvil y tablet: diseño de aplicación =================== */
@media (max-width: 900px) {
  body {
    grid-template-areas: "barra" "lienzo" "nav";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    user-select: none; -webkit-user-select: none;
  }
  .solo-movil { display: revert !important; }
  .solo-escritorio { display: none !important; }

  #barra { flex-wrap: nowrap; gap: 8px; padding: calc(6px + var(--seguro-arriba)) 8px 6px; }
  .marca { gap: 6px; }
  .marca span { display: none; }
  #barra .seg button { padding: 7px 10px; font-size: 13px; }
  #btnMas { width: 38px; height: 38px; padding: 0; display: inline-grid !important; place-items: center; background: transparent; border: 0; }

  /* Hojas deslizables desde abajo */
  .hoja {
    position: fixed !important; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--seguro-abajo));
    z-index: 30; max-height: 62dvh; overflow: auto; overscroll-behavior: contain;
    background: var(--panel); border: 0; border-top: 1px solid var(--borde);
    border-radius: 16px 16px 0 0; padding: 0 12px 12px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .45);
    transform: translateY(calc(100% + var(--nav-h) + 40px)); transition: transform .22s ease; visibility: hidden;
  }
  body[data-hoja="piezas"] #paleta, body[data-hoja="props"] #props, body[data-hoja="ajustes"] #ajustes { transform: none; visibility: visible; }
  #ajustes { display: block; }
  .hoja-cab {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1;
    background: var(--panel); padding: 14px 0 10px; margin-bottom: 4px;
  }
  .hoja-cab b { font-size: 15px; }
  .asa { position: absolute; left: 50%; top: 5px; width: 40px; height: 4px; border-radius: 2px; background: var(--borde); transform: translateX(-50%); }

  #paleta h4 { margin: 10px 2px 6px; }
  .piezas { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .pieza { padding: 10px 4px; font-size: 12px; }
  .modelos { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .modelo { padding: 8px 2px; }

  .opciones { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 14px; }
  .opciones label { justify-content: space-between; font-size: 14px; color: var(--texto); }
  .opciones select { min-width: 150px; }
  .opciones label.chk { justify-content: flex-start; }
  .menu-cont { border-top: 1px solid var(--borde); padding-top: 8px; }
  #menuArchivo { position: static; display: flex !important; background: transparent; border: 0; box-shadow: none; padding: 0; min-width: 0; }
  #menuArchivo [hidden] { display: none; }
  #barra .menu button { padding: 12px 4px; font-size: 15px; border-radius: 0; }
  #barra .menu button:hover { background: transparent; }

  #props .bloque { margin-bottom: 10px; }
  .muestras { grid-template-columns: repeat(6, 1fr); gap: 8px; }
  input, select { font-size: 16px; } /* evita el zoom automático en iOS */
  .campo select, .campo input[type=number] { padding: 8px; }

  /* Barra inferior */
  #nav {
    grid-area: nav; display: grid !important; grid-template-columns: repeat(6, 1fr);
    height: calc(var(--nav-h) + var(--seguro-abajo)); padding-bottom: var(--seguro-abajo);
    background: var(--panel); border-top: 1px solid var(--borde); position: relative; z-index: 31;
  }
  #nav button { background: transparent; border: 0; color: var(--tenue); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; }
  #nav button .ic { width: 22px; height: 22px; }
  #nav button.activo { color: var(--acento); }

  /* Barra de pieza seleccionada */
  #barraSel {
    position: fixed; left: 8px; right: 8px; bottom: calc(var(--nav-h) + var(--seguro-abajo) + 8px); z-index: 20;
    display: flex !important; align-items: center; gap: 4px; padding: 6px 6px 6px 12px;
    background: rgba(27, 31, 38, .96); border: 1px solid var(--borde); border-radius: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
  }
  #barraSel[hidden], body[data-hoja]:not([data-hoja=""]) #barraSel { display: none !important; }
  #selInfo { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #selInfo small { color: var(--tenue); }
  #barraSel button { background: var(--panel2); border: 1px solid var(--borde); border-radius: 10px; width: 40px; height: 40px; display: grid; place-items: center; }
  #barraSel button.peligro { color: #ff8a8d; }
  body:has(#barraSel:not([hidden])) .flotantes, body:has(#barraSel:not([hidden])) .herramientas { bottom: 76px; }
  .herramientas { left: 8px; gap: 6px; }
  #aviso { top: 10px; bottom: auto; max-width: calc(100% - 20px); }
  body:has(#chip:not([hidden])) #aviso { top: 150px; }
  .flot.herr { width: 60px; height: 46px; font-size: 10px; }

  #chip { top: 8px; padding: 8px; gap: 6px; width: calc(100% - 16px); }
  #chipMedida { max-width: none; }
  .flechas button { width: 38px; height: 38px; }
  #chipLargo { width: 84px; }
}
@media (max-width: 400px) {
  .marca b { display: none; }
  #barra { gap: 5px; padding-left: 6px; padding-right: 4px; }
  #barra .seg button { padding: 7px 7px; font-size: 12.5px; }
  #btnMas { width: 30px !important; }
  .btn-cuenta .avatar { width: 24px; height: 24px; }
}
#bloqueGirar, #bloqueAcabado { scroll-margin-top: 64px; }

/* ---------- Lista de materiales ---------- */
#lista { display: none; }
#velo { display: none; }
body[data-hoja="cuenta"] #cuentaHoja,
body[data-hoja="lista"] #lista {
  display: block; visibility: visible; position: fixed; z-index: 50; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto;
  background: var(--panel); border: 1px solid var(--borde); border-radius: 14px; padding: 0 14px 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}
body[data-hoja="cuenta"] #velo, body[data-hoja="lista"] #velo { display: block; position: fixed; inset: 0; z-index: 49; background: rgba(0, 0, 0, .45); }
#cuentaHoja .hoja-cab, #lista .hoja-cab { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1; background: var(--panel); padding: 12px 0 10px; }
#cuentaHoja .hoja-cab b, #lista .hoja-cab b { font-size: 15px; }
#lista .asa, #cuentaHoja .asa { display: none; }
#cuentaHoja { display: none; }
#lista input[type=text], #lista textarea {
  width: 100%; background: var(--panel2); border: 1px solid var(--borde); border-radius: 6px; padding: 7px 8px; color: var(--texto); font: inherit; resize: vertical;
}
.btn.primario { background: var(--acento); border-color: var(--acento); color: #fff; font-weight: 600; }
.btn:disabled { opacity: .6; }
#lista .acciones { margin-bottom: 8px; }
.resumen-cajas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.resumen-cajas div { background: var(--panel); border: 1px solid var(--borde); border-radius: 8px; padding: 7px 9px; display: flex; flex-direction: column; }
.resumen-cajas small { color: var(--tenue); font-size: 11px; }
.resumen-cajas b { font-size: 16px; }
.opciones-lista { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opciones-lista .campo { margin: 0; }
.tabla-cont { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla th { text-align: left; font-size: 11px; color: var(--tenue); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--borde); }
.tabla td { padding: 6px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla td small { color: var(--tenue); }
.tabla .der { text-align: right; white-space: nowrap; }
.tabla .centro { text-align: center; width: 34px; }
.marca-letra { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 12px; border: 1.5px solid var(--acento); color: #8fb0ff; font-weight: 700; font-size: 12px; }
.punto-color { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--c); border: 1px solid var(--borde); margin-right: 6px; vertical-align: -1px; }
@media (max-width: 900px) {
  body[data-hoja="cuenta"] #cuentaHoja,
body[data-hoja="lista"] #lista {
    top: auto; left: 0; right: 0; transform: none; width: auto; max-height: 86dvh;
    bottom: calc(var(--nav-h) + var(--seguro-abajo)); border-radius: 16px 16px 0 0; border: 0; border-top: 1px solid var(--borde);
  }
  #lista .asa, #cuentaHoja .asa { display: block; }
  body[data-hoja="cuenta"] #velo, body[data-hoja="lista"] #velo { bottom: calc(var(--nav-h) + var(--seguro-abajo)); }
  #nav button span { font-size: 10px; }
}

#cajaSel { position: fixed; z-index: 40; pointer-events: none; border: 1px dashed var(--acento); background: rgba(61, 123, 255, .12); }
.gestos { border-top: 1px solid var(--borde); padding: 10px 0 12px; font-size: 13px; color: var(--tenue); }
.gestos b { color: var(--texto); }
.gestos ul { margin: 6px 0 0; padding-left: 18px; }
.gestos li { margin-bottom: 5px; }

.cota.torcida { background: #ffe7b0; border-color: #e0a000; color: #5a3d00; }
.inclinacion { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--borde); font-size: 13px; }
.inclinacion small { color: var(--tenue); }
.inclinacion.ok { color: #4ade80; }
.inclinacion.mal { border-color: #e0a000; color: #ffcf6b; }
.txt-mal { color: #ffcf6b; }
#barraSel button.aviso-btn { color: #1b1f26; background: #ffcf6b; border-color: #e0a000; }
#barraSel button[hidden] { display: none; }

.dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dims .campo input { width: 100%; }
.icono-forma path, .icono-forma ellipse, .icono-forma circle { fill: none !important; stroke: currentColor; stroke-width: 1.6; }
#props input[type=text] { width: 100%; background: var(--panel2); border: 1px solid var(--borde); border-radius: 6px; padding: 7px 8px; color: var(--texto); font: inherit; }

.cruceta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 6px; }
.cruceta .btn { justify-content: center; padding: 9px 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.cruceta [data-mover="sube"], .cruceta [data-mover="baja"] { grid-column: span 2; }

.caja-acc { position: absolute; left: 80px; bottom: 10px; z-index: 8; width: min(330px, calc(100% - 96px)); max-height: calc(100% - 20px); overflow: auto;
  background: rgba(27, 31, 38, .97); border: 1px solid var(--borde); border-radius: 12px; padding: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.caja-acc[hidden] { display: none; }
.caja-cab { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; }
.caja-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.acc { background: var(--panel2); border: 1px solid var(--borde); border-radius: 8px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--texto); line-height: 1.15; text-align: center; }
.acc:hover { border-color: var(--acento); }
.acc .icono { color: #c9d1dc; }
@media (max-width: 900px) {
  .caja-acc { left: 74px; width: calc(100% - 84px); }
  body:has(#barraSel:not([hidden])) .caja-acc { bottom: 76px; }
}

/* ---------- Cuenta de usuario ---------- */
.btn-cuenta { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--borde); border-radius: 20px; padding: 3px 10px 3px 3px; color: var(--texto); }
.btn-cuenta .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--acento); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.btn-cuenta .cuenta-txt { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.estado-guardado { font-size: 12px; font-weight: 700; }
.e-listo { color: #4ade80; } .e-guardando { color: var(--tenue); } .e-pendiente { color: #ffcf6b; } .e-error { color: #ff8a8d; }
.tenue { color: var(--tenue); font-weight: 400; }
.lista-proy { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.proy { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--borde); border-radius: 8px; padding: 4px 4px 4px 0; }
.proy.actual { border-color: var(--acento); }
.proy-abrir { flex: 1; min-width: 0; text-align: left; background: none; border: 0; color: var(--texto); padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.proy-abrir b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proy-abrir small { color: var(--tenue); font-size: 11.5px; }
.btn-icono.peligro { color: #ff8a8d; }
#cuentaHoja input[type=password] { width: 100%; background: var(--panel2); border: 1px solid var(--borde); border-radius: 6px; padding: 7px 8px; color: var(--texto); font: inherit; }
a.btn { text-decoration: none; color: var(--texto); justify-content: center; }
#ingreso { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 30% 20%, #26324a, #12151b 70%); }
.ingreso-caja { width: min(360px, 100%); background: var(--panel); border: 1px solid var(--borde); border-radius: 16px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.ingreso-caja .campo input { width: 100%; background: var(--panel2); border: 1px solid var(--borde); border-radius: 8px; padding: 10px; color: var(--texto); font-size: 16px; }
.ingreso-marca { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--acento); }
.ingreso-marca b { display: block; color: var(--texto); font-size: 18px; }
.ingreso-marca span { color: var(--tenue); font-size: 12.5px; }
.ingreso-error { color: #ff8a8d; font-size: 13px; margin: 0 0 10px; }
.ingreso-caja .btn.primario { padding: 11px; font-size: 15px; margin-bottom: 8px; }
@media (max-width: 900px) { .btn-cuenta .cuenta-txt { display: none; } .btn-cuenta { padding: 3px; } }
